Support prediction_hint_set interface 43/124443/4
authorInHong Han <inhong1.han@samsung.com>
Thu, 30 Mar 2017 04:22:57 +0000 (13:22 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 27 Apr 2017 09:35:33 +0000 (09:35 +0000)
Change-Id: I5a39fe0ed712e13c8ed11e54e2779a1399c79eab

src/e_mod_main.c

index 71ddd9b..4a161e4 100644 (file)
@@ -1826,6 +1826,30 @@ _e_text_input_cb_set_capital_mode(struct wl_client *client EINA_UNUSED, struct w
 }
 
 static void
+_e_text_input_cb_prediction_hint_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *prediction_hint)
+{
+   E_Text_Input *text_input = wl_resource_get_user_data(resource);
+   E_Input_Method *input_method = NULL;
+   Eina_List *l = NULL;
+
+   if (!text_input)
+     {
+        WTI_WARNING(resource,
+                    WL_DISPLAY_ERROR_INVALID_OBJECT,
+                    "No Text Input For Resource");
+        return;
+     }
+
+   EINA_LIST_FOREACH(text_input->input_methods, l, input_method)
+     {
+        if (!input_method || !input_method->context) continue;
+
+        if (input_method->context->resource)
+          wl_input_method_context_send_prediction_hint(input_method->context->resource, prediction_hint);
+     }
+}
+
+static void
 _e_text_input_cb_resource_destroy(struct wl_resource *resource)
 {
    E_Text_Input *text_input = wl_resource_get_user_data(resource);
@@ -1889,7 +1913,8 @@ static const struct wl_text_input_interface _e_text_input_implementation = {
      _e_text_input_cb_process_input_device_event,
      _e_text_input_cb_filter_key_event,
      _e_text_input_cb_get_hide_permission,
-     _e_text_input_cb_set_capital_mode
+     _e_text_input_cb_set_capital_mode,
+     _e_text_input_cb_prediction_hint_set
 };
 
 static void