diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h index 4580722d7d..cfabd74c9a 100644 --- a/src/lib/eo/Eo.h +++ b/src/lib/eo/Eo.h @@ -153,7 +153,7 @@ enum _Eo_Op_Type typedef enum _Eo_Op_Type Eo_Op_Type; /** XXX: Hack until fixed in Eolian */ -typedef struct _Eo_Event_Description Eo_Event_Description2; +typedef struct _Eo_Event Eo_Event2; /** * @typedef Eo_Event_Cb * @@ -165,7 +165,7 @@ typedef struct _Eo_Event_Description Eo_Event_Description2; * @param event_info additional data passed with the event. * @return #EO_CALLBACK_STOP to stop calling additional callbacks for the event, #EO_CALLBACK_CONTINUE to continue. */ -typedef Eina_Bool (*Eo_Event_Cb)(void *data, Eo *obj, const Eo_Event_Description2 *desc, void *event_info); +typedef Eina_Bool (*Eo_Event_Cb)(void *data, const Eo_Event2 *event); #include "eo_base.eo.h" #define EO_CLASS EO_BASE_CLASS diff --git a/src/lib/eo/eo_base.eo b/src/lib/eo/eo_base.eo index 7695208174..29a1531bc9 100644 --- a/src/lib/eo/eo_base.eo +++ b/src/lib/eo/eo_base.eo @@ -34,6 +34,13 @@ type Eo.Callback_Priority: short; [[Callback priority value. Range is -32k - 32k \@ref EO_CALLBACK_PRIORITY_DEFAULT ]] +struct Eo.Event { + [[Parameter passed in event callbacks holding extra event parameters]] + obj: Eo.Base *; [[The object the event was called on.]] + desc: const(Eo.Event_Description) *; [[The event description.]] + event_info: void *; [[Extra event information passed by the event caller.]] +} + abstract Eo.Base () { eo_prefix: eo; diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index 64c6df343f..948a0b0d41 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -676,6 +676,10 @@ _eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd, { Eina_Bool ret = EINA_TRUE; Eo_Callback_Description *cb; + Eo_Event ev; + ev.obj = obj_id; + ev.desc = desc; + ev.event_info = event_info; pd->walking_list++; @@ -696,8 +700,7 @@ _eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd, continue; /* Abort callback calling if the func says so. */ - if (!it->func((void *) cb->func_data, obj_id, desc, - (void *) event_info)) + if (!it->func((void *) cb->func_data, &ev)) { ret = EINA_FALSE; goto end; @@ -713,8 +716,7 @@ _eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd, continue; /* Abort callback calling if the func says so. */ - if (!cb->items.item.func((void *) cb->func_data, obj_id, desc, - (void *) event_info)) + if (!cb->items.item.func((void *) cb->func_data, &ev)) { ret = EINA_FALSE; goto end; @@ -731,9 +733,8 @@ end: } static Eina_Bool -_eo_event_forwarder_callback(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info) +_eo_event_forwarder_callback(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description *desc, void *event_info) { - (void) obj; Eo *new_obj = (Eo *) data; Eina_Bool ret = EINA_FALSE;