Support to set the input panel data 25/48525/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 22 Sep 2015 11:13:17 +0000 (20:13 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 22 Sep 2015 11:13:17 +0000 (20:13 +0900)
Change-Id: I723fced53721310c0c0d58f728fd9e44d466d85d

src/e_mod_main.c

index 6a45953..eace3fd 100644 (file)
@@ -749,6 +749,31 @@ _e_text_input_cb_return_key_disabled_set(struct wl_client *client EINA_UNUSED, s
      }
 }
 
+static void
+_e_text_input_cb_input_panel_data_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *data, uint32_t length)
+{
+   E_Text_Input *text_input = wl_resource_get_user_data(resource);
+   E_Input_Method *input_method = NULL;
+   Eina_List *l = NULL;
+
+   if (!text_input)
+     {
+        wl_resource_post_error(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_input_panel_data(input_method->context->resource,
+                                                        data, length);
+     }
+}
+
 static const struct wl_text_input_interface _e_text_input_implementation = {
      _e_text_input_cb_activate,
      _e_text_input_cb_deactivate,
@@ -762,7 +787,8 @@ static const struct wl_text_input_interface _e_text_input_implementation = {
      _e_text_input_cb_state_commit,
      _e_text_input_cb_action_invoke,
      _e_text_input_cb_return_key_type_set,
-     _e_text_input_cb_return_key_disabled_set
+     _e_text_input_cb_return_key_disabled_set,
+     _e_text_input_cb_input_panel_data_set
 };
 
 static void