2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2002-12-16 16:00:38 -08:00
|
|
|
#include "evas_private.h"
|
|
|
|
|
|
|
|
/* private calls */
|
|
|
|
|
|
|
|
/* local calls */
|
|
|
|
|
|
|
|
/* public calls */
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN void
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_key_focus_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool focus)
|
2002-12-16 16:00:38 -08:00
|
|
|
{
|
2012-10-08 18:58:41 -07:00
|
|
|
|
2011-12-14 22:23:53 -08:00
|
|
|
int event_id = 0;
|
2012-10-08 18:58:41 -07:00
|
|
|
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
2002-12-16 16:00:38 -08:00
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2013-09-02 04:28:23 -07:00
|
|
|
|
2016-08-18 21:33:11 -07:00
|
|
|
event_id = _evas_object_event_new();
|
2013-09-02 19:08:12 -07:00
|
|
|
if (obj->focused == focus) goto end;
|
2016-10-06 20:43:21 -07:00
|
|
|
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_FOCUS_SET, 1, focus)) return;
|
2002-12-16 16:00:38 -08:00
|
|
|
if (focus)
|
|
|
|
{
|
2011-12-14 21:25:37 -08:00
|
|
|
if (obj->layer->evas->focused)
|
2016-06-16 01:19:23 -07:00
|
|
|
evas_object_focus_set(obj->layer->evas->focused, 0);
|
2013-09-02 19:08:12 -07:00
|
|
|
|
|
|
|
if (obj->layer->evas->focused) goto end;
|
2011-12-14 21:25:37 -08:00
|
|
|
obj->focused = 1;
|
2012-10-08 18:58:41 -07:00
|
|
|
obj->layer->evas->focused = eo_obj;
|
2016-08-25 00:03:45 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FOCUS_IN, NULL, event_id, EFL_CANVAS_OBJECT_EVENT_FOCUS_IN);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_call(obj->layer->evas->evas,
|
|
|
|
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, eo_obj);
|
2002-12-16 16:00:38 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-14 21:25:37 -08:00
|
|
|
obj->focused = 0;
|
|
|
|
obj->layer->evas->focused = NULL;
|
2016-08-25 00:03:45 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_FOCUS_OUT, NULL, event_id, EFL_CANVAS_OBJECT_EVENT_FOCUS_OUT);
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_event_callback_call(obj->layer->evas->evas,
|
|
|
|
EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, eo_obj);
|
2002-12-16 16:00:38 -08:00
|
|
|
}
|
2013-09-02 04:28:23 -07:00
|
|
|
|
|
|
|
end:
|
2012-10-08 18:58:41 -07:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
2002-12-16 16:00:38 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 04:51:35 -07:00
|
|
|
EOLIAN Eina_Bool
|
2016-06-20 21:26:15 -07:00
|
|
|
_efl_canvas_object_key_focus_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
|
2002-12-16 16:00:38 -08:00
|
|
|
{
|
2014-03-11 04:51:35 -07:00
|
|
|
return obj->focused;
|
2002-12-16 16:00:38 -08:00
|
|
|
}
|
|
|
|
|
2014-03-11 23:53:00 -07:00
|
|
|
EOLIAN Evas_Object*
|
2014-06-26 14:29:46 -07:00
|
|
|
_evas_canvas_focus_get(Eo *eo_obj EINA_UNUSED, Evas_Public_Data *e)
|
2002-12-16 16:00:38 -08:00
|
|
|
{
|
2014-03-11 23:53:00 -07:00
|
|
|
return e->focused;
|
2012-10-08 18:58:41 -07:00
|
|
|
}
|