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>
diff --git a/src/text-backend.c b/src/text-backend.c
index 0a93b6b..4190fe7 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -173,6 +173,20 @@
}
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,
int32_t x,
@@ -198,6 +212,7 @@
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