bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c9c540b9df90f5b2867da3b5c4dcb69310f89623

commit c9c540b9df90f5b2867da3b5c4dcb69310f89623
Author: Marcel Hollerbach <[email protected]>
Date:   Sun Jan 26 10:22:55 2020 +0100

    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 <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11196
---
 src/lib/efl/interfaces/efl_ui_draggable.eo | 12 -----------
 src/lib/elementary/elm_gengrid.c           | 28 ++++++++++++--------------
 src/lib/elementary/elm_genlist.c           | 32 +++++++++++++++---------------
 src/lib/elementary/elm_photo.c             |  6 +++---
 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
              }
         }
    }
-
-   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]]
-   }
 }
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,
    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;
      }
 
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,
         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);
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,
    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;
           }
      }

-- 


Reply via email to