summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2013-04-13 17:01:56 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2013-04-13 17:01:56 +0900
commit58d7c5c1dcef38ab671b6066aa779e725b693022 (patch)
tree424cc444e34ec806edbc3759143fe3480c2741a5 /src
parent373fb30096d821327326dfa0a1c4fb35c8f6d17a (diff)
downloadefl-58d7c5c1dcef38ab671b6066aa779e725b693022.tar.gz
ecore_imf: Add ecore_imf_input_panel_hide() API
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_imf/Ecore_IMF.h8
-rw-r--r--src/lib/ecore_imf/ecore_imf.c16
-rw-r--r--src/lib/ecore_imf/ecore_imf_context.c8
3 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/ecore_imf/Ecore_IMF.h b/src/lib/ecore_imf/Ecore_IMF.h
index 012c29e0bf..2eb81fdfbd 100644
--- a/src/lib/ecore_imf/Ecore_IMF.h
+++ b/src/lib/ecore_imf/Ecore_IMF.h
@@ -536,6 +536,14 @@ EAPI int ecore_imf_shutdown(void);
EAPI void ecore_imf_module_register(const Ecore_IMF_Context_Info *info, Ecore_IMF_Context *(*imf_module_create)(void), Ecore_IMF_Context *(*imf_module_exit)(void));
/**
+ * Hide the input panel.
+ * @return EINA_TRUE if the input panel will be hidden
+ EINA_FALSE if the input panel is already in hidden state
+ * @ingroup Ecore_IMF_Lib_Group
+ */
+EAPI Eina_Bool ecore_imf_input_panel_hide(void);
+
+/**
* Get the list of the available Input Method Context ids.
*
* Note that the caller is responsible for freeing the Eina_List
diff --git a/src/lib/ecore_imf/ecore_imf.c b/src/lib/ecore_imf/ecore_imf.c
index 143acc4e83..0f5b75fd4b 100644
--- a/src/lib/ecore_imf/ecore_imf.c
+++ b/src/lib/ecore_imf/ecore_imf.c
@@ -16,6 +16,7 @@ EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0;
int _ecore_imf_log_dom = -1;
static int _ecore_imf_init_count = 0;
+extern Ecore_IMF_Context *show_req_ctx;
EAPI int
ecore_imf_init(void)
@@ -52,3 +53,18 @@ ecore_imf_shutdown(void)
ecore_shutdown();
return _ecore_imf_init_count;
}
+
+EAPI Eina_Bool
+ecore_imf_input_panel_hide(void)
+{
+ if (show_req_ctx)
+ {
+ if (ecore_imf_context_input_panel_state_get(show_req_ctx) != ECORE_IMF_INPUT_PANEL_STATE_HIDE)
+ {
+ ecore_imf_context_input_panel_hide(show_req_ctx);
+ return EINA_TRUE;
+ }
+ }
+
+ return EINA_FALSE;
+}
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c
index 41a84b2cee..7c8318e547 100644
--- a/src/lib/ecore_imf/ecore_imf_context.c
+++ b/src/lib/ecore_imf/ecore_imf_context.c
@@ -12,6 +12,8 @@
#include "Ecore_IMF.h"
#include "ecore_imf_private.h"
+Ecore_IMF_Context *show_req_ctx = NULL;
+
EAPI Eina_List *
ecore_imf_context_available_ids_get(void)
{
@@ -251,6 +253,8 @@ ecore_imf_context_show(Ecore_IMF_Context *ctx)
"ecore_imf_context_show");
return;
}
+
+ show_req_ctx = ctx;
if (ctx->klass->show) ctx->klass->show(ctx);
}
@@ -263,6 +267,8 @@ ecore_imf_context_hide(Ecore_IMF_Context *ctx)
"ecore_imf_context_hide");
return;
}
+
+ show_req_ctx = NULL;
if (ctx->klass->hide) ctx->klass->hide(ctx);
}
@@ -772,6 +778,7 @@ ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
return;
}
+ show_req_ctx = ctx;
if (ctx->klass->show) ctx->klass->show(ctx);
}
@@ -785,6 +792,7 @@ ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
return;
}
+ show_req_ctx = NULL;
if (ctx->klass->hide) ctx->klass->hide(ctx);
}