diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index 673b4c4c16..75b388ecca 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -547,3 +547,7 @@ * Refactor Ecore_Evas Wayland code to match changes in Ecore_Wayland +2012-02-29 Jihoon Kim (jihoon) + + * Add ecore_imf_context_input_panel_caps_lock_mode_set/get to set the caps lock mode on the input panel + diff --git a/legacy/ecore/NEWS b/legacy/ecore/NEWS index 923957762d..5dc12a62d2 100644 --- a/legacy/ecore/NEWS +++ b/legacy/ecore/NEWS @@ -24,6 +24,18 @@ Additions: - Add Socket and Plug to draw other process area. * ecore_wayland - Add Ecore_Wayland (backend to support Wayland). + * ecore_imf + - ecore_imf_context_event_callback_add() + - ecore_imf_context_event_callback_del() + - ecore_imf_context_event_callback_call() + - ecore_imf_context_input_panel_imdata_set() + - ecore_imf_context_input_panel_imdata_get() + - ecore_imf_context_input_panel_return_key_type_set() + - ecore_imf_context_input_panel_return_key_type_get() + - ecore_imf_context_input_panel_return_key_disabled_set() + - ecore_imf_context_input_panel_return_key_disabled_get() + - ecore_imf_context_input_panel_caps_lock_mode_set() + - ecore_imf_context_input_panel_caps_lock_mode_get() Improvements: * ecore: diff --git a/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h b/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h index e74403ad64..551a749e05 100644 --- a/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h +++ b/legacy/ecore/src/lib/ecore_imf/Ecore_IMF.h @@ -423,6 +423,7 @@ struct _Ecore_IMF_Context_Class void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len); void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type); void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled); + void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode); }; struct _Ecore_IMF_Context_Info @@ -502,6 +503,8 @@ EAPI void ecore_imf_context_input_panel_return_key_type EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx); EAPI void ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled); EAPI Eina_Bool ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx); +EAPI void ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode); +EAPI Eina_Bool ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx); /* 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 5321f4ec11..7fcc2a4cc1 100644 --- a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c +++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c @@ -1518,3 +1518,49 @@ ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx) return ctx->input_panel_return_key_disabled; } + +/** + * Set the caps lock mode on the input panel. + * + * @param ctx An #Ecore_IMF_Context. + * @param mode Turn on caps lock on the input panel if EINA_TRUE + * @ingroup Ecore_IMF_Context_Group + * @since 1.2.0 + */ +EAPI void +ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode) +{ + if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT)) + { + ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT, + "ecore_imf_context_input_panel_caps_lock_mode_set"); + return; + } + + if (ctx->klass->input_panel_caps_lock_mode_set) + ctx->klass->input_panel_caps_lock_mode_set(ctx, mode); + + ctx->input_panel_caps_lock_mode = mode; +} + +/** + * Get the caps lock mode on the input panel. + * + * @param ctx An #Ecore_IMF_Context. + * @return EINA_TRUE if the caps lock is turned on. + * @ingroup Ecore_IMF_Context_Group + * @since 1.2.0 + */ +EAPI Eina_Bool +ecore_imf_context_input_panel_caps_lock_mode_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_caps_lock_mode_get"); + return EINA_FALSE; + } + + return ctx->input_panel_caps_lock_mode; +} + diff --git a/legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h b/legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h index 85f34a3dce..b4ff0f2ee0 100644 --- a/legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h +++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf_private.h @@ -56,6 +56,7 @@ struct _Ecore_IMF_Context Eina_Bool allow_prediction : 1; Eina_Bool input_panel_enabled : 1; Eina_Bool input_panel_return_key_disabled : 1; + Eina_Bool input_panel_caps_lock_mode : 1; }; struct _Ecore_IMF_Module diff --git a/legacy/ecore/src/modules/immodules/scim/scim_module.cpp b/legacy/ecore/src/modules/immodules/scim/scim_module.cpp index f0db74234f..d17e37a523 100644 --- a/legacy/ecore/src/modules/immodules/scim/scim_module.cpp +++ b/legacy/ecore/src/modules/immodules/scim/scim_module.cpp @@ -42,7 +42,8 @@ extern "C" NULL, /* input_panel_imdata_set */ NULL, /* input_panel_imdata_get */ NULL, /* input_panel_return_key_type_set */ - NULL /* input_panel_return_key_disabled_set */ + NULL, /* input_panel_return_key_disabled_set */ + NULL /* input_panel_caps_lock_mode_set */ }; 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 6fce5669f4..01a3576a44 100644 --- a/legacy/ecore/src/modules/immodules/xim/ecore_imf_xim.c +++ b/legacy/ecore/src/modules/immodules/xim/ecore_imf_xim.c @@ -801,7 +801,8 @@ static Ecore_IMF_Context_Class xim_class = { .input_panel_imdata_set = NULL, .input_panel_imdata_get = NULL, .input_panel_return_key_type_set = NULL, - .input_panel_return_key_disabled_set = NULL + .input_panel_return_key_disabled_set = NULL, + .input_panel_caps_lock_mode_set = NULL }; static Ecore_IMF_Context *