Objects generate events when they are moved, resized, when their visibility change, when they are deleted and so on. More...
#define | evas_obj_freeze_events_set(freeze) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_FREEZE_EVENTS_SET), EO_TYPECHECK(Eina_Bool, freeze) |
#define | evas_obj_freeze_events_get(freeze) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_FREEZE_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, freeze) |
#define | evas_obj_pass_events_set(pass) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_PASS_EVENTS_SET), EO_TYPECHECK(Eina_Bool, pass) |
#define | evas_obj_pass_events_get(pass) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_PASS_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, pass) |
#define | evas_obj_repeat_events_set(repeat) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_REPEAT_EVENTS_SET), EO_TYPECHECK(Eina_Bool, repeat) |
#define | evas_obj_repeat_events_get(repeat) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_REPEAT_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, repeat) |
#define | evas_obj_propagate_events_set(propagate) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_PROPAGATE_EVENTS_SET), EO_TYPECHECK(Eina_Bool, propagate) |
#define | evas_obj_propagate_events_get(propagate) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_PROPAGATE_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, propagate) |
void | evas_object_event_callback_add (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) |
Add (register) a callback function to a given Evas object event. More... | |
void | evas_object_event_callback_priority_add (Evas_Object *obj, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Object_Event_Cb func, const void *data) |
Add (register) a callback function to a given Evas object event with a non-default priority set. More... | |
void * | evas_object_event_callback_del (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) |
Delete a callback function from an object. More... | |
void * | evas_object_event_callback_del_full (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) |
Delete (unregister) a callback function registered to a given Evas object event. More... | |
void | evas_object_pass_events_set (Evas_Object *obj, Eina_Bool pass) |
Set whether an Evas object is to pass (ignore) events. More... | |
Eina_Bool | evas_object_pass_events_get (const Evas_Object *obj) |
Determine whether an object is set to pass (ignore) events. More... | |
void | evas_object_repeat_events_set (Evas_Object *obj, Eina_Bool repeat) |
Set whether an Evas object is to repeat events. More... | |
Eina_Bool | evas_object_repeat_events_get (const Evas_Object *obj) |
Determine whether an object is set to repeat events. More... | |
void | evas_object_propagate_events_set (Evas_Object *obj, Eina_Bool prop) |
Set whether events on a smart object's member should get propagated up to its parent. More... | |
Eina_Bool | evas_object_propagate_events_get (const Evas_Object *obj) |
Retrieve whether an Evas object is set to propagate events. More... | |
void | evas_object_freeze_events_set (Evas_Object *obj, Eina_Bool freeze) |
Set whether an Evas object is to freeze (discard) events. More... | |
Eina_Bool | evas_object_freeze_events_get (const Evas_Object *obj) |
Determine whether an object is set to freeze (discard) events. More... | |
Objects generate events when they are moved, resized, when their visibility change, when they are deleted and so on.
These methods allow one to be notified about and to handle such events.
Objects also generate events on input (keyboard and mouse), if they accept them (are visible, focused, etc).
For each of those events, Evas provides a way for one to register callback functions to be issued just after they happen.
The following figure illustrates some Evas (event) callbacks:
These events have their values in the Evas_Callback_Type enumeration, which has also ones happening on the canvas level (see Canvas Events ).
Examples on this group of functions can be found here and here.
#define evas_obj_freeze_events_set | ( | freeze | ) | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_FREEZE_EVENTS_SET), EO_TYPECHECK(Eina_Bool, freeze) |
Set whether an Evas object is to freeze (discard) events.
[in] | freeze | in |
Referenced by evas_object_freeze_events_set().
#define evas_obj_freeze_events_get | ( | freeze | ) | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_FREEZE_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, freeze) |
Determine whether an object is set to freeze (discard) events.
[out] | freeze | out |
Referenced by evas_object_freeze_events_get().
#define evas_obj_pass_events_set | ( | pass | ) | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_PASS_EVENTS_SET), EO_TYPECHECK(Eina_Bool, pass) |
Set whether an Evas object is to pass (ignore) events.
[in] | pass | in |
Referenced by evas_object_pass_events_set().
#define evas_obj_pass_events_get | ( | pass | ) | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_PASS_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, pass) |
Determine whether an object is set to pass (ignore) events.
[out] | pass |
Referenced by evas_object_evas_get(), and evas_object_pass_events_get().
#define evas_obj_repeat_events_set | ( | repeat | ) | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_REPEAT_EVENTS_SET), EO_TYPECHECK(Eina_Bool, repeat) |
Set whether an Evas object is to repeat events.
[in] | repeat | in |
Referenced by evas_object_repeat_events_set().
#define evas_obj_repeat_events_get | ( | repeat | ) | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_REPEAT_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, repeat) |
Determine whether an object is set to repeat events.
[out] | repeat | out |
Referenced by evas_object_evas_get(), and evas_object_repeat_events_get().
#define evas_obj_propagate_events_set | ( | propagate | ) | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_PROPAGATE_EVENTS_SET), EO_TYPECHECK(Eina_Bool, propagate) |
Set whether events on a smart object's member should get propagated up to its parent.
[in] | propagate | in |
Referenced by evas_object_propagate_events_set().
#define evas_obj_propagate_events_get | ( | propagate | ) | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_PROPAGATE_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, propagate) |
Retrieve whether an Evas object is set to propagate events.
[out] | propagate | out |
Referenced by evas_object_evas_get(), and evas_object_propagate_events_get().
void evas_object_event_callback_add | ( | Evas_Object * | obj, |
Evas_Callback_Type | type, | ||
Evas_Object_Event_Cb | func, | ||
const void * | data | ||
) |
Add (register) a callback function to a given Evas object event.
obj | Object to attach a callback to |
type | The type of event that will trigger the callback |
func | The function to be called when the event is triggered |
data | The data pointer to be passed to func |
This function adds a function callback to an object when the event of type type
occurs on object obj
. The function is func
.
In the event of a memory allocation error during addition of the callback to the object, evas_alloc_error() should be used to determine the nature of the error, if any, and the program should sensibly try and recover.
A callback function must have the Evas_Object_Event_Cb prototype definition. The first parameter (data
) in this definition will have the same value passed to evas_object_event_callback_add() as the data
parameter, at runtime. The second parameter e
is the canvas pointer on which the event occurred. The third parameter is a pointer to the object on which event occurred. Finally, the fourth parameter event_info
is a pointer to a data structure that may or may not be passed to the callback, depending on the event type that triggered the callback. This is so because some events don't carry extra context with them, but others do.
The event type type
to trigger the function may be one of EVAS_CALLBACK_MOUSE_IN, EVAS_CALLBACK_MOUSE_OUT, EVAS_CALLBACK_MOUSE_DOWN, EVAS_CALLBACK_MOUSE_UP, EVAS_CALLBACK_MOUSE_MOVE, EVAS_CALLBACK_MOUSE_WHEEL, EVAS_CALLBACK_MULTI_DOWN, EVAS_CALLBACK_MULTI_UP, EVAS_CALLBACK_MULTI_MOVE, EVAS_CALLBACK_FREE, EVAS_CALLBACK_KEY_DOWN, EVAS_CALLBACK_KEY_UP, EVAS_CALLBACK_FOCUS_IN, EVAS_CALLBACK_FOCUS_OUT, EVAS_CALLBACK_SHOW, EVAS_CALLBACK_HIDE, EVAS_CALLBACK_MOVE, EVAS_CALLBACK_RESIZE, EVAS_CALLBACK_RESTACK, EVAS_CALLBACK_DEL, EVAS_CALLBACK_HOLD, EVAS_CALLBACK_CHANGED_SIZE_HINTS, EVAS_CALLBACK_IMAGE_PRELOADED or EVAS_CALLBACK_IMAGE_UNLOADED.
This determines the kind of event that will trigger the callback. What follows is a list explaining better the nature of each type of event, along with their associated event_info
pointers:
event_info
is a pointer to an Evas_Event_Mouse_In structobj
. This may occur by the mouse pointer being moved by evas_event_feed_mouse_move() calls, or by the object being shown, raised, moved, resized, or other objects being moved out of the way, hidden or lowered, whatever may cause the mouse pointer to get on top of obj
, having been on top of another object previously.event_info
is a pointer to an Evas_Event_Mouse_Out structevent_info
is a pointer to an Evas_Event_Mouse_Down structevent_info
is a pointer to an Evas_Event_Mouse_Up structevent_info
is a pointer to an Evas_Event_Mouse_Move structevent_info
is a pointer to an Evas_Event_Mouse_Wheel structevent_info
is a pointer to an Evas_Event_Multi_Down structevent_info
is a pointer to an Evas_Event_Multi_Up structevent_info
is a pointer to an Evas_Event_Multi_Move structevent_info
is NULL
event_info
is a pointer to an Evas_Event_Key_Down structevent_info
is a pointer to an Evas_Event_Key_Up struct event_info
is NULL
event_info
is NULL
event_info
is NULL
event_info
is NULL
event_info
is NULL
event_info
is NULL
event_info
is NULL
event_info
is NULL
.event_info
is a pointer to an Evas_Event_Hold structevent_info
is NULL
.event_info
is NULL
.event_info
is NULL
.Example:
See the full example here.
References EAPI, EVAS_CALLBACK_PRIORITY_DEFAULT, and evas_object_event_callback_priority_add().
Referenced by ecore_evas_object_associate_get(), edje_perspective_new(), evas_object_image_filled_set(), and evas_object_image_native_surface_set().
void evas_object_event_callback_priority_add | ( | Evas_Object * | obj, |
Evas_Callback_Type | type, | ||
Evas_Callback_Priority | priority, | ||
Evas_Object_Event_Cb | func, | ||
const void * | data | ||
) |
Add (register) a callback function to a given Evas object event with a non-default priority set.
Except for the priority field, it's exactly the same as evas_object_event_callback_add
obj | Object to attach a callback to |
type | The type of event that will trigger the callback |
priority | The priority of the callback, lower values called first. |
func | The function to be called when the event is triggered |
data | The data pointer to be passed to func |
References EAPI, eina_inlist_append(), and EINA_INLIST_GET.
Referenced by evas_object_event_callback_add().
void* evas_object_event_callback_del | ( | Evas_Object * | obj, |
Evas_Callback_Type | type, | ||
Evas_Object_Event_Cb | func | ||
) |
Delete a callback function from an object.
obj | Object to remove a callback from |
type | The type of event that was triggering the callback |
func | The function that was to be called when the event was triggered |
This function removes the most recently added callback from the object obj
which was triggered by the event type type
and was calling the function func
when triggered. If the removal is successful it will also return the data pointer that was passed to evas_object_event_callback_add() when the callback was added to the object. If not successful NULL
will be returned.
Example:
References EAPI, EINA_INLIST_FOREACH, EINA_INLIST_GET, and eina_inlist_remove().
Referenced by edje_edit_object_add(), and evas_object_image_filled_set().
void* evas_object_event_callback_del_full | ( | Evas_Object * | obj, |
Evas_Callback_Type | type, | ||
Evas_Object_Event_Cb | func, | ||
const void * | data | ||
) |
Delete (unregister) a callback function registered to a given Evas object event.
obj | Object to remove a callback from |
type | The type of event that was triggering the callback |
func | The function that was to be called when the event was triggered |
data | The data pointer that was to be passed to the callback |
This function removes the most recently added callback from the object obj
, which was triggered by the event type type
and was calling the function func
with data data
, when triggered. If the removal is successful it will also return the data pointer that was passed to evas_object_event_callback_add() (that will be the same as the parameter) when the callback was added to the object. In errors, NULL
will be returned.
Example:
References EAPI, EINA_INLIST_FOREACH, EINA_INLIST_GET, and eina_inlist_remove().
Referenced by evas_object_image_native_surface_set().
void evas_object_pass_events_set | ( | Evas_Object * | obj, |
Eina_Bool | pass | ||
) |
Set whether an Evas object is to pass (ignore) events.
obj | the Evas object to operate on |
pass | whether obj is to pass events (EINA_TRUE ) or not (EINA_FALSE ) |
If pass
is EINA_TRUE
, it will make events on obj
to be ignored. They will be triggered on the next lower object (that is not set to pass events), instead (see evas_object_below_get()).
If pass
is EINA_FALSE
, events will be processed on that object as normal.
References EAPI, EINA_FALSE, EINA_TRUE, and evas_obj_pass_events_set.
Referenced by edje_edit_part_clip_to_set(), edje_edit_part_mouse_events_set(), and evas_object_smart_clipped_clipper_get().
Eina_Bool evas_object_pass_events_get | ( | const Evas_Object * | obj | ) |
Determine whether an object is set to pass (ignore) events.
obj | the Evas object to get information from. |
obj
is set to pass events (EINA_TRUE
) or not (EINA_FALSE
)Example:
See the full example.
References EAPI, EINA_FALSE, and evas_obj_pass_events_get.
void evas_object_repeat_events_set | ( | Evas_Object * | obj, |
Eina_Bool | repeat | ||
) |
Set whether an Evas object is to repeat events.
obj | the Evas object to operate on |
repeat | whether obj is to repeat events (EINA_TRUE ) or not (EINA_FALSE ) |
If repeat
is EINA_TRUE
, it will make events on obj
to also be repeated for the next lower object in the objects' stack (see see evas_object_below_get()).
If repeat
is EINA_FALSE
, events occurring on obj
will be processed only on it.
Example:
See the full example.
References EAPI, and evas_obj_repeat_events_set.
Referenced by edje_edit_part_repeat_events_set().
Eina_Bool evas_object_repeat_events_get | ( | const Evas_Object * | obj | ) |
Determine whether an object is set to repeat events.
obj | the given Evas object pointer |
obj
is set to repeat events (EINA_TRUE
) or not (EINA_FALSE
)References EAPI, EINA_FALSE, and evas_obj_repeat_events_get.
void evas_object_propagate_events_set | ( | Evas_Object * | obj, |
Eina_Bool | prop | ||
) |
Set whether events on a smart object's member should get propagated up to its parent.
obj | the smart object's child to operate on |
prop | whether to propagate events (EINA_TRUE ) or not (EINA_FALSE ) |
This function has no effect if obj
is not a member of a smart object.
If prop
is EINA_TRUE
, events occurring on this object will be propagated on to the smart object of which obj
is a member. If prop
is EINA_FALSE
, events occurring on this object will not be propagated on to the smart object of which obj
is a member. The default value is EINA_TRUE
.
References EAPI, and evas_obj_propagate_events_set.
Eina_Bool evas_object_propagate_events_get | ( | const Evas_Object * | obj | ) |
Retrieve whether an Evas object is set to propagate events.
obj | the given Evas object pointer |
obj
is set to propagate events (EINA_TRUE
) or not (EINA_FALSE
)References EAPI, EINA_FALSE, and evas_obj_propagate_events_get.
void evas_object_freeze_events_set | ( | Evas_Object * | obj, |
Eina_Bool | freeze | ||
) |
Set whether an Evas object is to freeze (discard) events.
obj | the Evas object to operate on |
freeze | pass whether obj is to freeze events (EINA_TRUE ) or not (EINA_FALSE ) |
If freeze
is EINA_TRUE
, it will make events on obj
to be discarded. Unlike evas_object_pass_events_set(), events will not be passed to next lower object. This API can be used for blocking events while obj
is on transiting.
If freeze
is EINA_FALSE
, events will be processed on that object as normal.
References EAPI, EINA_FALSE, EINA_TRUE, evas_event_feed_mouse_move(), and evas_obj_freeze_events_set.
Eina_Bool evas_object_freeze_events_get | ( | const Evas_Object * | obj | ) |
Determine whether an object is set to freeze (discard) events.
obj | the Evas object to get information from. |
obj
is set to freeze events (EINA_TRUE
) or not (EINA_FALSE
)References EAPI, EINA_FALSE, and evas_obj_freeze_events_get.