ecore_imf_xim: Support ecore_imf_context_input_panel_show/hide in XIM module.
authorjihoon <jihoon@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 7 Feb 2012 10:10:23 +0000 (10:10 +0000)
committerjihoon <jihoon@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 7 Feb 2012 10:10:23 +0000 (10:10 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@67727 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/modules/immodules/xim/ecore_imf_xim.c

index 740012f..44c9e0f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
         * Set ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL as default layout in ecore_imf_context_add.
         * Add Ecore_IMF function to set or get the input panel-specific data.
+
+2012-02-07  Jihoon Kim (jihoon)
+
+        * Support ecore_imf_context_input_panel_show/hide in XIM module.
index 29a8cd0..183f346 100644 (file)
@@ -294,6 +294,10 @@ _ecore_imf_context_xim_focus_in(Ecore_IMF_Context *ctx)
    imf_context_data = ecore_imf_context_data_get(ctx);
    ic = imf_context_data->ic;
    imf_context_data->has_focus = EINA_TRUE;
+
+   if (ecore_imf_context_input_panel_enabled_get(ctx))
+     ecore_imf_context_input_panel_show(ctx);
+
    if (ic)
      {
         char *str;
@@ -326,6 +330,9 @@ _ecore_imf_context_xim_focus_out(Ecore_IMF_Context *ctx)
         ic = imf_context_data->ic;
         if (ic)
           XUnsetICFocus(ic);
+
+        if (ecore_imf_context_input_panel_enabled_get(ctx))
+          ecore_imf_context_input_panel_hide(ctx);
      }
 #else
    (void)ctx;
@@ -501,6 +508,38 @@ _ecore_imf_context_xim_cursor_location_set(Ecore_IMF_Context *ctx,
    (void)(w); // yes w is unused, but only a bi-product of the algorithm
 }
 
+static void
+_ecore_imf_context_xim_input_panel_show(Ecore_IMF_Context *ctx)
+{
+   EINA_LOG_DBG("%s in", __FUNCTION__);
+
+#ifdef ENABLE_XIM
+   Ecore_IMF_Context_Data *imf_context_data;
+   imf_context_data = ecore_imf_context_data_get(ctx);
+
+   ecore_x_e_virtual_keyboard_state_set
+        (imf_context_data->win, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
+#else
+   (void)ctx;
+#endif
+}
+
+static void
+_ecore_imf_context_xim_input_panel_hide(Ecore_IMF_Context *ctx)
+{
+   EINA_LOG_DBG("%s in", __FUNCTION__);
+
+#ifdef ENABLE_XIM
+   Ecore_IMF_Context_Data *imf_context_data;
+   imf_context_data = ecore_imf_context_data_get(ctx);
+
+   ecore_x_e_virtual_keyboard_state_set
+        (imf_context_data->win, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
+#else
+   (void)ctx;
+#endif
+}
+
 #ifdef ENABLE_XIM
 static unsigned int
 _ecore_x_event_reverse_modifiers(unsigned int state)
@@ -739,8 +778,8 @@ static Ecore_IMF_Context_Class xim_class = {
    .del = _ecore_imf_context_xim_del,
    .client_window_set = _ecore_imf_context_xim_client_window_set,
    .client_canvas_set = NULL,
-   .show = NULL,
-   .hide = NULL,
+   .show = _ecore_imf_context_xim_input_panel_show,
+   .hide = _ecore_imf_context_xim_input_panel_hide,
    .preedit_string_get = _ecore_imf_context_xim_preedit_string_get,
    .focus_in = _ecore_imf_context_xim_focus_in,
    .focus_out = _ecore_imf_context_xim_focus_out,