diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2019-01-02 15:26:53 -0800 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2019-01-10 11:13:49 -0800 |
commit | b8e352cde7af5bfe4d4bc3ef7aa47370b3e41159 (patch) | |
tree | fd61ceebe536128547489cd2af72e83693dc4a7e | |
parent | f78ef852daf80944b4e399be60e8bec3910b8046 (diff) | |
download | efl-b8e352cde7af5bfe4d4bc3ef7aa47370b3e41159.tar.gz |
eo: improve documentation for event forwarder.
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7532
-rw-r--r-- | src/lib/eo/Eo.h | 5 | ||||
-rw-r--r-- | src/lib/eo/efl_object.eo | 28 |
2 files changed, 27 insertions, 6 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index a6aa5b97d5..21a4bf25d2 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -2017,7 +2017,7 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const Efl_Callback_ /** * @def efl_event_callback_add(obj, desc, cb, data) * Add a callback for an event. - * @param[in] desc The description of the event to listen to. + * @param[in] desc An #Efl_Event_Description of the event to listen to. * @param[in] cb the callback to call. * @param[in] data additional data to pass to the callback. * @@ -2033,6 +2033,7 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const Efl_Callback_ * @def efl_event_callback_array_add(obj, desc, cb, data) * Add an array of callbacks for an event. * + * @param[in] obj The object. * @param[in] array an #Efl_Callback_Array_Item of events to listen to. * @param[in] data additional data to pass to the callback. * @@ -2053,7 +2054,7 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const Efl_Callback_ * @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] desc An #Efl_Event_Description of the event to forward to. * @param[in] new_obj The object to emit events from * * @ingroup Efl_Object diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index 31ff5304e8..6049ceb29a 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -13,6 +13,10 @@ type Efl.Callback_Priority : short; [[ Callback priority. Range is -32k - 32k. The lower the number, the higher the priority. + This is used to insert an event handler relative to the existing stack of sorted event + handlers according to that priority. All event handlers always have a priority. If not + specified @Efl.Callback_Priority_Default is to be assumed. + See @Efl.Callback_Priority_Before @Efl.Callback_Priority_Default @Efl.Callback_Priority_After ]] @@ -245,15 +249,31 @@ abstract Efl.Object ]] } event_callback_forwarder_priority_add { - [[Add an event callback forwarder for an event and an object.]] + [[Add an event callback forwarder that will make this object emit an event whenever another + object ($source) emits it. The event is said to be forwarded from $source to this object. + + The event is unaffected on $source and behave like any other event being propagated on + any object and will trigger all the handler registered on $source like nothing special + happened. + + This allow object that hide internally another object to easily be able to propagate an event + without the need to add custom handler. + + Note: The priority is used to make sure that you are intercepting the event when you expect + by inserting a handler at the right position in the stack of event handler on the object that + emit the event.]] params { @cref desc: Efl.Event_Description; [[The description of the event to listen to]] - @in priority: short; [[The priority at which to insert the callback handler.]] - @in new_obj: Efl.Object @nonull; [[The object to emit events from]] + @in priority: Efl.Callback_Priority; [[The priority at which to insert the event forwarder handler + in the existing list of handler on the source of event object. The lower the number, the higher + the priority. As a shortcut @Efl.Callback_Priority_Before, + @Efl.Callback_Priority_Default and @Efl.Callback_Priority_After can be used. See + @Efl.Callback_Priority for more details.]] + @in source: Efl.Object @nonull; [[The object which emits the initial event]] } } event_callback_forwarder_del { - [[Remove an event callback forwarder for an event and an object.]] + [[Remove an event callback forwarder for a specified event and object.]] params { @cref desc: Efl.Event_Description; [[The description of the event to listen to]] @in new_obj: Efl.Object @nonull; [[The object to emit events from]] |