From: Jihoon Kim <jihoon48.kim@samsung.com>
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 20 Jun 2011 07:17:24 +0000 (07:17 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Mon, 20 Jun 2011 07:17:24 +0000 (07:17 +0000)
Subject: [E-devel] [PATCH] Add Ecore_IMF API to set the attirbute of
input panel

For supporting virtual keyboard, I'd like to add
ecore_imf_context_input_panel_enabled_set/get APIs. The detail description of
each API is included in the patch file as doxygen format.

If input panel is in 'enabled' status, the immodule will request to
show the input panel automatically When the input widget such as entry is
clicked or has focus. In some case, application programmers want to control
the input panel manually (not automatically), so I implement this API.

SVN revision: 60504

legacy/ecore/ChangeLog
legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h
legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h

index 082443d..5c1293f 100644 (file)
         * Removed support for evas xrender engine from ecore-evas as
         it is not a deprecated engine in evas and no longer needs support.
 
+2011-06-20  Jihoon Kim
+
+        * Ecore_IMF: Added ecore_imf_context_input_panel_enabled_set/get API
index 4266d53..7afee2c 100644 (file)
@@ -397,6 +397,8 @@ EAPI void                          ecore_imf_context_input_panel_layout_set(Ecor
 EAPI Ecore_IMF_Input_Panel_Layout  ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
 EAPI void                          ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
 EAPI Ecore_IMF_Input_Panel_Lang    ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
+EAPI void                          ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable);
+EAPI Eina_Bool                     ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
 
 /* The following entry points must be exported by each input method module
  */
index 0fe7f3d..382bf6a 100644 (file)
@@ -184,6 +184,10 @@ ecore_imf_context_add(const char *id)
     * set on the immodule */
    ecore_imf_context_autocapital_type_set(ctx, ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE);
 
+   /* default input panel enabled status is EINA_TRUE, so let's make sure it's
+    * set on the immodule */
+   ecore_imf_context_input_panel_enabled_set(ctx, EINA_TRUE);
+
    /* default input_mode is ECORE_IMF_INPUT_MODE_FULL, so let's make sure it's
     * set on the immodule */
    ecore_imf_context_input_mode_set(ctx, ECORE_IMF_INPUT_MODE_FULL);
@@ -1073,3 +1077,47 @@ ecore_imf_context_input_panel_language_get (Ecore_IMF_Context *ctx)
    return ctx->input_panel_lang;
 }
 
+/**
+ * Set whether the Input Method Context should request to show the input panel automatically
+ * when the widget has focus.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @param enabled If true, the input panel will be shown when the widget is clicked or has focus.
+ * @ingroup Ecore_IMF_Context_Group
+ * @since 1.1.0
+ */
+EAPI void
+ecore_imf_context_input_panel_enabled_set (Ecore_IMF_Context *ctx,
+                                           Eina_Bool enabled)
+{
+   if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+     {
+        ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+                         "ecore_imf_context_input_panel_enabled_set");
+        return;
+     }
+
+   ctx->input_panel_enabled = enabled;
+}
+
+/**
+ * Get whether the Input Method Context requests to show the input panel automatically.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @return Return the attribute to show the input panel automatically
+ * @ingroup Ecore_IMF_Context_Group
+ * @since 1.1.0
+ */
+EAPI Eina_Bool
+ecore_imf_context_input_panel_enabled_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_enabled_get");
+        return EINA_FALSE;
+     }
+
+   return ctx->input_panel_enabled;
+}
+
index 4255ec6..07a5b09 100644 (file)
@@ -51,6 +51,7 @@ struct _Ecore_IMF_Context
    Ecore_IMF_Input_Panel_Layout   input_panel_layout;
    Ecore_IMF_Input_Panel_Lang     input_panel_lang;
    Eina_Bool                      allow_prediction : 1;
+   Eina_Bool                      input_panel_enabled : 1;
 };
 
 struct _Ecore_IMF_Module