Added mime_type_accept_set interface 99/131499/4
authorInHong Han <inhong1.han@samsung.com>
Tue, 16 May 2017 11:24:07 +0000 (20:24 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 9 Jun 2017 07:40:06 +0000 (07:40 +0000)
Change-Id: I2e4ff6e5c8ede7d7aab9a1c093450001d7ad41ff

src/e_mod_main.c

index d06bb65..20bd471 100644 (file)
@@ -1881,6 +1881,30 @@ _e_text_input_cb_prediction_hint_set(struct wl_client *client EINA_UNUSED, struc
 }
 
 static void
+_e_text_input_cb_mime_type_accept_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *mime_type)
+{
+   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_mime_type(input_method->context->resource, mime_type);
+     }
+}
+
+static void
 _e_text_input_cb_resource_destroy(struct wl_resource *resource)
 {
    E_Text_Input *text_input = wl_resource_get_user_data(resource);
@@ -1946,7 +1970,8 @@ static const struct wl_text_input_interface _e_text_input_implementation = {
      _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_prediction_hint_set
+     _e_text_input_cb_prediction_hint_set,
+     _e_text_input_cb_mime_type_accept_set
 };
 
 static void