forked from enlightenment/efl
Pending patch from glima, who's on vacations.
Add two new canvas level callbacks: OBJECT_FOCUS_IN/OUT As we already had callbacks for objects gaining or losing focus, then two more for the Canvas, now we can have the entire Evas be notified when any object changes its focused status. The object in question is passed as the event_info for the callback. SVN revision: 52196
This commit is contained in:
parent
9c091e1714
commit
2bd045dd1f
|
@ -112,7 +112,8 @@ typedef enum _Evas_Callback_Type
|
|||
EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
|
||||
EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
|
||||
|
||||
|
||||
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */
|
||||
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */
|
||||
|
||||
/* the following id no event number, but a sentinel: */
|
||||
EVAS_CALLBACK_LAST /**< keep as last element/sentinel -- not really an event */
|
||||
|
|
|
@ -45,6 +45,8 @@ evas_object_focus_set(Evas_Object *obj, Eina_Bool focus)
|
|||
obj->focused = 1;
|
||||
obj->layer->evas->focused = obj;
|
||||
evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_IN, NULL);
|
||||
evas_event_callback_call(obj->layer->evas,
|
||||
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -52,6 +54,8 @@ evas_object_focus_set(Evas_Object *obj, Eina_Bool focus)
|
|||
obj->focused = 0;
|
||||
obj->layer->evas->focused = NULL;
|
||||
evas_object_event_callback_call(obj, EVAS_CALLBACK_FOCUS_OUT, NULL);
|
||||
evas_event_callback_call(obj->layer->evas,
|
||||
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, obj);
|
||||
}
|
||||
end:
|
||||
_evas_post_event_callback_call(obj->layer->evas);
|
||||
|
|
Loading…
Reference in New Issue