From d615a8961e07e0a9b361aa01aae5526f6a064ce1 Mon Sep 17 00:00:00 2001 From: jihoon Date: Fri, 24 Feb 2012 06:51:04 +0000 Subject: [PATCH] Add edje_object_part_text_imf_context_get API. This API can be used to get the input method context in entry. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@68385 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 4 ++++ src/lib/Edje.h | 14 ++++++++++++++ src/lib/edje_entry.c | 13 +++++++++++++ src/lib/edje_private.h | 2 +- src/lib/edje_util.c | 18 ++++++++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6d998ed..25e9e80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -360,3 +360,7 @@ * Change API names from edje_object_markup_filter_callback_{add,del,del_full}. to edje_object_text_markup_filter_callback_{add,del,del_full}. + +2012-02-24 Jihoon Kim + + * add edje_object_part_text_imf_context_get for getting Ecore_IMF_Context handle in edje text object diff --git a/src/lib/Edje.h b/src/lib/Edje.h index e411295..03e439f 100644 --- a/src/lib/Edje.h +++ b/src/lib/Edje.h @@ -2874,6 +2874,20 @@ EAPI int edje_object_part_text_cursor_pos_get (const E EAPI void edje_object_part_text_imf_context_reset (const Evas_Object *obj, const char *part); /** + * @brief Get the input method context in entry. + * + * If ecore_imf was not available when edje was compiled, this function returns NULL + * otherwise, the returned pointer is an Ecore_IMF * + * + * @param obj A valid Evas_Object handle + * @param part The part name + * + * @return The input method context (Ecore_IMF_Context *) in entry + * @since 1.2.0 + */ +EAPI void *edje_object_part_text_imf_context_get (const Evas_Object *obj, const char *part); + +/** * @brief Set the layout of the input panel. * * The layout of the input panel or virtual keyboard can make it easier or diff --git a/src/lib/edje_entry.c b/src/lib/edje_entry.c index 84b6909..a39d8e1 100644 --- a/src/lib/edje_entry.c +++ b/src/lib/edje_entry.c @@ -2553,6 +2553,19 @@ _edje_entry_select_abort(Edje_Real_Part *rp) } } +void * +_edje_entry_imf_context_get(Edje_Real_Part *rp) +{ + Entry *en = rp->entry_data; + if (!en) return NULL; + +#ifdef HAVE_ECORE_IMF + return en->imf_context; +#else + return NULL; +#endif +} + void _edje_entry_autocapital_type_set(Edje_Real_Part *rp, Edje_Text_Autocapital_Type autocapital_type) { diff --git a/src/lib/edje_private.h b/src/lib/edje_private.h index d9d578c..30bb242 100644 --- a/src/lib/edje_private.h +++ b/src/lib/edje_private.h @@ -1940,7 +1940,7 @@ void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Co void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow); Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp); void _edje_entry_select_abort(Edje_Real_Part *rp); - +void *_edje_entry_imf_context_get(Edje_Real_Part *rp); Eina_Bool _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur); Eina_Bool _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur); Eina_Bool _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur); diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c index 6750b5b..8c72fd8 100644 --- a/src/lib/edje_util.c +++ b/src/lib/edje_util.c @@ -1527,6 +1527,24 @@ edje_object_part_text_select_extend(const Evas_Object *obj, const char *part) _edje_entry_select_extend(rp); } +EAPI void * +edje_object_part_text_imf_context_get(const Evas_Object *obj, const char *part) +{ + Edje *ed; + Edje_Real_Part *rp; + + ed = _edje_fetch(obj); + if ((!ed) || (!part)) return NULL; + + rp = _edje_real_part_recursive_get(ed, (char *)part); + if (!rp) return NULL; + + if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) + return _edje_entry_imf_context_get(rp); + else + return NULL; +} + EAPI Eina_Bool edje_object_part_text_cursor_next(Evas_Object *obj, const char *part, Edje_Cursor cur) { -- 2.7.4