summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-05-29 15:41:06 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-05-29 15:45:31 +0900
commite9c715921025a3e51ad4868cc9a2b46417451995 (patch)
tree7d22092b4630f3a2c015b1e0ed751b40c9daf14c
parent6fe568d9acabb25161e6ebadddc2ec646c012812 (diff)
edje: Add recursive flag for message_signal_process
Original patch by Jinwoo Shin: If edje has multiple levels of child group, edje_object_message_signal_process cannot process message on child group. To cover that, it needs to add new API which traverses its hierarchy and process messages. @feature Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com> Differential Revision: https://phab.enlightenment.org/D4914
-rw-r--r--src/lib/edje/Edje_Legacy.h24
-rw-r--r--src/lib/edje/edje_legacy.c13
-rw-r--r--src/lib/edje/edje_message_queue.c23
-rw-r--r--src/lib/edje/edje_object.eo12
4 files changed, 68 insertions, 4 deletions
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 2b0ba0afa9..eba6d13013 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -379,6 +379,30 @@ EAPI void edje_object_message_handler_set(Edje_Object *obj, Edje_Message_Handler
379EAPI void edje_object_message_send(Edje_Object *obj, Edje_Message_Type type, int id, void *msg); 379EAPI void edje_object_message_send(Edje_Object *obj, Edje_Message_Type type, int id, void *msg);
380 380
381/** 381/**
382 * @brief Processes an object's message queue.
383 *
384 * This function goes through the object message queue processing the pending
385 * messages for this specific Edje object. Normally they'd be processed only
386 * at idle time. Child objects will not be affected.
387 *
388 * @see edje_object_message_signal_recursive_process
389 */
390EAPI void edje_object_message_signal_process(Edje_Object *obj);
391
392/**
393 * @brief Processes an object's message queue recursively.
394 *
395 * This function goes through the object message queue processing the pending
396 * messages for this specific Edje object. Normally they'd be processed only
397 * at idle time. This will also propagate the processing to all child objects.
398 *
399 * @see edje_object_message_signal_process
400 *
401 * @since 1.20
402 */
403EAPI void edje_object_message_signal_recursive_process(Edje_Object *obj);
404
405/**
382 * @} 406 * @}
383 */ 407 */
384 408
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index c349adbefe..3c9e6d2992 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -47,3 +47,16 @@ edje_object_part_state_get(const Edje_Object *obj, const char * part, double *va
47 efl_canvas_layout_internal_state_get(efl_part(obj, part), &str, val_ret); 47 efl_canvas_layout_internal_state_get(efl_part(obj, part), &str, val_ret);
48 return str; 48 return str;
49} 49}
50
51EAPI void
52edje_object_message_signal_process(Edje_Object *obj)
53{
54 edje_obj_message_signal_process(obj, EINA_FALSE);
55}
56
57/* since 1.20 */
58EAPI void
59edje_object_message_signal_recursive_process(Edje_Object *obj)
60{
61 edje_obj_message_signal_process(obj, EINA_TRUE);
62}
diff --git a/src/lib/edje/edje_message_queue.c b/src/lib/edje/edje_message_queue.c
index 31fed480dc..37e937d194 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -141,8 +141,8 @@ bad_type:
141 return; 141 return;
142} 142}
143 143
144EOLIAN void 144static void
145_edje_object_message_signal_process(Eo *obj EINA_UNUSED, Edje *ed) 145_edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed)
146{ 146{
147 Eina_List *l, *ln, *tmpq = NULL; 147 Eina_List *l, *ln, *tmpq = NULL;
148 Edje *lookup_ed; 148 Edje *lookup_ed;
@@ -227,6 +227,25 @@ end:
227 tmp_msgq_restart = 1; 227 tmp_msgq_restart = 1;
228} 228}
229 229
230EOLIAN void
231_edje_object_message_signal_process(Eo *obj, Edje *ed, Eina_Bool recurse)
232{
233 Edje *sub_ed;
234 Eina_List *l;
235 Evas_Object *o;
236
237 _edje_object_message_signal_process_do(obj, ed);
238 if (!recurse) return;
239
240 EINA_LIST_FOREACH(ed->subobjs, l, o)
241 {
242 sub_ed = _edje_fetch(o);
243 if (!sub_ed) continue;
244
245 _edje_object_message_signal_process(o, sub_ed, EINA_TRUE);
246 }
247}
248
230static Eina_Bool 249static Eina_Bool
231_edje_dummy_timer(void *data EINA_UNUSED) 250_edje_dummy_timer(void *data EINA_UNUSED)
232{ 251{
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 9318103880..1c561f9c5d 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -586,9 +586,17 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
586 [[Processes an object's message queue. 586 [[Processes an object's message queue.
587 587
588 This function goes through the object message queue processing the 588 This function goes through the object message queue processing the
589 pending messages for this specific Edje object. Normally they'd 589 pending messages for this specific Edje object. Normally they'd
590 be processed only at idle time.]] 590 be processed only at idle time.
591 591
592 If $recurse is $true, this function will be called recursively
593 on all subobjects.
594 ]]
595 params {
596 recurse: bool @optional; [[Whether to process messages on children
597 objects.]]
598 }
599 legacy: null;
592 } 600 }
593 @property global_color_class @class { 601 @property global_color_class @class {
594 set { 602 set {