Macros | Functions | Variables
Eo's Event Handling

Macros

#define EFL_EVENT_DESCRIPTION(name)   { name, EINA_FALSE, EINA_FALSE, EINA_FALSE }
 
#define EFL_EVENT_DESCRIPTION_HOT(name)   { name, EINA_TRUE, EINA_FALSE, EINA_FALSE }
 
#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)
 
#define efl_event_callback_array_add(obj, array, data)
 
#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

const EOAPI Eina_Value_TypeEINA_VALUE_TYPE_OBJECT
 
const EAPI Efl_Event_Description _EFL_EVENT_CALLBACK_ADD
 
const EAPI 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

Parameters
nameThe name of the event.
See also
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.

Parameters
nameThe name of the event.
See also
Efl_Event_Description
EFL_EVENT_DESCRIPTION

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; \
}

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:
EFL_CALLBACK_PRIORITY_DEFAULT, cb, data)

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.

◆ efl_event_callback_array_add

#define efl_event_callback_array_add (   obj,
  array,
  data 
)
Value:
EFL_CALLBACK_PRIORITY_DEFAULT, data)

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.

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

Helper for sorting callbacks array.

Automatically used by EFL_CALLBACKS_ARRAY_DEFINE

◆ 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 ( 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_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
EINA_C_ARRAY_LENGTH
#define EINA_C_ARRAY_LENGTH(arr)
Definition: eina_types.h:576
efl_event_callback_array_priority_add
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...
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.
Definition: eo.c:2766
efl_event_callback_priority_add
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.
_Efl_Callback_Array_Item
An item in an array of callback desc/func.
Definition: Eo.h:269