[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
This commit is contained in:
Roman Gilg 2018-11-04 23:32:31 +01:00
parent 6f45c74471
commit 422e7789a6
4 changed files with 10 additions and 10 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -70,7 +70,7 @@ const struct zwp_text_input_v2_interface TextInputUnstableV2Interface::Private::
disableCallback,
showInputPanelCallback,
hideInputPanelCallback,
setSurroundingText2Callback,
setSurroundingTextCallback,
setContentTypeCallback,
setCursorRectangleCallback,
setPreferredLanguageCallback,