Tizen Native API

This group provides functions relating to canvas events, which are mainly reports on its internal states changing such as an object getting focused, the rendering being updated, and so on.

Functions

void evas_event_callback_add (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
 Adds or registers a callback function to a given canvas event.
void evas_event_callback_priority_add (Evas *e, Evas_Callback_Type type, Evas_Callback_Priority priority, Evas_Event_Cb func, const void *data)
 Adds or registers a callback function to a given canvas event with a non-default priority set. Except for the priority field, it is exactly the same as evas_event_callback_add.
void * evas_event_callback_del (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func)
 Deletes a callback function from the canvas.
void * evas_event_callback_del_full (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
 Deletes (unregisters) a callback function registered to a given canvas event.
void evas_post_event_callback_push (Evas *e, Evas_Object_Event_Post_Cb func, const void *data)
 Pushes a callback on the post-event callback stack.
void evas_post_event_callback_remove (Evas *e, Evas_Object_Event_Post_Cb func)
 Removes a callback from the post-event callback stack.
void evas_post_event_callback_remove_full (Evas *e, Evas_Object_Event_Post_Cb func, const void *data)
 Removes a callback from the post-event callback stack.

Typedefs

typedef void(* Evas_Event_Cb )(void *data, Evas *e, void *event_info)
 Evas event callback function signature.
typedef Eina_Bool(* Evas_Object_Event_Post_Cb )(void *data, Evas *e)
 Evas event callback Post function signature.

Typedef Documentation

typedef void(* Evas_Event_Cb)(void *data, Evas *e, void *event_info)

Evas event callback function signature.

Since :
2.3.1
typedef Eina_Bool(* Evas_Object_Event_Post_Cb)(void *data, Evas *e)

Evas event callback Post function signature.

Since :
2.3.1

Function Documentation

void evas_event_callback_add ( Evas e,
Evas_Callback_Type  type,
Evas_Event_Cb  func,
const void *  data 
)

Adds or registers a callback function to a given canvas event.

This function adds a function callback to the canvas e when the event of type type occurs on it. The function pointer is func.

Since :
2.3.1
Remarks:
In the event of a memory allocation error during the addition of the callback to the canvas.
A callback function must have the Evas_Event_Cb prototype definition. The first parameter (data) in this definition has the same value passed to evas_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 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 do not carry extra context with them, but others do.
The valid event types type to trigger the function are EVAS_CALLBACK_RENDER_FLUSH_PRE, EVAS_CALLBACK_RENDER_FLUSH_POST, EVAS_CALLBACK_CANVAS_FOCUS_IN, EVAS_CALLBACK_CANVAS_FOCUS_OUT, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN and EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT. This determines the kind of event that triggers the callback to be called. Only the last two event types listed here provide useful event information data -- a pointer to the recently focused Evas object. For the others the event_info pointer is going to be NULL.
The canvas flushes its rendering pipeline (EVAS_CALLBACK_RENDER_FLUSH_PRE) whenever the _resize_cb routine takes place: it has to redraw that image at a different size. Also, the callback on an object being focused comes just after you focus it explicitly, on code.
Be careful not to add the same callback multiple times, if that is not what you want, because Evas does not check if a callback existed before exactly as the one being registered (and thus, call it more than once on the event, in this case). This would make sense if you passed different functions and/or callback data, only.
Parameters:
[in]eThe canvas to attach a callback to
[in]typeThe type of event that triggers the callback
[in]funcThe (callback) function to be called when the event is triggered
[in]dataThe data pointer to be passed to func
void* evas_event_callback_del ( Evas e,
Evas_Callback_Type  type,
Evas_Event_Cb  func 
)

Deletes a callback function from the canvas.

This function removes the most recently added callback from the canvas e which is triggered by the event type type and is calling the function func when triggered. If the removal is successful it also returns the data pointer that is passed to evas_event_callback_add() when the callback is added to the canvas. If not successful NULL is returned.

Since :
2.3.1
Remarks:
The following is an example:
 extern Evas *e;
 void *my_data;
 void focus_in_callback(void *data, Evas *e, void *event_info);

 my_data = evas_event_callback_del(ebject, EVAS_CALLBACK_CANVAS_FOCUS_IN, focus_in_callback);
Parameters:
[in]eThe canvas to remove a callback from
[in]typeThe type of event that is triggering the callback
[in]funcThe function that is to be called when the event is triggered
Returns:
The data pointer that is to be passed to the callback
void* evas_event_callback_del_full ( Evas e,
Evas_Callback_Type  type,
Evas_Event_Cb  func,
const void *  data 
)

Deletes (unregisters) a callback function registered to a given canvas event.

This function removes the first added callback from the canvas e matching the event type type, the registered function pointer func and the callback data pointer data. If the removal is successful it also returns the data pointer that is passed to evas_event_callback_add() (that is the same as the parameter) when the callback(s) is (were) added to the canvas. If not successful NULL is returned. A common use would be to remove an exact match of a callback.

Since :
2.3.1
Remarks:
For deleting canvas events callbacks filtering by just type and function pointer, use evas_event_callback_del().
Parameters:
[in]eThe Canvas to remove an event callback from
[in]typeThe type of event that triggers the callback
[in]funcThe function that is to be called when the event is triggered
[in]dataThe data pointer that is to be passed to the callback
Returns:
The data pointer that is to be passed to the callback
void evas_event_callback_priority_add ( Evas e,
Evas_Callback_Type  type,
Evas_Callback_Priority  priority,
Evas_Event_Cb  func,
const void *  data 
)

Adds or registers a callback function to a given canvas event with a non-default priority set. Except for the priority field, it is exactly the same as evas_event_callback_add.

Since (EFL) :
1.1
Since :
2.3.1
Parameters:
[in]eThe canvas to attach a callback to
[in]typeThe type of event that triggers the callback
[in]priorityThe priority of the callback, lower values called first
[in]funcThe (callback) function to be called when the event is triggered
[in]dataThe data pointer to be passed to func
See also:
evas_event_callback_add
void evas_post_event_callback_push ( Evas e,
Evas_Object_Event_Post_Cb  func,
const void *  data 
)

Pushes a callback on the post-event callback stack.

Since :
2.3.1
Remarks:
Evas has a stack of callbacks that get called after all the callbacks for an event have triggered (all the objects it triggers on and all the callbacks in each object triggered). When all these have been called, the stack is unwound from most recently to least recently pushed item and removed from the stack calling the callback set for it.
This is intended for doing reverse logic-like processing, for example - when a child object that happens to get the event later is meant to be able to "steal" functions from a parent and when this stack is unwound, have its function called first, thus being able to set flags, or return 0 from the post-callback, that stops all other post-callbacks in the current stack from being called (thus basically allowing a child to take control, if the event callback prepares information ready for taking action, but the post callback actually does the action).
Parameters:
[in]eThe canvas to push the callback on
[in]funcThe function that to be called when the stack is unwound
[in]dataThe data pointer to be passed to the callback

Removes a callback from the post-event callback stack.

This removes a callback from the stack added with evas_post_event_callback_push(). The first instance of the function in the callback stack is removed from being executed when the stack is unwound. Further instances may still be run on unwind.

Since :
2.3.1
Parameters:
[in]eThe canvas to push the callback on
[in]funcThe function that to be called when the stack is unwound
void evas_post_event_callback_remove_full ( Evas e,
Evas_Object_Event_Post_Cb  func,
const void *  data 
)

Removes a callback from the post-event callback stack.

This removes a callback from the stack added with evas_post_event_callback_push(). The first instance of the function and data in the callback stack is removed from being executed when the stack is unwound. Further instances may still be run on unwind.

Since :
2.3.1
Parameters:
[in]eThe canvas to push the callback on
[in]funcThe function that to be called when the stack is unwound
[in]dataThe data pointer to be passed to the callback