diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2013-04-13 17:01:56 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2013-04-13 17:01:56 +0900 |
commit | 58d7c5c1dcef38ab671b6066aa779e725b693022 (patch) | |
tree | 424cc444e34ec806edbc3759143fe3480c2741a5 /src | |
parent | 373fb30096d821327326dfa0a1c4fb35c8f6d17a (diff) |
ecore_imf: Add ecore_imf_input_panel_hide() API
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ecore_imf/Ecore_IMF.h | 8 | ||||
-rw-r--r-- | src/lib/ecore_imf/ecore_imf.c | 16 | ||||
-rw-r--r-- | src/lib/ecore_imf/ecore_imf_context.c | 8 |
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); | |||
536 | 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)); | 536 | 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)); |
537 | 537 | ||
538 | /** | 538 | /** |
539 | * Hide the input panel. | ||
540 | * @return EINA_TRUE if the input panel will be hidden | ||
541 | EINA_FALSE if the input panel is already in hidden state | ||
542 | * @ingroup Ecore_IMF_Lib_Group | ||
543 | */ | ||
544 | EAPI Eina_Bool ecore_imf_input_panel_hide(void); | ||
545 | |||
546 | /** | ||
539 | * Get the list of the available Input Method Context ids. | 547 | * Get the list of the available Input Method Context ids. |
540 | * | 548 | * |
541 | * Note that the caller is responsible for freeing the Eina_List | 549 | * 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; | |||
16 | 16 | ||
17 | int _ecore_imf_log_dom = -1; | 17 | int _ecore_imf_log_dom = -1; |
18 | static int _ecore_imf_init_count = 0; | 18 | static int _ecore_imf_init_count = 0; |
19 | extern Ecore_IMF_Context *show_req_ctx; | ||
19 | 20 | ||
20 | EAPI int | 21 | EAPI int |
21 | ecore_imf_init(void) | 22 | ecore_imf_init(void) |
@@ -52,3 +53,18 @@ ecore_imf_shutdown(void) | |||
52 | ecore_shutdown(); | 53 | ecore_shutdown(); |
53 | return _ecore_imf_init_count; | 54 | return _ecore_imf_init_count; |
54 | } | 55 | } |
56 | |||
57 | EAPI Eina_Bool | ||
58 | ecore_imf_input_panel_hide(void) | ||
59 | { | ||
60 | if (show_req_ctx) | ||
61 | { | ||
62 | if (ecore_imf_context_input_panel_state_get(show_req_ctx) != ECORE_IMF_INPUT_PANEL_STATE_HIDE) | ||
63 | { | ||
64 | ecore_imf_context_input_panel_hide(show_req_ctx); | ||
65 | return EINA_TRUE; | ||
66 | } | ||
67 | } | ||
68 | |||
69 | return EINA_FALSE; | ||
70 | } | ||
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 @@ | |||
12 | #include "Ecore_IMF.h" | 12 | #include "Ecore_IMF.h" |
13 | #include "ecore_imf_private.h" | 13 | #include "ecore_imf_private.h" |
14 | 14 | ||
15 | Ecore_IMF_Context *show_req_ctx = NULL; | ||
16 | |||
15 | EAPI Eina_List * | 17 | EAPI Eina_List * |
16 | ecore_imf_context_available_ids_get(void) | 18 | ecore_imf_context_available_ids_get(void) |
17 | { | 19 | { |
@@ -251,6 +253,8 @@ ecore_imf_context_show(Ecore_IMF_Context *ctx) | |||
251 | "ecore_imf_context_show"); | 253 | "ecore_imf_context_show"); |
252 | return; | 254 | return; |
253 | } | 255 | } |
256 | |||
257 | show_req_ctx = ctx; | ||
254 | if (ctx->klass->show) ctx->klass->show(ctx); | 258 | if (ctx->klass->show) ctx->klass->show(ctx); |
255 | } | 259 | } |
256 | 260 | ||
@@ -263,6 +267,8 @@ ecore_imf_context_hide(Ecore_IMF_Context *ctx) | |||
263 | "ecore_imf_context_hide"); | 267 | "ecore_imf_context_hide"); |
264 | return; | 268 | return; |
265 | } | 269 | } |
270 | |||
271 | show_req_ctx = NULL; | ||
266 | if (ctx->klass->hide) ctx->klass->hide(ctx); | 272 | if (ctx->klass->hide) ctx->klass->hide(ctx); |
267 | } | 273 | } |
268 | 274 | ||
@@ -772,6 +778,7 @@ ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx) | |||
772 | return; | 778 | return; |
773 | } | 779 | } |
774 | 780 | ||
781 | show_req_ctx = ctx; | ||
775 | if (ctx->klass->show) ctx->klass->show(ctx); | 782 | if (ctx->klass->show) ctx->klass->show(ctx); |
776 | } | 783 | } |
777 | 784 | ||
@@ -785,6 +792,7 @@ ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx) | |||
785 | return; | 792 | return; |
786 | } | 793 | } |
787 | 794 | ||
795 | show_req_ctx = NULL; | ||
788 | if (ctx->klass->hide) ctx->klass->hide(ctx); | 796 | if (ctx->klass->hide) ctx->klass->hide(ctx); |
789 | } | 797 | } |
790 | 798 | ||