summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-01-02 15:26:53 -0800
committerCedric BAIL <cedric.bail@free.fr>2019-01-10 11:13:49 -0800
commitb8e352cde7af5bfe4d4bc3ef7aa47370b3e41159 (patch)
treefd61ceebe536128547489cd2af72e83693dc4a7e
parentf78ef852daf80944b4e399be60e8bec3910b8046 (diff)
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.h5
-rw-r--r--src/lib/eo/efl_object.eo28
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_
2017/** 2017/**
2018 * @def efl_event_callback_add(obj, desc, cb, data) 2018 * @def efl_event_callback_add(obj, desc, cb, data)
2019 * Add a callback for an event. 2019 * Add a callback for an event.
2020 * @param[in] desc The description of the event to listen to. 2020 * @param[in] desc An #Efl_Event_Description of the event to listen to.
2021 * @param[in] cb the callback to call. 2021 * @param[in] cb the callback to call.
2022 * @param[in] data additional data to pass to the callback. 2022 * @param[in] data additional data to pass to the callback.
2023 * 2023 *
@@ -2033,6 +2033,7 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const Efl_Callback_
2033 * @def efl_event_callback_array_add(obj, desc, cb, data) 2033 * @def efl_event_callback_array_add(obj, desc, cb, data)
2034 * Add an array of callbacks for an event. 2034 * Add an array of callbacks for an event.
2035 * 2035 *
2036 * @param[in] obj The object.
2036 * @param[in] array an #Efl_Callback_Array_Item of events to listen to. 2037 * @param[in] array an #Efl_Callback_Array_Item of events to listen to.
2037 * @param[in] data additional data to pass to the callback. 2038 * @param[in] data additional data to pass to the callback.
2038 * 2039 *
@@ -2053,7 +2054,7 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const Efl_Callback_
2053 * @brief Add an event callback forwarder for an event and an object. 2054 * @brief Add an event callback forwarder for an event and an object.
2054 * 2055 *
2055 * @param[in] obj The object. 2056 * @param[in] obj The object.
2056 * @param[in] desc The description of the event to listen to 2057 * @param[in] desc An #Efl_Event_Description of the event to forward to.
2057 * @param[in] new_obj The object to emit events from 2058 * @param[in] new_obj The object to emit events from
2058 * 2059 *
2059 * @ingroup Efl_Object 2060 * @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;
13[[ 13[[
14 Callback priority. Range is -32k - 32k. The lower the number, the higher the priority. 14 Callback priority. Range is -32k - 32k. The lower the number, the higher the priority.
15 15
16 This is used to insert an event handler relative to the existing stack of sorted event
17 handlers according to that priority. All event handlers always have a priority. If not
18 specified @Efl.Callback_Priority_Default is to be assumed.
19
16 See @Efl.Callback_Priority_Before @Efl.Callback_Priority_Default @Efl.Callback_Priority_After 20 See @Efl.Callback_Priority_Before @Efl.Callback_Priority_Default @Efl.Callback_Priority_After
17 ]] 21 ]]
18 22
@@ -245,15 +249,31 @@ abstract Efl.Object
245 ]] 249 ]]
246 } 250 }
247 event_callback_forwarder_priority_add { 251 event_callback_forwarder_priority_add {
248 [[Add an event callback forwarder for an event and an object.]] 252 [[Add an event callback forwarder that will make this object emit an event whenever another
253 object ($source) emits it. The event is said to be forwarded from $source to this object.
254
255 The event is unaffected on $source and behave like any other event being propagated on
256 any object and will trigger all the handler registered on $source like nothing special
257 happened.
258
259 This allow object that hide internally another object to easily be able to propagate an event
260 without the need to add custom handler.
261
262 Note: The priority is used to make sure that you are intercepting the event when you expect
263 by inserting a handler at the right position in the stack of event handler on the object that
264 emit the event.]]
249 params { 265 params {
250 @cref desc: Efl.Event_Description; [[The description of the event to listen to]] 266 @cref desc: Efl.Event_Description; [[The description of the event to listen to]]
251 @in priority: short; [[The priority at which to insert the callback handler.]] 267 @in priority: Efl.Callback_Priority; [[The priority at which to insert the event forwarder handler
252 @in new_obj: Efl.Object @nonull; [[The object to emit events from]] 268 in the existing list of handler on the source of event object. The lower the number, the higher
269 the priority. As a shortcut @Efl.Callback_Priority_Before,
270 @Efl.Callback_Priority_Default and @Efl.Callback_Priority_After can be used. See
271 @Efl.Callback_Priority for more details.]]
272 @in source: Efl.Object @nonull; [[The object which emits the initial event]]
253 } 273 }
254 } 274 }
255 event_callback_forwarder_del { 275 event_callback_forwarder_del {
256 [[Remove an event callback forwarder for an event and an object.]] 276 [[Remove an event callback forwarder for a specified event and object.]]
257 params { 277 params {
258 @cref desc: Efl.Event_Description; [[The description of the event to listen to]] 278 @cref desc: Efl.Event_Description; [[The description of the event to listen to]]
259 @in new_obj: Efl.Object @nonull; [[The object to emit events from]] 279 @in new_obj: Efl.Object @nonull; [[The object to emit events from]]