evas_callbacks: redo legacy smart object events for recently changed event names

Summary:
this makes it more obvious which events are legacy and makes them easier to remove
in the future

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8002
This commit is contained in:
Mike Blumenkrantz 2019-02-22 08:50:07 -05:00
parent 421bf2d0a3
commit 11e80c7327
2 changed files with 15 additions and 4 deletions

View File

@ -347,6 +347,18 @@ evas_event_callback_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
efl_event_callback_legacy_call(eo_e, _legacy_evas_callback_table(type), event_info);
}
static void
_evas_callback_legacy_smart_compatibility_do_it(Evas_Object *eo_obj, const Efl_Event_Description *efl_event_desc)
{
if (efl_event_desc == EFL_GFX_ENTITY_EVENT_POSITION_CHANGED)
evas_object_smart_callback_call(eo_obj, "move", NULL);
else if (efl_event_desc == EFL_GFX_ENTITY_EVENT_SIZE_CHANGED)
evas_object_smart_callback_call(eo_obj, "resize", NULL);
else if (efl_event_desc == EFL_GFX_ENTITY_EVENT_STACKING_CHANGED)
evas_object_smart_callback_call(eo_obj, "restack", NULL);
}
void
evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
Evas_Callback_Type type, void *event_info, int event_id,
@ -410,6 +422,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
e->current_event = type;
efl_event_callback_legacy_call(eo_obj, efl_event_desc, event_info);
_evas_callback_legacy_smart_compatibility_do_it(eo_obj, efl_event_desc);
/* multi events with finger 0 - only for eo callbacks */
if (type == EVAS_CALLBACK_MOUSE_DOWN)

View File

@ -41,8 +41,7 @@ evas_object_inform_call_move(Evas_Object *eo_obj, Evas_Object_Protected_Data *ob
pos = ((Eina_Rect) obj->cur->geometry).pos;
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, NULL, event_id, EFL_GFX_ENTITY_EVENT_MOVE);
efl_event_callback_call(eo_obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, &pos);
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, &pos, event_id, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}
@ -54,8 +53,7 @@ evas_object_inform_call_resize(Evas_Object *eo_obj, Evas_Object_Protected_Data *
size = ((Eina_Rect) obj->cur->geometry).size;
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, NULL, event_id, EFL_GFX_ENTITY_EVENT_RESIZE);
efl_event_callback_call(eo_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, &size);
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, &size, event_id, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED);
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
}