summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2013-08-14 18:17:06 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2013-08-14 18:17:06 +0900
commit4b5ed04559aa1a782a96f945b725b452c05e4d60 (patch)
tree14d3c1c14a319f49e199b56841c22f2d0ace15f3
parent56ca91dec05216f082867efa533b15b18773f822 (diff)
Edje: add edje_object_part_text_input_panel_show_on_demand_set/get()
-rw-r--r--ChangeLog6
-rw-r--r--NEWS1
-rw-r--r--src/lib/edje/Edje_Eo.h28
-rw-r--r--src/lib/edje/Edje_Legacy.h21
-rw-r--r--src/lib/edje/edje_entry.c38
-rw-r--r--src/lib/edje/edje_private.h4
-rw-r--r--src/lib/edje/edje_smart.c4
-rw-r--r--src/lib/edje/edje_util.c49
8 files changed, 150 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d50d5192c..803be7ce74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
12013-08-14 Jihoon Kim
2
3 * Edje: add edje_object_part_text_input_panel_show_on_demand_set/get().
4
12013-08-13 Jihoon Kim 52013-08-13 Jihoon Kim
2 6
3 * Ecore_IMF: add ecore_imf_context_input_panel_on_demand_set/get() 7 * Ecore_IMF: add ecore_imf_context_input_panel_on_demand_set/get().
4 8
52013-08-09 Cedric Bail 92013-08-09 Cedric Bail
6 10
diff --git a/NEWS b/NEWS
index 6da6d0ee2c..afbf9662b5 100644
--- a/NEWS
+++ b/NEWS
@@ -129,6 +129,7 @@ Additions:
129 - Add threshold support to Edje draggable part. 129 - Add threshold support to Edje draggable part.
130 - Reduce load time of Edje_Object using Evas_Object_Textblock and many styles. 130 - Reduce load time of Edje_Object using Evas_Object_Textblock and many styles.
131 - Add edje_object_mmap_set. 131 - Add edje_object_mmap_set.
132 - Add edje_object_part_text_input_panel_show_on_demand_set/get().
132 * Eeze: 133 * Eeze:
133 - Add a dummy libmount replacement for when libmount is not there. 134 - Add a dummy libmount replacement for when libmount is not there.
134 * Ecore_Con: 135 * Ecore_Con:
diff --git a/src/lib/edje/Edje_Eo.h b/src/lib/edje/Edje_Eo.h
index 6678a96d02..410709a41b 100644
--- a/src/lib/edje/Edje_Eo.h
+++ b/src/lib/edje/Edje_Eo.h
@@ -79,6 +79,8 @@ enum
79 EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET, 79 EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET,
80 EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET, 80 EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET,
81 EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET, 81 EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET,
82 EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_SET,
83 EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_GET,
82 EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD, 84 EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD,
83 EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL, 85 EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL,
84 EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL, 86 EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL,
@@ -491,6 +493,32 @@ enum
491#define edje_obj_part_text_input_panel_return_key_disabled_get(part, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool *, ret) 493#define edje_obj_part_text_input_panel_return_key_disabled_get(part, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool *, ret)
492 494
493/** 495/**
496 * @def edje_obj_part_text_input_panel_show_on_demand_set
497 * @since 1.8
498 *
499 * @brief Set the attribute to show the input panel in case of only an user's explicit Mouse Up event.
500 *
501 * @param[in] part
502 * @param[in] ondemand
503 *
504 * @see edje_object_part_text_input_panel_show_on_demand_set
505 */
506#define edje_obj_part_text_input_panel_show_on_demand_set(part, ondemand) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_SET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool, ondemand)
507
508/**
509 * @def edje_obj_part_text_input_panel_show_on_demand_get
510 * @since 1.8
511 *
512 * @brief Get the attribute to show the input panel in case of only an user's explicit Mouse Up event.
513 *
514 * @param[in] part
515 * @param[out] ret
516 *
517 * @see edje_object_part_text_input_panel_show_on_demand_get
518 */
519#define edje_obj_part_text_input_panel_show_on_demand_get(part, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool *, ret)
520
521/**
494 * @def edje_obj_text_insert_filter_callback_add 522 * @def edje_obj_text_insert_filter_callback_add
495 * @since 1.8 523 * @since 1.8
496 * 524 *
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 196e498a39..64e4f88280 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -1241,6 +1241,27 @@ EAPI void edje_object_part_text_input_panel_return_key_disabled_set(
1241EAPI Eina_Bool edje_object_part_text_input_panel_return_key_disabled_get(const Evas_Object *obj, const char *part); 1241EAPI Eina_Bool edje_object_part_text_input_panel_return_key_disabled_get(const Evas_Object *obj, const char *part);
1242 1242
1243/** 1243/**
1244 * Set the attribute to show the input panel in case of only an user's explicit Mouse Up event.
1245 * It doesn't request to show the input panel even though it has focus.
1246 *
1247 * @param obj A valid Evas_Object handle
1248 * @param part The part name
1249 * @param ondemand If true, the input panel will be shown in case of only Mouse up event. (Focus event will be ignored.)
1250 * @since 1.8.0
1251 */
1252EAPI void edje_object_part_text_input_panel_show_on_demand_set(Evas_Object *obj, const char *part, Eina_Bool ondemand);
1253
1254/**
1255 * Get the attribute to show the input panel in case of only an user's explicit Mouse Up event.
1256 *
1257 * @param obj A valid Evas_Object handle
1258 * @param part The part name
1259 * @return @c EINA_TRUE if the input panel will be shown in case of only Mouse up event.
1260 * @since 1.8.0
1261 */
1262EAPI Eina_Bool edje_object_part_text_input_panel_show_on_demand_get(const Evas_Object *obj, const char *part);
1263
1264/**
1244 * Add a filter function for newly inserted text. 1265 * Add a filter function for newly inserted text.
1245 * 1266 *
1246 * Whenever text is inserted (not the same as set) into the given @p part, 1267 * Whenever text is inserted (not the same as set) into the given @p part,
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 159a2b471a..d7490f9ff5 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -3541,6 +3541,44 @@ _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp)
3541#endif 3541#endif
3542} 3542}
3543 3543
3544#ifdef HAVE_ECORE_IMF
3545void
3546_edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand)
3547#else
3548void
3549_edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand __UNUSED__)
3550#endif
3551{
3552 Entry *en;
3553
3554 if ((rp->type != EDJE_RP_TYPE_TEXT) ||
3555 (!rp->typedata.text)) return;
3556 en = rp->typedata.text->entry_data;
3557 if (!en) return;
3558#ifdef HAVE_ECORE_IMF
3559 if (en->imf_context)
3560 ecore_imf_context_input_panel_show_on_demand_set(en->imf_context, ondemand);
3561#endif
3562}
3563
3564Eina_Bool
3565_edje_entry_input_panel_show_on_demand_get(Edje_Real_Part *rp)
3566{
3567 Entry *en;
3568
3569 if ((rp->type != EDJE_RP_TYPE_TEXT) ||
3570 (!rp->typedata.text)) return EINA_FALSE;
3571 en = rp->typedata.text->entry_data;
3572 if (!en) return EINA_FALSE;
3573#ifdef HAVE_ECORE_IMF
3574 if (en->imf_context) {
3575 Eina_Bool ret = ecore_imf_context_input_panel_show_on_demand_get(en->imf_context);
3576 return ret;
3577 }
3578#endif
3579 return EINA_FALSE;
3580}
3581
3544static Evas_Textblock_Cursor * 3582static Evas_Textblock_Cursor *
3545_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur) 3583_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
3546{ 3584{
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 608aa01ccf..456a690541 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -2326,6 +2326,8 @@ void _edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_
2326Edje_Input_Panel_Return_Key_Type _edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp); 2326Edje_Input_Panel_Return_Key_Type _edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp);
2327void _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled); 2327void _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled);
2328Eina_Bool _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp); 2328Eina_Bool _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp);
2329void _edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand);
2330Eina_Bool _edje_entry_input_panel_show_on_demand_get(Edje_Real_Part *rp);
2329 2331
2330void _edje_external_init(void); 2332void _edje_external_init(void);
2331void _edje_external_shutdown(void); 2333void _edje_external_shutdown(void);
@@ -2487,6 +2489,8 @@ void _part_text_input_panel_return_key_type_set(Eo *obj, void *_pd, va_list *lis
2487void _part_text_input_panel_return_key_type_get(Eo *obj, void *_pd, va_list *list); 2489void _part_text_input_panel_return_key_type_get(Eo *obj, void *_pd, va_list *list);
2488void _part_text_input_panel_return_key_disabled_set(Eo *obj, void *_pd, va_list *list); 2490void _part_text_input_panel_return_key_disabled_set(Eo *obj, void *_pd, va_list *list);
2489void _part_text_input_panel_return_key_disabled_get(Eo *obj, void *_pd, va_list *list); 2491void _part_text_input_panel_return_key_disabled_get(Eo *obj, void *_pd, va_list *list);
2492void _part_text_input_panel_show_on_demand_set(Eo *obj, void *_pd, va_list *list);
2493void _part_text_input_panel_show_on_demand_get(Eo *obj, void *_pd, va_list *list);
2490void _text_insert_filter_callback_add(Eo *obj, void *_pd, va_list *list); 2494void _text_insert_filter_callback_add(Eo *obj, void *_pd, va_list *list);
2491void _text_insert_filter_callback_del(Eo *obj, void *_pd, va_list *list); 2495void _text_insert_filter_callback_del(Eo *obj, void *_pd, va_list *list);
2492void _text_insert_filter_callback_del_full(Eo *obj, void *_pd, va_list *list); 2496void _text_insert_filter_callback_del_full(Eo *obj, void *_pd, va_list *list);
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index de3ee807c1..2a75e4363d 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -466,6 +466,8 @@ _edje_smart_class_constructor(Eo_Class *klass)
466 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET), _part_text_input_panel_return_key_type_get), 466 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET), _part_text_input_panel_return_key_type_get),
467 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET), _part_text_input_panel_return_key_disabled_set), 467 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET), _part_text_input_panel_return_key_disabled_set),
468 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET), _part_text_input_panel_return_key_disabled_get), 468 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET), _part_text_input_panel_return_key_disabled_get),
469 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_SET), _part_text_input_panel_show_on_demand_set),
470 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_GET), _part_text_input_panel_show_on_demand_get),
469 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD), _text_insert_filter_callback_add), 471 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD), _text_insert_filter_callback_add),
470 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL), _text_insert_filter_callback_del), 472 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL), _text_insert_filter_callback_del),
471 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL), _text_insert_filter_callback_del_full), 473 EO_OP_FUNC(EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL), _text_insert_filter_callback_del_full),
@@ -612,6 +614,8 @@ static const Eo_Op_Description op_desc[] = {
612 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET, "Get the return key type."), 614 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_TYPE_GET, "Get the return key type."),
613 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET, "Set the return key on the input panel to be disabled."), 615 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_SET, "Set the return key on the input panel to be disabled."),
614 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET, "Get whether the return key on the input panel should be disabled or not."), 616 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_RETURN_KEY_DISABLED_GET, "Get whether the return key on the input panel should be disabled or not."),
617 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_SET, "Set the attribute to show the input panel in case of only an user's explicit Mouse Up event."),
618 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_PART_TEXT_INPUT_PANEL_SHOW_ON_DEMAND_GET, "Get the attribute to show the input panel in case of only an user's explicit Mouse Up event."),
615 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD, "Add a filter function for newly inserted text."), 619 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_ADD, "Add a filter function for newly inserted text."),
616 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL, "Delete a function from the filter list."), 620 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL, "Delete a function from the filter list."),
617 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL, "Delete a function and matching user data from the filter list."), 621 EO_OP_DESCRIPTION(EDJE_OBJ_SUB_ID_TEXT_INSERT_FILTER_CALLBACK_DEL_FULL, "Delete a function and matching user data from the filter list."),
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 41550d0810..2bfbf9d7fa 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -3135,6 +3135,55 @@ _part_text_input_panel_return_key_disabled_get(Eo *obj EINA_UNUSED, void *_pd, v
3135} 3135}
3136 3136
3137EAPI void 3137EAPI void
3138edje_object_part_text_input_panel_show_on_demand_set(Evas_Object *obj, const char *part, Eina_Bool ondemand)
3139{
3140 if (!obj) return;
3141 eo_do(obj, edje_obj_part_text_input_panel_show_on_demand_set(part, ondemand));
3142}
3143
3144void _part_text_input_panel_show_on_demand_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3145{
3146 const char *part = va_arg(*list, const char *);
3147 Eina_Bool ondemand = va_arg(*list, int);
3148 Edje *ed = _pd;
3149 Edje_Real_Part *rp;
3150
3151 if ((!ed) || (!part)) return;
3152 rp = _edje_real_part_recursive_get(&ed, part);
3153 if (!rp) return;
3154 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
3155 {
3156 _edje_entry_input_panel_show_on_demand_set(rp, ondemand);
3157 }
3158}
3159
3160EAPI Eina_Bool
3161edje_object_part_text_input_panel_show_on_demand_get(const Evas_Object *obj, const char *part)
3162{
3163 if (!obj) return EINA_FALSE;
3164 Eina_Bool ret = EINA_FALSE;
3165 eo_do((Eo *)obj, edje_obj_part_text_input_panel_show_on_demand_get(part, &ret));
3166 return ret;
3167}
3168
3169void _part_text_input_panel_show_on_demand_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
3170{
3171 const char *part = va_arg(*list, const char *);
3172 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
3173 Edje *ed = _pd;
3174 Edje_Real_Part *rp;
3175 *ret = EINA_FALSE;
3176
3177 if ((!ed) || (!part)) return;
3178 rp = _edje_real_part_recursive_get(&ed, part);
3179 if (!rp) return;
3180 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
3181 {
3182 *ret = _edje_entry_input_panel_show_on_demand_get(rp);
3183 }
3184}
3185
3186EAPI void
3138edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data) 3187edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data)
3139{ 3188{
3140 if (!obj) return; 3189 if (!obj) return;