Macros | Functions
Eo's Event Handling

Macros

#define EFL_EVENT_DESCRIPTION(name)   { name, EINA_FALSE, EINA_FALSE, EINA_FALSE }
 An helper macro to help populating #Efl_Event_Description. More...
 
#define EFL_EVENT_DESCRIPTION_HOT(name)   { name, EINA_TRUE, EINA_FALSE, EINA_FALSE }
 An helper macro to help populating #Efl_Event_Description and make the event impossible to freeze. More...
 
#define EFL_EVENT_DESCRIPTION_RESTART(name)   { name, EINA_FALSE, EINA_FALSE, EINA_TRUE }
 
#define EFL_EVENT_DESCRIPTION_HOT_RESTART(name)   { name, EINA_TRUE, EINA_FALSE, EINA_TRUE }
 
#define EFL_CALLBACK_PRIORITY_BEFORE   -100
 Slightly more prioritized than default.
 
#define EFL_CALLBACK_PRIORITY_DEFAULT   0
 Default callback priority level.
 
#define EFL_CALLBACK_PRIORITY_AFTER   100
 Slightly less prioritized than default.
 
#define EFL_CALLBACKS_ARRAY_DEFINE(Name, ...)
 Helper for creating global callback arrays. More...
 
#define efl_event_callback_add(obj, desc, cb, data)
 Add a callback for an event. More...
 
#define efl_event_callback_array_add(obj, array, data)
 Add an array of callbacks for an event. More...
 

Functions

EAPI const Efl_Event_Descriptionefl_object_legacy_only_event_description_get (const char *_event_name)
 Don't use. More...
 
EAPI int efl_callbacks_cmp (const Efl_Callback_Array_Item *a, const Efl_Callback_Array_Item *b)
 Helper for sorting callbacks array. More...
 
static void efl_replace (Eo **storage, Eo *new_obj)
 

Detailed Description

Macro Definition Documentation

◆ EFL_EVENT_DESCRIPTION

#define EFL_EVENT_DESCRIPTION (   name)    { name, EINA_FALSE, EINA_FALSE, EINA_FALSE }

An helper macro to help populating #Efl_Event_Description.

Parameters
nameThe name of the event.
See also
Efl_Event_Description

◆ EFL_EVENT_DESCRIPTION_HOT

#define EFL_EVENT_DESCRIPTION_HOT (   name)    { name, EINA_TRUE, EINA_FALSE, EINA_FALSE }

An helper macro to help populating #Efl_Event_Description and make the event impossible to freeze.

Parameters
nameThe name of the event.
See also
Efl_Event_Description
EFL_EVENT_DESCRIPTION

◆ EFL_CALLBACKS_ARRAY_DEFINE

#define EFL_CALLBACKS_ARRAY_DEFINE (   Name,
  ... 
)
Value:
Name(void) \
{ \
Efl_Callback_Array_Item tmp[] = { __VA_ARGS__ }; \
static Efl_Callback_Array_Item internal[EINA_C_ARRAY_LENGTH(tmp) + 1] = \
{ { 0, 0 } }; \
if (internal[0].desc == NULL) \
{ \
memcpy(internal, tmp, sizeof(tmp)); \
qsort(internal, EINA_C_ARRAY_LENGTH(internal) - 1, sizeof (internal[0]), \
(void*) efl_callbacks_cmp); \
} \
return internal; \
}
#define EINA_C_ARRAY_LENGTH(arr)
Macro to return the array length of a standard c array.
Definition: eina_types.h:522
An item in an array of callback desc/func.
Definition: Eo.h:252
EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const Efl_Callback_Array_Item *b)
Helper for sorting callbacks array.
Definition: eo.c:2449

Helper for creating global callback arrays.

The problem is on windows where you can't declare a static array with external symbols in it, because the addresses are only known at runtime. This also open up the possibility to automatically sort them for better performance.

Examples:
emotion_signals_example.c.

Referenced by ecore_ipc_client_server_get(), ecore_ipc_shutdown(), and ecore_timer_precision_set().

◆ efl_event_callback_add

#define efl_event_callback_add (   obj,
  desc,
  cb,
  data 
)
Value:
EOAPI Eina_Bool efl_event_callback_priority_add(Eo *obj, const Efl_Event_Description *desc, Efl_Callback_Priority priority, Efl_Event_Cb cb, const void *data)
Add a callback for an event with a specific priority.
#define EFL_CALLBACK_PRIORITY_DEFAULT
Default callback priority level.
Definition: Eo.h:1709

Add a callback for an event.

Parameters
[in]descThe description of the event to listen to.
[in]cbthe callback to call.
[in]dataadditional data to pass to the callback.

callbacks of the same priority are called in reverse order of creation.

See also
efl_event_callback_priority_add()
Examples:
emotion_basic_example.c.

Referenced by elm_fileselector_folder_only_get(), elm_quicklaunch_fork(), elm_store_target_genlist_set(), elm_win_floating_mode_get(), and evas_textblock_text_utf8_to_markup().

◆ efl_event_callback_array_add

#define efl_event_callback_array_add (   obj,
  array,
  data 
)
Value:
EOAPI Eina_Bool efl_event_callback_array_priority_add(Eo *obj, const Efl_Callback_Array_Item *array, Efl_Callback_Priority priority, const void *data)
Add an array of callbacks created by EFL_CALLBACKS_ARRAY_DEFINE for an event with a specific priority...
#define EFL_CALLBACK_PRIORITY_DEFAULT
Default callback priority level.
Definition: Eo.h:1709

Add an array of callbacks for an event.

Parameters
[in]arrayan #Efl_Callback_Array_Item of events to listen to.
[in]dataadditional data to pass to the callback.

Callbacks of the same priority are called in reverse order of creation. The array should have been created by EFL_CALLBACKS_ARRAY_DEFINE. If that wasn't the case, be careful of portability issue and make sure that it is properly sorted with efl_callbacks_cmp.

See also
efl_event_callback_array_priority_add()
Examples:
emotion_signals_example.c.

Referenced by ecore_timer_add(), ecore_timer_loop_add(), and ecore_timer_precision_set().

Function Documentation

◆ efl_object_legacy_only_event_description_get()

EAPI const Efl_Event_Description* efl_object_legacy_only_event_description_get ( const char *  _event_name)

◆ efl_callbacks_cmp()

EAPI int efl_callbacks_cmp ( const Efl_Callback_Array_Item a,
const Efl_Callback_Array_Item b 
)