forked from enlightenment/efl
eo: enable priority with event forwarder.
Note: Their isn't any ability to do something like a static array of events at the moment. It might lead to large memory being used when it wouldn't be necessary. If that was the case, we could fix it, but it would require a lot of dynamic hash operation I think. Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de> Differential Revision: https://phab.enlightenment.org/D7482
This commit is contained in:
parent
e9a434df9b
commit
dfd09ec7e4
|
@ -2063,6 +2063,19 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const Efl_Callback_
|
||||||
efl_event_callback_array_priority_add(obj, array, \
|
efl_event_callback_array_priority_add(obj, array, \
|
||||||
EFL_CALLBACK_PRIORITY_DEFAULT, data)
|
EFL_CALLBACK_PRIORITY_DEFAULT, data)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def efl_event_callback_forwarder_add(obj, desc, new_obj)
|
||||||
|
* @brief Add an event callback forwarder for an event and an object.
|
||||||
|
*
|
||||||
|
* @param[in] obj The object.
|
||||||
|
* @param[in] desc The description of the event to listen to
|
||||||
|
* @param[in] new_obj The object to emit events from
|
||||||
|
*
|
||||||
|
* @ingroup Efl_Object
|
||||||
|
*/
|
||||||
|
#define efl_event_callback_forwarder_add(obj, desc, new_obj) efl_event_callback_forwarder_priority_add(obj, desc, EFL_CALLBACK_PRIORITY_DEFAULT, new_obj)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def Replace the previous Eo pointer with new content.
|
* @def Replace the previous Eo pointer with new content.
|
||||||
*
|
*
|
||||||
|
|
|
@ -229,18 +229,19 @@ abstract Efl.Object
|
||||||
under certain conditions to block a certain event.
|
under certain conditions to block a certain event.
|
||||||
]]
|
]]
|
||||||
}
|
}
|
||||||
event_callback_forwarder_add {
|
event_callback_forwarder_priority_add {
|
||||||
[[Add an event callback forwarder for an event and an object.]]
|
[[Add an event callback forwarder for an event and an object.]]
|
||||||
params {
|
params {
|
||||||
@cref desc: Efl.Event_Description; [[The description of the event to listen to]]
|
@cref desc: Efl.Event_Description; [[The description of the event to listen to]]
|
||||||
@in new_obj: Efl.Object; [[The object to emit events from]]
|
@in priority: short; [[The priority at which to insert the callback handler.]]
|
||||||
|
@in new_obj: Efl.Object @nonull; [[The object to emit events from]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event_callback_forwarder_del {
|
event_callback_forwarder_del {
|
||||||
[[Remove an event callback forwarder for an event and an object.]]
|
[[Remove an event callback forwarder for an event and an object.]]
|
||||||
params {
|
params {
|
||||||
@cref desc: Efl.Event_Description; [[The description of the event to listen to]]
|
@cref desc: Efl.Event_Description; [[The description of the event to listen to]]
|
||||||
@in new_obj: Efl.Object; [[The object to emit events from]]
|
@in new_obj: Efl.Object @nonull; [[The object to emit events from]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
children_iterator_new {
|
children_iterator_new {
|
||||||
|
|
|
@ -1806,16 +1806,16 @@ _efl_event_forwarder_callback(void *data, const Efl_Event *event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Change default priority? Maybe call later? */
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_object_event_callback_forwarder_add(Eo *obj, Efl_Object_Data *pd EINA_UNUSED,
|
_efl_object_event_callback_forwarder_priority_add(Eo *obj, Efl_Object_Data *pd EINA_UNUSED,
|
||||||
const Efl_Event_Description *desc,
|
const Efl_Event_Description *desc,
|
||||||
|
short priority,
|
||||||
Eo *new_obj)
|
Eo *new_obj)
|
||||||
{
|
{
|
||||||
|
EO_OBJ_POINTER_RETURN(new_obj, new_data);
|
||||||
|
EO_OBJ_DONE(new_obj);
|
||||||
|
|
||||||
/* FIXME: Add it EO_MAGIC_RETURN(new_obj, EO_EINA_MAGIC); */
|
efl_event_callback_priority_add(obj, desc, priority, _efl_event_forwarder_callback, new_obj);
|
||||||
|
|
||||||
efl_event_callback_add(obj, desc, _efl_event_forwarder_callback, new_obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
|
@ -1823,8 +1823,8 @@ _efl_object_event_callback_forwarder_del(Eo *obj, Efl_Object_Data *pd EINA_UNUSE
|
||||||
const Efl_Event_Description *desc,
|
const Efl_Event_Description *desc,
|
||||||
Eo *new_obj)
|
Eo *new_obj)
|
||||||
{
|
{
|
||||||
|
EO_OBJ_POINTER_RETURN(new_obj, new_data);
|
||||||
/* FIXME: Add it EO_MAGIC_RETURN(new_obj, EO_EINA_MAGIC); */
|
EO_OBJ_DONE(new_obj);
|
||||||
|
|
||||||
efl_event_callback_del(obj, desc, _efl_event_forwarder_callback, new_obj);
|
efl_event_callback_del(obj, desc, _efl_event_forwarder_callback, new_obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue