diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index 84f0e9333f..740012fe9a 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -472,3 +472,4 @@ 2012-02-06 Jihoon Kim (jihoon) * Set ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL as default layout in ecore_imf_context_add. + * Add Ecore_IMF function to set or get the input panel-specific data. diff --git a/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h b/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h index 866c6d235b..2c589edeea 100644 --- a/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h +++ b/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h @@ -345,6 +345,8 @@ struct _Ecore_IMF_Context_Class void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx); void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h); + void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len); + void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len); }; struct _Ecore_IMF_Context_Info @@ -418,6 +420,8 @@ EAPI void ecore_imf_context_input_panel_language_set(Ec 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); +EAPI void ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len); +EAPI void ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len); /* The following entry points must be exported by each input method module */ diff --git a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c index 49d6ea3354..2dddc421c7 100644 --- a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c +++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c @@ -1378,3 +1378,55 @@ ecore_imf_context_input_panel_enabled_get (Ecore_IMF_Context *ctx) return ctx->input_panel_enabled; } +/** + * Set the input panel-specific data to deliver to the input panel. + * this API is used by applications to deliver specific data to the input panel. + * the data format MUST be negotiated by both application and the input panel. + * The size and format of data are defined by the input panel. + * + * @param ctx An #Ecore_IMF_Context. + * @param data The specific data to be set to the input panel. + * @param len the length of data, in bytes, to send to the input panel + * @ingroup Ecore_IMF_Context_Group + * @since 1.2.0 + */ +EAPI void +ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_input_panel_imdata_set"); + return; + } + + if (!data) return; + + if (ctx->klass->input_panel_imdata_set) + ctx->klass->input_panel_imdata_set(ctx, data, len); +} + +/** + * Get the specific data of the current active input panel. + * + * @param ctx An #Ecore_IMF_Context. + * @param data The specific data to be got from the input panel + * @param len The length of data + * @ingroup Ecore_IMF_Context_Group + * @since 1.2.0 + */ +EAPI void +ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_input_panel_imdata_get"); + return; + } + + if (!data) return; + + if (ctx->klass->input_panel_imdata_get) + ctx->klass->input_panel_imdata_get(ctx, data, len); +} diff --git a/legacy/ecore/src/modules/immodules/scim/scim_module.cpp b/legacy/ecore/src/modules/immodules/scim/scim_module.cpp index eff638112e..06330f4561 100644 --- a/legacy/ecore/src/modules/immodules/scim/scim_module.cpp +++ b/legacy/ecore/src/modules/immodules/scim/scim_module.cpp @@ -38,7 +38,9 @@ extern "C" NULL, /* isf_imf_context_input_panel_layout_get, */ NULL, /* isf_imf_context_input_panel_language_set, */ NULL, /* isf_imf_context_input_panel_language_get, */ - isf_imf_context_cursor_location_set /* cursor_location_set */ + isf_imf_context_cursor_location_set, /* cursor_location_set */ + NULL, /* input_panel_imdata_set */ + NULL, /* input_panel_imdata_get */ }; static Ecore_IMF_Context *imf_module_create (void); diff --git a/legacy/ecore/src/modules/immodules/xim/ecore_imf_xim.c b/legacy/ecore/src/modules/immodules/xim/ecore_imf_xim.c index ea7ee7f47d..29a8cd0a79 100644 --- a/legacy/ecore/src/modules/immodules/xim/ecore_imf_xim.c +++ b/legacy/ecore/src/modules/immodules/xim/ecore_imf_xim.c @@ -759,6 +759,8 @@ static Ecore_IMF_Context_Class xim_class = { .input_panel_language_set = NULL, .input_panel_language_get = NULL, .cursor_location_set = _ecore_imf_context_xim_cursor_location_set, + .input_panel_imdata_set = NULL, + .input_panel_imdata_get = NULL, }; static Ecore_IMF_Context *