text: Add reset requets to protocol

Add a reset request to the text_model interface and a reset event to the
input_method_context interface. Use it to reset the pre-edit buffers in
the example keyboard when the cursor is moved in the example editor
client.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
This commit is contained in:
Jan Arne Petersen
2012-09-09 23:08:46 +02:00
committed by Kristian Høgsberg
parent ce8a4433f5
commit c1e481efb1
5 changed files with 39 additions and 0 deletions
+15
View File
@@ -172,6 +172,20 @@ text_model_deactivate(struct wl_client *client,
weston_seat->input_method);
}
static void
text_model_reset(struct wl_client *client,
struct wl_resource *resource)
{
struct text_model *text_model = resource->data;
struct input_method *input_method, *next;
wl_list_for_each_safe(input_method, next, &text_model->input_methods, link) {
if (!input_method->context)
continue;
input_method_context_send_reset(&input_method->context->resource);
}
}
static void
text_model_set_micro_focus(struct wl_client *client,
struct wl_resource *resource,
@@ -198,6 +212,7 @@ static const struct text_model_interface text_model_implementation = {
text_model_set_surrounding_text,
text_model_activate,
text_model_deactivate,
text_model_reset,
text_model_set_micro_focus,
text_model_set_preedit,
text_model_set_content_type