diff options
author | Jan Arne Petersen <jpetersen@openismus.com> | 2013-01-16 21:26:38 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-02-15 16:55:27 -0500 |
commit | 4653531e7a846abc5fee89a74f5edf3e1835fc5e (patch) | |
tree | e02dd3f3a89082bf4075b3628501b9d882d06318 /src/text-backend.c | |
parent | 18639f8d4a28b4471516080c7af68926eaeb62e2 (diff) |
text: add pre-edit styling support to protocol
Also add a separate preedit-cursor event and add a commit argument to
preedit-string to allow to support commit on reset. Fix editor and
keyboard example to adapt to the protocol changes.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Diffstat (limited to 'src/text-backend.c')
-rw-r--r-- | src/text-backend.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/text-backend.c b/src/text-backend.c index d123da9..7f8c16e 100644 --- a/src/text-backend.c +++ b/src/text-backend.c @@ -338,13 +338,35 @@ input_method_context_commit_string(struct wl_client *client, static void input_method_context_preedit_string(struct wl_client *client, - struct wl_resource *resource, - const char *text, - uint32_t index) + struct wl_resource *resource, + const char *text, + const char *commit) +{ + struct input_method_context *context = resource->data; + + text_model_send_preedit_string(&context->model->resource, text, commit); +} + +static void +input_method_context_preedit_styling(struct wl_client *client, + struct wl_resource *resource, + uint32_t index, + uint32_t length, + uint32_t style) +{ + struct input_method_context *context = resource->data; + + text_model_send_preedit_styling(&context->model->resource, index, length, style); +} + +static void +input_method_context_preedit_cursor(struct wl_client *client, + struct wl_resource *resource, + int32_t cursor) { struct input_method_context *context = resource->data; - text_model_send_preedit_string(&context->model->resource, text, index); + text_model_send_preedit_cursor(&context->model->resource, cursor); } static void @@ -495,6 +517,8 @@ static const struct input_method_context_interface input_method_context_implemen input_method_context_destroy, input_method_context_commit_string, input_method_context_preedit_string, + input_method_context_preedit_styling, + input_method_context_preedit_cursor, input_method_context_delete_surrounding_text, input_method_context_modifiers_map, input_method_context_keysym, |