edje: Add recursive flag for message_signal_process 80/134480/7
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 29 May 2017 06:41:06 +0000 (15:41 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 3 Jul 2017 04:29:30 +0000 (04:29 +0000)
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

Change-Id: I8d34087d7171cbda2378c1914d4db2e7670d53d8

src/lib/edje/Edje_Legacy.h
src/lib/edje/edje_message_queue.c
src/lib/edje/edje_object.eo

index 88ccb08..8000663 100644 (file)
@@ -286,6 +286,33 @@ Edje object
  */
 EAPI Eina_Bool edje_object_mmap_set(Edje_Object *obj, const Eina_File *file, const char *group);
 
+/**
+ * @brief Processes an object's message queue.
+ *
+ * This function goes through the object message queue processing the pending
+ * messages for this specific Edje object. Normally they'd be processed only
+ * at idle time. Child objects will not be affected.
+ *
+ * @see edje_object_message_signal_recursive_process
+ *
+ * @if MOBILE @since_tizen 2.3
+ * @elseif WEARABLE @since_tizen 2.3.1
+ * @endif
+ */
+EAPI void edje_object_message_signal_process(Edje_Object *obj);
+
+/**
+ * @brief Processes an object's message queue recursively.
+ *
+ * This function goes through the object message queue processing the pending
+ * messages for this specific Edje object. Normally they'd be processed only
+ * at idle time. This will also propagate the processing to all child objects.
+ *
+ * @see edje_object_message_signal_process
+ *
+ * @since_tizen 4.0
+ */
+EAPI void edje_object_message_signal_recursive_process(Edje_Object *obj);
 
 #include "edje_object.eo.legacy.h"
 #include "edje_edit.eo.legacy.h"
index 0ebbcb7..938fb59 100644 (file)
@@ -43,8 +43,8 @@ _edje_object_message_handler_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Message_Han
    _edje_message_cb_set(ed, func, data);
 }
 
-EOLIAN void
-_edje_object_message_signal_process(Eo *obj EINA_UNUSED, Edje *ed)
+static void
+_edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed)
 {
    Eina_List *l, *ln, *tmpq = NULL;
    Edje *lookup_ed;
@@ -129,12 +129,44 @@ end:
      tmp_msgq_restart = 1;
 }
 
+EOLIAN void
+_edje_object_message_signal_process(Eo *obj, Edje *ed, Eina_Bool recurse)
+{
+   Edje *sub_ed;
+   Eina_List *l;
+   Evas_Object *o;
+
+   _edje_object_message_signal_process_do(obj, ed);
+   if (!recurse) return;
+
+   EINA_LIST_FOREACH(ed->subobjs, l, o)
+     {
+        sub_ed = _edje_fetch(o);
+        if (!sub_ed) continue;
+
+        _edje_object_message_signal_process(o, sub_ed, EINA_TRUE);
+     }
+}
+
 EAPI void
 edje_message_signal_process(void)
 {
    _edje_message_queue_process();
 }
 
+EAPI void
+edje_object_message_signal_process(Edje_Object *obj)
+{
+   eo_do(obj, edje_obj_message_signal_process(EINA_FALSE));
+}
+
+EAPI void
+edje_object_message_signal_recursive_process(Edje_Object *obj)
+{
+   eo_do(obj, edje_obj_message_signal_process(EINA_TRUE));
+}
+
+
 static Eina_Bool
 _edje_dummy_timer(void *data EINA_UNUSED)
 {
index 6ddc590..e475d88 100644 (file)
@@ -2032,14 +2032,21 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
          [[Processes an object's message queue.
 
            This function goes through the object message queue processing the
-           pending messages for  this specific Edje object. Normally they'd
+           pending messages for this specific Edje object. Normally they'd
            be processed only at idle time.
 
+           If $recurse is $true, this function will be called recursively
+           on all subobjects.
+
            \@if MOBILE \@since_tizen 2.3
            \@elseif WEARABLE \@since_tizen 2.3.1
            \@endif
          ]]
-
+         params {
+            recurse: bool @optional; [[Whether to process messages on children
+                                       objects.]]
+         }
+         legacy: null;
       }
       part_box_remove {
          [[Removes an object from the box.