ecore_imf: Add ecore_imf_context_input_panel_caps_lock_mode_set/get to set/get the...
authorjihoon <jihoon@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 29 Feb 2012 04:37:33 +0000 (04:37 +0000)
committerjihoon <jihoon@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 29 Feb 2012 04:37:33 +0000 (04:37 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@68529 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
NEWS
src/lib/ecore_imf/Ecore_IMF.h
src/lib/ecore_imf/ecore_imf_context.c
src/lib/ecore_imf/ecore_imf_private.h
src/modules/immodules/scim/scim_module.cpp
src/modules/immodules/xim/ecore_imf_xim.c

index 673b4c4..75b388e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
         * Refactor Ecore_Evas Wayland code to match changes in 
           Ecore_Wayland
 
+2012-02-29  Jihoon Kim (jihoon)
+
+        * Add ecore_imf_context_input_panel_caps_lock_mode_set/get to set the caps lock mode on the input panel
+
diff --git a/NEWS b/NEWS
index 9239577..5dc12a6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,18 @@ Additions:
      - Add Socket and Plug to draw other process area.
     * ecore_wayland
      - Add Ecore_Wayland (backend to support Wayland).
+    * ecore_imf
+     - ecore_imf_context_event_callback_add()
+     - ecore_imf_context_event_callback_del()
+     - ecore_imf_context_event_callback_call()
+     - ecore_imf_context_input_panel_imdata_set()
+     - ecore_imf_context_input_panel_imdata_get()
+     - ecore_imf_context_input_panel_return_key_type_set()
+     - ecore_imf_context_input_panel_return_key_type_get()
+     - ecore_imf_context_input_panel_return_key_disabled_set()
+     - ecore_imf_context_input_panel_return_key_disabled_get()
+     - ecore_imf_context_input_panel_caps_lock_mode_set()
+     - ecore_imf_context_input_panel_caps_lock_mode_get()
 
 Improvements:
     * ecore:
index e74403a..551a749 100644 (file)
@@ -423,6 +423,7 @@ struct _Ecore_IMF_Context_Class
    void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len);
    void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
    void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled);
+   void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode);
 };
 
 struct _Ecore_IMF_Context_Info
@@ -502,6 +503,8 @@ EAPI void                          ecore_imf_context_input_panel_return_key_type
 EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);
 EAPI void                          ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);
 EAPI Eina_Bool                     ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
+EAPI void                          ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);
+EAPI Eina_Bool                     ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);
 
 /* The following entry points must be exported by each input method module
  */
index 5321f4e..7fcc2a4 100644 (file)
@@ -1518,3 +1518,49 @@ ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx)
 
    return ctx->input_panel_return_key_disabled;
 }
+
+/**
+ * Set the caps lock mode on the input panel.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @param mode Turn on caps lock on the input panel if EINA_TRUE
+ * @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
+ */
+EAPI void
+ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode)
+{
+   if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+     {
+        ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+                         "ecore_imf_context_input_panel_caps_lock_mode_set");
+        return;
+     }
+
+   if (ctx->klass->input_panel_caps_lock_mode_set)
+     ctx->klass->input_panel_caps_lock_mode_set(ctx, mode);
+
+   ctx->input_panel_caps_lock_mode = mode;
+}
+
+/**
+ * Get the caps lock mode on the input panel.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @return EINA_TRUE if the caps lock is turned on.
+ * @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
+ */
+EAPI Eina_Bool
+ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx)
+{
+   if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+     {
+        ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+                         "ecore_imf_context_input_panel_caps_lock_mode_get");
+        return EINA_FALSE;
+     }
+
+   return ctx->input_panel_caps_lock_mode;
+}
+
index 85f34a3..b4ff0f2 100644 (file)
@@ -56,6 +56,7 @@ struct _Ecore_IMF_Context
    Eina_Bool                      allow_prediction : 1;
    Eina_Bool                      input_panel_enabled : 1;
    Eina_Bool                      input_panel_return_key_disabled : 1;
+   Eina_Bool                      input_panel_caps_lock_mode : 1;
 };
 
 struct _Ecore_IMF_Module
index f0db742..d17e37a 100644 (file)
@@ -42,7 +42,8 @@ extern "C"
         NULL,                                   /* input_panel_imdata_set */
         NULL,                                   /* input_panel_imdata_get */
         NULL,                                   /* input_panel_return_key_type_set */
-        NULL                                    /* input_panel_return_key_disabled_set */
+        NULL,                                   /* input_panel_return_key_disabled_set */
+        NULL                                    /* input_panel_caps_lock_mode_set */
    };
 
    static Ecore_IMF_Context *imf_module_create (void);
index 6fce566..01a3576 100644 (file)
@@ -801,7 +801,8 @@ static Ecore_IMF_Context_Class xim_class = {
    .input_panel_imdata_set = NULL,
    .input_panel_imdata_get = NULL,
    .input_panel_return_key_type_set = NULL,
-   .input_panel_return_key_disabled_set = NULL
+   .input_panel_return_key_disabled_set = NULL,
+   .input_panel_caps_lock_mode_set = NULL
 };
 
 static Ecore_IMF_Context *