Macros | Functions | Variables
Eo's Event Handling

Macros

#define EFL_EVENT_DESCRIPTION(name)   { name, EINA_FALSE, EINA_FALSE, EINA_FALSE }
 A helper macro to help populate #Efl_Event_Description. More...
 
#define EFL_EVENT_DESCRIPTION_HOT(name)   { name, EINA_TRUE, EINA_FALSE, EINA_FALSE }
 A helper macro to help populate #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_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...
 
#define efl_event_callback_forwarder_add(obj, desc, new_obj)   efl_event_callback_forwarder_priority_add(obj, desc, EFL_CALLBACK_PRIORITY_DEFAULT, new_obj)
 Add an event callback forwarder for an event and an object. More...
 
#define EFL_EVENT_CALLBACK_ADD   (&(_EFL_EVENT_CALLBACK_ADD))
 Event triggered when a callback was added to the object.
 
#define EFL_EVENT_CALLBACK_DEL   (&(_EFL_EVENT_CALLBACK_DEL))
 Event triggered when a callback was removed from the object.
 

Functions

EAPI int efl_callbacks_cmp (const Efl_Callback_Array_Item *a, const Efl_Callback_Array_Item *b)
 Helper for sorting callbacks array. More...
 
static Eina_Bool efl_replace (Eo **storage, const Eo *new_obj)
 
static Eina_Valueeina_value_object_new (Eo *obj)
 Create a new Eina_Value containing the passed parameter. More...
 
static Eina_Value eina_value_object_init (Eo *obj)
 Create a new Eina_Value initialized with the passed parameter. More...
 
static Eoeina_value_object_get (const Eina_Value *v)
 Get the object contained in an Eina_Value. More...
 
static Eina_Bool efl_alive_get (const Eo *obj)
 Get if the object is in its main lifetime. More...
 

Variables

EOAPI const Eina_Value_TypeEINA_VALUE_TYPE_OBJECT
 
EAPI const Efl_Event_Description _EFL_EVENT_CALLBACK_ADD
 
EAPI const Efl_Event_Description _EFL_EVENT_CALLBACK_DEL
 

Detailed Description

Macro Definition Documentation

◆ EFL_EVENT_DESCRIPTION

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

A helper macro to help populate #Efl_Event_Description.

A 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 }

A helper macro to help populate #Efl_Event_Description and make the event impossible to freeze.

A 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]), \
(int(*)(const void*,const 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:576
An item in an array of callback desc/func.
Definition: Eo.h:269
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:2766

Helper for creating global callback arrays.

Problems occur here in windows where you can't declare a static array with external symbols in them. These addresses are only known at runtime. This also allows for automatic sorting for better performance.

Examples:
emotion_signals_example.c.

Referenced by ecore_event_current_event_get(), ecore_ipc_client_server_get(), ecore_ipc_shutdown(), ecore_timer_precision_set(), edje_file_data_get(), elm_hoversel_add(), elm_quicklaunch_seed(), elm_win_rotation_get(), and evas_free().

◆ efl_event_callback_add

#define efl_event_callback_add (   obj,
  desc,
  cb,
  data 
)
Value:
EFL_CALLBACK_PRIORITY_DEFAULT, cb, data)
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.

Add a callback for an event.

Parameters
[in]descAn #Efl_Event_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 edje_transition_duration_factor_set(), elm_combobox_add(), elm_drag_start(), elm_drop_item_container_add(), elm_drop_target_add(), elm_entry_add(), elm_hoversel_add(), elm_image_add(), elm_object_focus_set(), elm_object_item_del(), elm_policy_set(), elm_quicklaunch_fork(), elm_quicklaunch_init(), elm_scroller_add(), elm_store_target_genlist_set(), elm_win_floating_mode_get(), elm_win_rotation_get(), evas_object_del(), and evas_textblock_text_utf8_to_markup().

◆ efl_event_callback_array_add

#define efl_event_callback_array_add (   obj,
  array,
  data 
)
Value:
EFL_CALLBACK_PRIORITY_DEFAULT, data)
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...

Add an array of callbacks for an event.

Parameters
[in]objThe object.
[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 this isn't the case, be careful of portability issues 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_ipc_client_server_get(), ecore_timer_add(), ecore_timer_loop_add(), ecore_timer_precision_set(), edje_file_data_get(), elm_fileselector_add(), elm_hoversel_add(), elm_object_item_data_get(), and elm_quicklaunch_fork().

◆ efl_event_callback_forwarder_add

#define efl_event_callback_forwarder_add (   obj,
  desc,
  new_obj 
)    efl_event_callback_forwarder_priority_add(obj, desc, EFL_CALLBACK_PRIORITY_DEFAULT, new_obj)

Add an event callback forwarder for an event and an object.

Parameters
[in]objThe object.
[in]descAn #Efl_Event_Description of the event to forward to.
[in]new_objThe object to emit events from

Function Documentation

◆ efl_callbacks_cmp()

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

◆ eina_value_object_new()

static Eina_Value* eina_value_object_new ( Eo obj)
inlinestatic

Create a new Eina_Value containing the passed parameter.

Parameters
objThe object to use
Returns
The Eina_Value
See also
eina_value_object_get(), eina_value_object_init()
Since
1.21

References eina_value_new(), and eina_value_set().

◆ eina_value_object_init()

static Eina_Value eina_value_object_init ( Eo obj)
inlinestatic

Create a new Eina_Value initialized with the passed parameter.

Parameters
objThe object to use
Returns
The Eina_Value
See also
eina_value_object_new(), eina_value_object_get()
Since
1.21

References EINA_VALUE_EMPTY, eina_value_set(), and eina_value_setup().

◆ eina_value_object_get()

static Eo* eina_value_object_get ( const Eina_Value v)
inlinestatic

Get the object contained in an Eina_Value.

Parameters
vThe Eina_Value to extract the object from
Returns
The object.
See also
eina_value_object_new(), eina_value_object_init()
Since
1.21

References eina_value_pget(), and eina_value_type_get().

◆ efl_alive_get()

static Eina_Bool efl_alive_get ( const Eo obj)
inlinestatic

Get if the object is in its main lifetime.

Parameters
objthe object to check
Returns
true if the object is finalized, but not invalidating nor invalidated.
Since
1.22

Referenced by elm_layout_content_set().