summaryrefslogtreecommitdiff
path: root/src/lib/ecore_imf/ecore_imf_context.c
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2014-01-23 10:44:00 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2014-01-23 10:44:00 +0900
commitfa165f09022d2d002ed0ccdf05cc7ee00735c4a3 (patch)
treef32e88fb5879b4a765e0c56ca99b278c977e2f32 /src/lib/ecore_imf/ecore_imf_context.c
parent1c2da046dccd68f606504bc2029e3e6425293390 (diff)
Add ecore_imf_context_selection_get API to allow Input Method to get the selected text.
Diffstat (limited to 'src/lib/ecore_imf/ecore_imf_context.c')
-rw-r--r--src/lib/ecore_imf/ecore_imf_context.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c
index 63c41c8d02..7b554e6b53 100644
--- a/src/lib/ecore_imf/ecore_imf_context.c
+++ b/src/lib/ecore_imf/ecore_imf_context.c
@@ -462,6 +462,20 @@ ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina
462} 462}
463 463
464EAPI void 464EAPI void
465ecore_imf_context_retrieve_selection_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text), const void *data)
466{
467 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
468 {
469 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
470 "ecore_imf_context_retrieve_selection_callback_set");
471 return;
472 }
473
474 ctx->retrieve_selection_func = func;
475 ctx->retrieve_selection_data = (void *) data;
476}
477
478EAPI void
465ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode) 479ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode)
466{ 480{
467 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) 481 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
@@ -563,6 +577,29 @@ ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *curs
563 return result; 577 return result;
564} 578}
565 579
580EAPI Eina_Bool
581ecore_imf_context_selection_get(Ecore_IMF_Context *ctx, char **text)
582{
583 Eina_Bool result = EINA_FALSE;
584
585 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
586 {
587 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
588 "ecore_imf_context_selection_get");
589 return EINA_FALSE;
590 }
591
592 if (ctx->retrieve_selection_func)
593 {
594 result = ctx->retrieve_selection_func(ctx->retrieve_selection_data, ctx, text);
595 if (!result)
596 {
597 if (text) *text = NULL;
598 }
599 }
600 return result;
601}
602
566static void 603static void
567_ecore_imf_event_free_preedit(void *data EINA_UNUSED, void *event) 604_ecore_imf_event_free_preedit(void *data EINA_UNUSED, void *event)
568{ 605{