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

ChangeLog
src/modules/immodules/scim/scim_imcontext.cpp
src/modules/immodules/scim/scim_imcontext.h
src/modules/immodules/scim/scim_module.cpp

index 44c9e0f..7e54b3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2012-02-07  Jihoon Kim (jihoon)
 
-        * Support ecore_imf_context_input_panel_show/hide in XIM module.
+        * Support ecore_imf_context_input_panel_show/hide in XIM and SCIM module.
index e7c00d0..ee230f8 100644 (file)
@@ -926,6 +926,9 @@ isf_imf_context_focus_in(Ecore_IMF_Context *ctx)
 
         _panel_client.send();
      }
+
+   if (ecore_imf_context_input_panel_enabled_get(ctx))
+     ecore_imf_context_input_panel_show(ctx);
 }
 
 /**
@@ -968,6 +971,9 @@ isf_imf_context_focus_out(Ecore_IMF_Context *ctx)
         _panel_client.send();
         _focused_ic = 0;
      }
+
+   if (ecore_imf_context_input_panel_enabled_get(ctx))
+     ecore_imf_context_input_panel_hide(ctx);
 }
 
 /**
@@ -1391,6 +1397,32 @@ isf_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type,
    return ret;
 }
 
+EAPI void
+isf_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
+{
+   SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
+
+   EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
+   if (ic == NULL || ic->impl == NULL)
+     return;
+
+   ecore_x_e_virtual_keyboard_state_set
+        (ic->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
+}
+
+EAPI void
+isf_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
+{
+   SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
+
+   EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
+   if (ic == NULL || ic->impl == NULL)
+     return;
+
+   ecore_x_e_virtual_keyboard_state_set
+        (ic->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
+}
+
 /* Panel Slot functions */
 static void
 panel_slot_reload_config(int context __UNUSED__)
index 84f1a2f..72533e2 100644 (file)
@@ -32,6 +32,8 @@ Eina_Bool  isf_imf_context_filter_event (Ecore_IMF_Context *ctx, Ecore_IMF_Event
 void isf_imf_context_prediction_allow_set (Ecore_IMF_Context* ctx, Eina_Bool prediction);
 void isf_imf_context_autocapital_type_set (Ecore_IMF_Context* ctx, Ecore_IMF_Autocapital_Type autocapital_type);
 void isf_imf_context_input_panel_layout_set (Ecore_IMF_Context* ctx, Ecore_IMF_Input_Panel_Layout layout);
+void isf_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
+void isf_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
 
 EcoreIMFContextISF* isf_imf_context_new      (void);
 void                isf_imf_context_shutdown (void);
index 06330f4..1838002 100644 (file)
@@ -19,8 +19,8 @@ extern "C"
         isf_imf_context_del,                    /* del */
         isf_imf_context_client_window_set,      /* client_window_set */
         isf_imf_context_client_canvas_set,      /* client_canvas_set */
-        NULL,                                   /* isf_imf_context_input_panel_show, - show */
-        NULL,                                   /* isf_imf_context_input_panel_hide, - hide */
+        isf_imf_context_input_panel_show,       /* input_panel_show, - show */
+        isf_imf_context_input_panel_hide,       /* input_panel_hide, - hide */
         isf_imf_context_preedit_string_get,     /* get_preedit_string */
         isf_imf_context_focus_in,               /* focus_in */
         isf_imf_context_focus_out,              /* focus_out */