Efl.Canvas.Object: Remove focus,in/out events.

Since this object already inherist Efl.Input.Interface there's no need
to have those events reimplemented.
This commit is contained in:
Guilherme Iscaro 2016-11-18 14:56:20 -02:00 committed by Bruno Dilly
parent b77f0086f5
commit 6572ad9e02
4 changed files with 22 additions and 28 deletions

View File

@ -439,8 +439,8 @@ EFL_CALLBACKS_ARRAY_DEFINE(edje_callbacks,
{ EFL_EVENT_POINTER_WHEEL, _edje_mouse_wheel_signal_cb });
EFL_CALLBACKS_ARRAY_DEFINE(edje_focus_callbacks,
{ EFL_CANVAS_OBJECT_EVENT_FOCUS_IN, _edje_focus_in_signal_cb },
{ EFL_CANVAS_OBJECT_EVENT_FOCUS_OUT, _edje_focus_out_signal_cb });
{ EFL_EVENT_FOCUS_IN, _edje_focus_in_signal_cb },
{ EFL_EVENT_FOCUS_OUT, _edje_focus_out_signal_cb });
void
_edje_callbacks_add(Evas_Object *obj, Edje *ed, Edje_Real_Part *rp)

View File

@ -636,10 +636,4 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
Efl.Gfx.Map.map_enable.set;
Efl.Gfx.Map.map_enable.get;
}
events {
focus,in; [[Focus In Event ]]
focus,out; [[Focus Out Event ]]
focus,device,in: Efl.Input.Device; [[Focus In event that contains the seat device that this object was focused. @since 1.19]]
focus,device,out: Efl.Input.Device; [[Focus Out event that contains the seat device that this object was unfocused.@since 1.19]]
}
}

View File

@ -48,8 +48,8 @@ DEFINE_EVAS_CALLBACKS(_legacy_evas_callback_table, EVAS_CALLBACK_LAST,
EVAS_OBJECT_EVENT_FREE,
EFL_EVENT_KEY_DOWN,
EFL_EVENT_KEY_UP,
EFL_CANVAS_OBJECT_EVENT_FOCUS_IN,
EFL_CANVAS_OBJECT_EVENT_FOCUS_OUT,
EFL_EVENT_FOCUS_IN,
EFL_EVENT_FOCUS_OUT,
EFL_GFX_EVENT_SHOW,
EFL_GFX_EVENT_HIDE,
EFL_GFX_EVENT_MOVE,
@ -93,7 +93,8 @@ typedef enum {
EFL_EVENT_TYPE_STRUCT,
EFL_EVENT_TYPE_POINTER,
EFL_EVENT_TYPE_KEY,
EFL_EVENT_TYPE_HOLD
EFL_EVENT_TYPE_HOLD,
EFL_EVENT_TYPE_FOCUS
} Efl_Event_Info_Type;
typedef struct
@ -147,6 +148,10 @@ _evas_event_efl_event_info_type(Evas_Callback_Type type)
case EVAS_CALLBACK_DEVICE_CHANGED: /* Efl.Input.Device */
return EFL_EVENT_TYPE_OBJECT;
case EVAS_CALLBACK_FOCUS_IN:
case EVAS_CALLBACK_FOCUS_OUT:
return EFL_EVENT_TYPE_FOCUS;
default:
return EFL_EVENT_TYPE_NULL;
}
@ -164,6 +169,7 @@ _eo_evas_object_cb(void *data, const Efl_Event *event)
if (!info->func) return;
evas = evas_object_evas_get(event->object);
event_info = event->info;
switch (info->efl_event_type)
{
case EFL_EVENT_TYPE_POINTER:
@ -178,12 +184,13 @@ _eo_evas_object_cb(void *data, const Efl_Event *event)
event_info = efl_input_hold_legacy_info_fill(efl_event_info, &event_flags);
break;
case EFL_EVENT_TYPE_FOCUS:
event_info = NULL;
case EFL_EVENT_TYPE_NULL:
case EFL_EVENT_TYPE_STRUCT:
case EFL_EVENT_TYPE_OBJECT:
info->func(info->data, evas, event->object, event->info);
info->func(info->data, evas, event->object, event_info);
return;
default: return;
}

View File

@ -69,7 +69,7 @@ _evas_focus_dispatch_event(Evas_Object_Protected_Data *obj, Efl_Input_Device *se
Efl_Input_Focus_Data *ev_data;
Efl_Input_Focus *evt;
Evas_Callback_Type cb_evas, cb_obj_evas;
const Efl_Event_Description *efl_object_focus_event, *efl_object_focus_device_event;
const Efl_Event_Description *efl_object_focus_event;
evt = efl_input_instance_get(EFL_INPUT_FOCUS_CLASS, NULL, (void **) &ev_data);
if (!evt) return;
@ -82,27 +82,20 @@ _evas_focus_dispatch_event(Evas_Object_Protected_Data *obj, Efl_Input_Device *se
{
cb_obj_evas = EVAS_CALLBACK_FOCUS_IN;
cb_evas = EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN;
efl_object_focus_event = EFL_CANVAS_OBJECT_EVENT_FOCUS_IN;
efl_object_focus_device_event = EFL_CANVAS_OBJECT_EVENT_FOCUS_DEVICE_IN;
efl_object_focus_event = EFL_EVENT_FOCUS_IN;
}
else
{
cb_obj_evas = EVAS_CALLBACK_FOCUS_OUT;
cb_evas = EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT;
efl_object_focus_event = EFL_CANVAS_OBJECT_EVENT_FOCUS_OUT;
efl_object_focus_device_event = EFL_CANVAS_OBJECT_EVENT_FOCUS_DEVICE_OUT;
efl_object_focus_event = EFL_EVENT_FOCUS_OUT;
}
if (seat == obj->layer->evas->default_seat)
{
evas_object_event_callback_call(obj->object, obj,
cb_obj_evas,
NULL, _evas_object_event_new(),
efl_object_focus_event);
}
evas_event_callback_call(obj->layer->evas->evas,
cb_evas, evt);
efl_event_callback_call(obj->object, efl_object_focus_device_event, seat);
evas_object_event_callback_call(obj->object, obj,
cb_obj_evas,
evt, _evas_object_event_new(),
efl_object_focus_event);
evas_event_callback_call(obj->layer->evas->evas, cb_evas, evt);
efl_del(evt);
}