summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-26 10:22:55 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-19 16:34:02 +0100
commitc9c540b9df90f5b2867da3b5c4dcb69310f89623 (patch)
tree7b2b32db3b6ee5bc63760a69cf386f87e12675cd
parentd2e1d430a8a5c62b5ec3a0449ae496af1dbd8861 (diff)
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
-rw-r--r--src/lib/efl/interfaces/efl_ui_draggable.eo12
-rw-r--r--src/lib/elementary/elm_gengrid.c28
-rw-r--r--src/lib/elementary/elm_genlist.c32
-rw-r--r--src/lib/elementary/elm_photo.c6
4 files changed, 32 insertions, 46 deletions
diff --git a/src/lib/efl/interfaces/efl_ui_draggable.eo b/src/lib/efl/interfaces/efl_ui_draggable.eo
index 91c74202ad..0b4139958d 100644
--- a/src/lib/efl/interfaces/efl_ui_draggable.eo
+++ b/src/lib/efl/interfaces/efl_ui_draggable.eo
@@ -22,16 +22,4 @@ interface @beta Efl.Ui.Draggable
22 } 22 }
23 } 23 }
24 } 24 }
25
26 events {
27 /* FIXME: Explain what is the object passed through the event_infos */
28 drag: Efl.Object; [[Called when drag operation starts]]
29 drag,start: void; [[Called when drag started]]
30 drag,stop: Efl.Object; [[Called when drag stopped]]
31 drag,end: void; [[Called when drag operation ends]]
32 drag,start,up: Efl.Object; [[Called when drag starts into up direction]]
33 drag,start,down: Efl.Object; [[Called when drag starts into down direction]]
34 drag,start,right: Efl.Object; [[Called when drag starts into right direction]]
35 drag,start,left: Efl.Object; [[Called when drag starts into left direction]]
36 }
37} 25}
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index 36206fd375..df46609880 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -785,7 +785,7 @@ _item_mouse_move_cb(void *data,
785 if ((it->dragging) && (it->down)) 785 if ((it->dragging) && (it->down))
786 { 786 {
787 ELM_SAFE_FREE(it->long_timer, ecore_timer_del); 787 ELM_SAFE_FREE(it->long_timer, ecore_timer_del);
788 efl_event_callback_legacy_call(WIDGET(it), EFL_UI_EVENT_DRAG, eo_it); 788 evas_object_smart_callback_call(WIDGET(it), "drag", eo_it);
789 return; 789 return;
790 } 790 }
791 791
@@ -834,17 +834,17 @@ _item_mouse_move_cb(void *data,
834 834
835 if ((adx > minw) || (ady > minh)) 835 if ((adx > minw) || (ady > minh))
836 { 836 {
837 const Efl_Event_Description *left_drag, *right_drag; 837 const char *left_drag, *right_drag;
838 838
839 if (!efl_ui_mirrored_get(WIDGET(it))) 839 if (!efl_ui_mirrored_get(WIDGET(it)))
840 { 840 {
841 left_drag = EFL_UI_EVENT_DRAG_START_LEFT; 841 left_drag = "drag,start,left";
842 right_drag = EFL_UI_EVENT_DRAG_START_RIGHT; 842 right_drag = "drag,start,right";
843 } 843 }
844 else 844 else
845 { 845 {
846 left_drag = EFL_UI_EVENT_DRAG_START_RIGHT; 846 right_drag = "drag,start,left";
847 right_drag = EFL_UI_EVENT_DRAG_START_LEFT; 847 left_drag = "drag,start,right";
848 } 848 }
849 849
850 it->dragging = 1; 850 it->dragging = 1;
@@ -858,25 +858,23 @@ _item_mouse_move_cb(void *data,
858 if (dy < 0) 858 if (dy < 0)
859 { 859 {
860 if (ady > adx) 860 if (ady > adx)
861 efl_event_callback_legacy_call 861 evas_object_smart_callback_call(WIDGET(it), "drag,start,up", eo_it);
862 (WIDGET(it), EFL_UI_EVENT_DRAG_START_UP, eo_it);
863 else 862 else
864 { 863 {
865 if (dx < 0) 864 if (dx < 0)
866 efl_event_callback_legacy_call(WIDGET(it), left_drag, eo_it); 865 evas_object_smart_callback_call(WIDGET(it), left_drag, eo_it);
867 } 866 }
868 } 867 }
869 else 868 else
870 { 869 {
871 if (ady > adx) 870 if (ady > adx)
872 efl_event_callback_legacy_call 871 evas_object_smart_callback_call(WIDGET(it), "drag,start,down", eo_it);
873 (WIDGET(it), EFL_UI_EVENT_DRAG_START_DOWN, eo_it);
874 else 872 else
875 { 873 {
876 if (dx < 0) 874 if (dx < 0)
877 efl_event_callback_legacy_call(WIDGET(it), left_drag, eo_it); 875 evas_object_smart_callback_call(WIDGET(it), left_drag, eo_it);
878 else 876 else
879 efl_event_callback_legacy_call(WIDGET(it), right_drag, eo_it); 877 evas_object_smart_callback_call(WIDGET(it), right_drag, eo_it);
880 } 878 }
881 } 879 }
882 } 880 }
@@ -1320,8 +1318,8 @@ _item_mouse_up_cb(void *data,
1320 if (it->dragging) 1318 if (it->dragging)
1321 { 1319 {
1322 it->dragging = EINA_FALSE; 1320 it->dragging = EINA_FALSE;
1323 efl_event_callback_legacy_call 1321 evas_object_smart_callback_call
1324 (WIDGET(it), EFL_UI_EVENT_DRAG_STOP, eo_it); 1322 (WIDGET(it), "drag,stop", eo_it);
1325 dragged = EINA_TRUE; 1323 dragged = EINA_TRUE;
1326 } 1324 }
1327 1325
diff --git a/src/lib/elementary/elm_genlist.c b/src/lib/elementary/elm_genlist.c
index 6d53c6f255..3c586ca1e2 100644
--- a/src/lib/elementary/elm_genlist.c
+++ b/src/lib/elementary/elm_genlist.c
@@ -4098,31 +4098,31 @@ _item_mouse_move_cb(void *data,
4098 if (dy < 0) 4098 if (dy < 0)
4099 { 4099 {
4100 if (ady > adx) 4100 if (ady > adx)
4101 efl_event_callback_legacy_call 4101 evas_object_smart_callback_call
4102 (WIDGET(it), EFL_UI_EVENT_DRAG_START_UP, eo_it); 4102 (WIDGET(it), "drag,start,up", eo_it);
4103 else 4103 else
4104 { 4104 {
4105 if (dx < 0) 4105 if (dx < 0)
4106 efl_event_callback_legacy_call 4106 evas_object_smart_callback_call
4107 (WIDGET(it), EFL_UI_EVENT_DRAG_START_LEFT, eo_it); 4107 (WIDGET(it), "drag,start,left", eo_it);
4108 else 4108 else
4109 efl_event_callback_legacy_call 4109 evas_object_smart_callback_call
4110 (WIDGET(it), EFL_UI_EVENT_DRAG_START_RIGHT, eo_it); 4110 (WIDGET(it), "drag,start,right", eo_it);
4111 } 4111 }
4112 } 4112 }
4113 else 4113 else
4114 { 4114 {
4115 if (ady > adx) 4115 if (ady > adx)
4116 efl_event_callback_legacy_call 4116 evas_object_smart_callback_call
4117 (WIDGET(it), EFL_UI_EVENT_DRAG_START_DOWN, eo_it); 4117 (WIDGET(it), "drag,start,down", eo_it);
4118 else 4118 else
4119 { 4119 {
4120 if (dx < 0) 4120 if (dx < 0)
4121 efl_event_callback_legacy_call 4121 evas_object_smart_callback_call
4122 (WIDGET(it), EFL_UI_EVENT_DRAG_START_LEFT, eo_it); 4122 (WIDGET(it), "drag,start,left", eo_it);
4123 else 4123 else
4124 efl_event_callback_legacy_call 4124 evas_object_smart_callback_call
4125 (WIDGET(it), EFL_UI_EVENT_DRAG_START_RIGHT, eo_it); 4125 (WIDGET(it), "drag,start,right", eo_it);
4126 } 4126 }
4127 } 4127 }
4128 } 4128 }
@@ -4318,8 +4318,8 @@ _item_multi_down_cb(void *data,
4318 if (it->dragging) 4318 if (it->dragging)
4319 { 4319 {
4320 it->dragging = EINA_FALSE; 4320 it->dragging = EINA_FALSE;
4321 efl_event_callback_legacy_call 4321 evas_object_smart_callback_call
4322 (WIDGET(it), EFL_UI_EVENT_DRAG_STOP, EO_OBJ(it)); 4322 (WIDGET(it), "drag,stop", EO_OBJ(it));
4323 } 4323 }
4324 ELM_SAFE_FREE(it->item->swipe_timer, ecore_timer_del); 4324 ELM_SAFE_FREE(it->item->swipe_timer, ecore_timer_del);
4325 if (sd->on_hold) 4325 if (sd->on_hold)
@@ -5114,8 +5114,8 @@ _item_mouse_up_cb(void *data,
5114 if (it->dragging) 5114 if (it->dragging)
5115 { 5115 {
5116 it->dragging = EINA_FALSE; 5116 it->dragging = EINA_FALSE;
5117 efl_event_callback_legacy_call 5117 evas_object_smart_callback_call
5118 (WIDGET(it), EFL_UI_EVENT_DRAG_STOP, EO_OBJ(it)); 5118 (WIDGET(it), "drag,stop", EO_OBJ(it));
5119 dragged = 1; 5119 dragged = 1;
5120 } 5120 }
5121 ELM_SAFE_FREE(it->item->swipe_timer, ecore_timer_del); 5121 ELM_SAFE_FREE(it->item->swipe_timer, ecore_timer_del);
diff --git a/src/lib/elementary/elm_photo.c b/src/lib/elementary/elm_photo.c
index 9fc593392f..5f8660352c 100644
--- a/src/lib/elementary/elm_photo.c
+++ b/src/lib/elementary/elm_photo.c
@@ -125,7 +125,7 @@ _drag_done_cb(void *unused EINA_UNUSED,
125 ELM_PHOTO_DATA_GET(obj, sd); 125 ELM_PHOTO_DATA_GET(obj, sd);
126 126
127 elm_object_scroll_freeze_pop(obj); 127 elm_object_scroll_freeze_pop(obj);
128 efl_event_callback_legacy_call(obj, EFL_UI_EVENT_DRAG_END, NULL); 128 evas_object_smart_callback_call(obj, "drag,end", NULL);
129 sd->drag_started = EINA_FALSE; 129 sd->drag_started = EINA_FALSE;
130} 130}
131 131
@@ -189,8 +189,8 @@ _long_press_cb(void *obj)
189 _drag_done_cb, NULL)) 189 _drag_done_cb, NULL))
190 { 190 {
191 elm_object_scroll_freeze_push(obj); 191 elm_object_scroll_freeze_push(obj);
192 efl_event_callback_legacy_call 192 evas_object_smart_callback_call
193 (obj, EFL_UI_EVENT_DRAG_START, NULL); 193 (obj, "drag,start", NULL);
194 sd->drag_started = EINA_TRUE; 194 sd->drag_started = EINA_TRUE;
195 } 195 }
196 } 196 }