forked from enlightenment/efl
eo: let's add a macro to define a callbacks array.
This commit is contained in:
parent
cecd19803e
commit
e939d9a1ce
|
@ -1307,6 +1307,20 @@ struct _Eo_Callback_Array_Item
|
|||
Eo_Event_Cb func; /**< The callback function. */
|
||||
};
|
||||
|
||||
#define EO_CALLBACKS_ARRAY_DEFINE(Name, Count, ...) \
|
||||
static Eo_Callback_Array_Item * \
|
||||
Name(void) \
|
||||
{ \
|
||||
static Eo_Callback_Array_Item internal[Count] = { { 0 } }; \
|
||||
if (internal[0].desc == NULL) \
|
||||
{ \
|
||||
memcpy(internal, \
|
||||
((Eo_Callback_Array_Item[Count]) { __VA_ARGS__ }), \
|
||||
sizeof(Eo_Callback_Array_Item) * Count); \
|
||||
} \
|
||||
return internal; \
|
||||
}
|
||||
|
||||
/**
|
||||
* @def eo_event_callback_forwarder_add
|
||||
* @brief Add an event callback forwarder for an event and an object.
|
||||
|
|
Loading…
Reference in New Issue