efl_ui_draggable: move these events back to legacy

they are not used yet in efl.ui. namespace, and they are needed for
different events.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11196
This commit is contained in:
Marcel Hollerbach 2020-01-26 10:22:55 +01:00
parent d2e1d430a8
commit c9c540b9df
4 changed files with 32 additions and 46 deletions

View File

@ -22,16 +22,4 @@ interface @beta Efl.Ui.Draggable
}
}
}
events {
/* FIXME: Explain what is the object passed through the event_infos */
drag: Efl.Object; [[Called when drag operation starts]]
drag,start: void; [[Called when drag started]]
drag,stop: Efl.Object; [[Called when drag stopped]]
drag,end: void; [[Called when drag operation ends]]
drag,start,up: Efl.Object; [[Called when drag starts into up direction]]
drag,start,down: Efl.Object; [[Called when drag starts into down direction]]
drag,start,right: Efl.Object; [[Called when drag starts into right direction]]
drag,start,left: Efl.Object; [[Called when drag starts into left direction]]
}
}

View File

@ -785,7 +785,7 @@ _item_mouse_move_cb(void *data,
if ((it->dragging) && (it->down))
{
ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
efl_event_callback_legacy_call(WIDGET(it), EFL_UI_EVENT_DRAG, eo_it);
evas_object_smart_callback_call(WIDGET(it), "drag", eo_it);
return;
}
@ -834,17 +834,17 @@ _item_mouse_move_cb(void *data,
if ((adx > minw) || (ady > minh))
{
const Efl_Event_Description *left_drag, *right_drag;
const char *left_drag, *right_drag;
if (!efl_ui_mirrored_get(WIDGET(it)))
{
left_drag = EFL_UI_EVENT_DRAG_START_LEFT;
right_drag = EFL_UI_EVENT_DRAG_START_RIGHT;
left_drag = "drag,start,left";
right_drag = "drag,start,right";
}
else
{
left_drag = EFL_UI_EVENT_DRAG_START_RIGHT;
right_drag = EFL_UI_EVENT_DRAG_START_LEFT;
right_drag = "drag,start,left";
left_drag = "drag,start,right";
}
it->dragging = 1;
@ -858,25 +858,23 @@ _item_mouse_move_cb(void *data,
if (dy < 0)
{
if (ady > adx)
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_START_UP, eo_it);
evas_object_smart_callback_call(WIDGET(it), "drag,start,up", eo_it);
else
{
if (dx < 0)
efl_event_callback_legacy_call(WIDGET(it), left_drag, eo_it);
evas_object_smart_callback_call(WIDGET(it), left_drag, eo_it);
}
}
else
{
if (ady > adx)
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_START_DOWN, eo_it);
evas_object_smart_callback_call(WIDGET(it), "drag,start,down", eo_it);
else
{
if (dx < 0)
efl_event_callback_legacy_call(WIDGET(it), left_drag, eo_it);
evas_object_smart_callback_call(WIDGET(it), left_drag, eo_it);
else
efl_event_callback_legacy_call(WIDGET(it), right_drag, eo_it);
evas_object_smart_callback_call(WIDGET(it), right_drag, eo_it);
}
}
}
@ -1320,8 +1318,8 @@ _item_mouse_up_cb(void *data,
if (it->dragging)
{
it->dragging = EINA_FALSE;
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_STOP, eo_it);
evas_object_smart_callback_call
(WIDGET(it), "drag,stop", eo_it);
dragged = EINA_TRUE;
}

View File

@ -4098,31 +4098,31 @@ _item_mouse_move_cb(void *data,
if (dy < 0)
{
if (ady > adx)
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_START_UP, eo_it);
evas_object_smart_callback_call
(WIDGET(it), "drag,start,up", eo_it);
else
{
if (dx < 0)
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_START_LEFT, eo_it);
evas_object_smart_callback_call
(WIDGET(it), "drag,start,left", eo_it);
else
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_START_RIGHT, eo_it);
evas_object_smart_callback_call
(WIDGET(it), "drag,start,right", eo_it);
}
}
else
{
if (ady > adx)
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_START_DOWN, eo_it);
evas_object_smart_callback_call
(WIDGET(it), "drag,start,down", eo_it);
else
{
if (dx < 0)
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_START_LEFT, eo_it);
evas_object_smart_callback_call
(WIDGET(it), "drag,start,left", eo_it);
else
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_START_RIGHT, eo_it);
evas_object_smart_callback_call
(WIDGET(it), "drag,start,right", eo_it);
}
}
}
@ -4318,8 +4318,8 @@ _item_multi_down_cb(void *data,
if (it->dragging)
{
it->dragging = EINA_FALSE;
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_STOP, EO_OBJ(it));
evas_object_smart_callback_call
(WIDGET(it), "drag,stop", EO_OBJ(it));
}
ELM_SAFE_FREE(it->item->swipe_timer, ecore_timer_del);
if (sd->on_hold)
@ -5114,8 +5114,8 @@ _item_mouse_up_cb(void *data,
if (it->dragging)
{
it->dragging = EINA_FALSE;
efl_event_callback_legacy_call
(WIDGET(it), EFL_UI_EVENT_DRAG_STOP, EO_OBJ(it));
evas_object_smart_callback_call
(WIDGET(it), "drag,stop", EO_OBJ(it));
dragged = 1;
}
ELM_SAFE_FREE(it->item->swipe_timer, ecore_timer_del);

View File

@ -125,7 +125,7 @@ _drag_done_cb(void *unused EINA_UNUSED,
ELM_PHOTO_DATA_GET(obj, sd);
elm_object_scroll_freeze_pop(obj);
efl_event_callback_legacy_call(obj, EFL_UI_EVENT_DRAG_END, NULL);
evas_object_smart_callback_call(obj, "drag,end", NULL);
sd->drag_started = EINA_FALSE;
}
@ -189,8 +189,8 @@ _long_press_cb(void *obj)
_drag_done_cb, NULL))
{
elm_object_scroll_freeze_push(obj);
efl_event_callback_legacy_call
(obj, EFL_UI_EVENT_DRAG_START, NULL);
evas_object_smart_callback_call
(obj, "drag,start", NULL);
sd->drag_started = EINA_TRUE;
}
}