Commit 422e7789 authored by Roman Gilg's avatar Roman Gilg
Browse files

[server] Put set surrounding text callback with uint in v0 class

Summary:
The set surrounding text request is only in v0 of text-input with uint arguments,
in v2 and v3 the call has the same signature.

To increase readability put the uint version in the v0 class implementation
and rename callbacks.

Test Plan: Compiles

Reviewers: #kwin, #frameworks, zzag

Reviewed By: #kwin, zzag

Subscribers: davidedmundson, zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D16675
parent 6f45c744
......@@ -77,12 +77,7 @@ void TextInputInterface::Private::hideInputPanelCallback(wl_client *client, wl_r
emit p->q_func()->requestHideInputPanel();
}
void TextInputInterface::Private::setSurroundingTextCallback(wl_client *client, wl_resource *resource, const char * text, uint32_t cursor, uint32_t anchor)
{
setSurroundingText2Callback(client, resource, text, cursor, anchor);
}
void TextInputInterface::Private::setSurroundingText2Callback(wl_client *client, wl_resource *resource, const char * text, int32_t cursor, int32_t anchor)
void TextInputInterface::Private::setSurroundingTextCallback(wl_client *client, wl_resource *resource, const char * text, int32_t cursor, int32_t anchor)
{
auto p = cast<Private>(resource);
Q_ASSERT(*p->client == client);
......
......@@ -91,8 +91,7 @@ protected:
static void disableCallback(wl_client *client, wl_resource *resource, wl_resource * surface);
static void showInputPanelCallback(wl_client *client, wl_resource *resource);
static void hideInputPanelCallback(wl_client *client, wl_resource *resource);
static void setSurroundingTextCallback(wl_client *client, wl_resource *resource, const char * text, uint32_t cursor, uint32_t anchor);
static void setSurroundingText2Callback(wl_client *client, wl_resource *resource, const char * text, int32_t cursor, int32_t anchor);
static void setSurroundingTextCallback(wl_client *client, wl_resource *resource, const char * text, int32_t cursor, int32_t anchor);
static void setContentTypeCallback(wl_client *client, wl_resource *resource, uint32_t hint, uint32_t purpose);
static void setCursorRectangleCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height);
static void setPreferredLanguageCallback(wl_client *client, wl_resource *resource, const char * language);
......
......@@ -61,6 +61,7 @@ private:
}
static void resetCallback(wl_client *client, wl_resource *resource);
static void setSurroundingTextUintCallback(wl_client *client, wl_resource *resource, const char * text, uint32_t cursor, uint32_t anchor);
static void commitStateCallback(wl_client *client, wl_resource *resource, uint32_t serial);
static void invokeActionCallback(wl_client *client, wl_resource *resource, uint32_t button, uint32_t index);
......@@ -74,7 +75,7 @@ const struct wl_text_input_interface TextInputUnstableV0Interface::Private::s_in
showInputPanelCallback,
hideInputPanelCallback,
resetCallback,
setSurroundingTextCallback,
setSurroundingTextUintCallback,
setContentTypeCallback,
setCursorRectangleCallback,
setPreferredLanguageCallback,
......@@ -229,6 +230,11 @@ void TextInputUnstableV0Interface::Private::resetCallback(wl_client *client, wl_
emit p->q_func()->requestReset();
}
void TextInputUnstableV0Interface::Private::setSurroundingTextUintCallback(wl_client *client, wl_resource *resource, const char * text, uint32_t cursor, uint32_t anchor)
{
setSurroundingTextCallback(client, resource, text, cursor, anchor);
}
void TextInputUnstableV0Interface::Private::commitStateCallback(wl_client *client, wl_resource *resource, uint32_t serial)
{
auto p = cast<Private>(resource);
......
......@@ -70,7 +70,7 @@ const struct zwp_text_input_v2_interface TextInputUnstableV2Interface::Private::
disableCallback,
showInputPanelCallback,
hideInputPanelCallback,
setSurroundingText2Callback,
setSurroundingTextCallback,
setContentTypeCallback,
setCursorRectangleCallback,
setPreferredLanguageCallback,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment