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
This commit is contained in:
Jean-Philippe Andre 2017-05-29 15:41:06 +09:00
parent 6fe568d9ac
commit e9c7159210
4 changed files with 68 additions and 4 deletions

View File

@ -378,6 +378,30 @@ EAPI void edje_object_message_handler_set(Edje_Object *obj, Edje_Message_Handler
*/
EAPI void edje_object_message_send(Edje_Object *obj, Edje_Message_Type type, int id, void *msg);
/**
* @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
*/
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 1.20
*/
EAPI void edje_object_message_signal_recursive_process(Edje_Object *obj);
/**
* @}
*/

View File

@ -47,3 +47,16 @@ edje_object_part_state_get(const Edje_Object *obj, const char * part, double *va
efl_canvas_layout_internal_state_get(efl_part(obj, part), &str, val_ret);
return str;
}
EAPI void
edje_object_message_signal_process(Edje_Object *obj)
{
edje_obj_message_signal_process(obj, EINA_FALSE);
}
/* since 1.20 */
EAPI void
edje_object_message_signal_recursive_process(Edje_Object *obj)
{
edje_obj_message_signal_process(obj, EINA_TRUE);
}

View File

@ -141,8 +141,8 @@ bad_type:
return;
}
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;
@ -227,6 +227,25 @@ 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);
}
}
static Eina_Bool
_edje_dummy_timer(void *data EINA_UNUSED)
{

View File

@ -587,8 +587,16 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
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.]]
be processed only at idle time.
If $recurse is $true, this function will be called recursively
on all subobjects.
]]
params {
recurse: bool @optional; [[Whether to process messages on children
objects.]]
}
legacy: null;
}
@property global_color_class @class {
set {