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_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...
 
#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 const Efl_Event_Description * efl_object_legacy_only_event_description_get (const char *_event_name)
 Don't use this. 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)
 
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 (Eina_Value *v)
 Get the object contained in an Eina_Value. 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:558
An item in an array of callback desc/func.
Definition: Eo.h:240
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:2655

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.

◆ 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:1991

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_drag_start(), elm_drop_item_container_add(), elm_drop_target_add(), elm_object_item_del(), elm_policy_set(), elm_quicklaunch_fork(), and elm_store_target_genlist_set().

◆ 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:1991

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 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_timer_add(), ecore_timer_loop_add(), and elm_quicklaunch_fork().

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)

Don't use this.

The values of the returned event structure are also internal, don't assume anything about them.

References eina_hash_add(), eina_hash_find(), eina_stringshare_add(), eina_stringshare_del(), and EINA_TRUE.

Referenced by evas_object_smart_callback_call(), evas_object_smart_callback_del(), evas_object_smart_callback_del_full(), and evas_object_smart_callback_priority_add().

◆ efl_callbacks_cmp()

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

Helper for sorting callbacks array.

Automatically used by EFL_CALLBACKS_ARRAY_DEFINE

References _Efl_Callback_Array_Item::desc.

◆ 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().

◆ 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, and eina_value_setup().

◆ eina_value_object_get()

static Eo* eina_value_object_get ( 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_type_get().