Evas.Canvas: Move some event_feed to legacy
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 28 Apr 2016 09:43:18 +0000 (18:43 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 31 May 2016 10:03:04 +0000 (19:03 +0900)
Paving the way to Efl.Pointer.Event...

src/lib/efl/interfaces/efl_pointer_event.eo
src/lib/evas/Evas_Legacy.h
src/lib/evas/canvas/evas_canvas.eo
src/lib/evas/canvas/evas_events.c

index c845065..ecc955f 100644 (file)
@@ -93,7 +93,7 @@ class Efl.Pointer.Event (Eo.Base, Efl.Event)
       @property device {
          [[Pointing device that originated this event.]]
          values {
-            dev: Efl.Input.Device*;
+            dev: Efl.Input.Device;
          }
       }
       @property source {
@@ -101,7 +101,7 @@ class Efl.Pointer.Event (Eo.Base, Efl.Event)
            propagation or repetition of the event.
          ]]
          values {
-            src: Efl.Gfx*;
+            src: Efl.Gfx;
          }
       }
       /* FIXME: why not double_click() and triple_click() */
index d5f9388..c1354e5 100644 (file)
@@ -336,6 +336,77 @@ EAPI int              evas_event_freeze_get(const Evas *e) EINA_WARN_UNUSED_RESU
  * out on new objects if the state change demands it.
  */
 EAPI void             evas_event_thaw_eval(Evas *e) EINA_ARG_NONNULL(1);
+
+/**
+ * @brief Mouse move event feed.
+ *
+ * This function will set some evas properties that is necessary when the mouse
+ * is moved from its last position. It prepares information to be treated by
+ * the callback function.
+ *
+ * @param[in] y The vertical position of the mouse pointer.
+ * @param[in] timestamp The timestamp of the mouse up event.
+ * @param[in] data The data for canvas.
+ */
+EAPI void             evas_event_feed_mouse_move(Evas *obj, int x, int y, unsigned int timestamp, const void *data);
+
+/**
+ * @brief Mouse move event feed from input.
+ *
+ * Similar to the @ref evas_event_feed_mouse_move, this function will inform
+ * Evas about mouse move events which were received by the input system,
+ * relative to the 0,0 of the window, not to the canvas 0,0. It will take care
+ * of doing any special transformation like adding the framespace offset to the
+ * mouse event.
+ *
+ * @param[in] y The vertical position of the mouse pointer relative to the 0,0
+ * of the window/surface.
+ * @param[in] timestamp The timestamp of the mouse move event.
+ * @param[in] data The data for canvas.
+ *
+ * @since 1.8
+ */
+EAPI void             evas_event_input_mouse_move(Evas *obj, int x, int y, unsigned int timestamp, const void *data);
+
+/**
+ * @brief Mouse up event feed.
+ *
+ * This function will set some evas properties that is necessary when the mouse
+ * button is released. It prepares information to be treated by the callback
+ * function.
+ *
+ * @param[in] flags Evas button flags.
+ * @param[in] timestamp The timestamp of the mouse up event.
+ * @param[in] data The data for canvas.
+ */
+EAPI void             evas_event_feed_mouse_up(Evas *obj, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
+
+/**
+ * @brief Mouse down event feed.
+ *
+ * This function will set some evas properties that is necessary when the mouse
+ * button is pressed. It prepares information to be treated by the callback
+ * function.
+ *
+ * @param[in] flags Evas button flags.
+ * @param[in] timestamp The timestamp of the mouse up event.
+ * @param[in] data The data for canvas.
+ */
+EAPI void             evas_event_feed_mouse_down(Evas *obj, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
+
+/**
+ * @brief Mouse wheel event feed.
+ *
+ * This function will set some evas properties that is necessary when the mouse
+ * wheel is scrolled up or down. It prepares information to  be treated by the
+ * callback function.
+ *
+ * @param[in] z How much mouse wheel was scrolled up or down.
+ * @param[in] timestamp The timestamp of the mouse up event.
+ * @param[in] data The data for canvas.
+ */
+EAPI void             evas_event_feed_mouse_wheel(Evas *obj, int direction, int z, unsigned int timestamp, const void *data);
+
 /**
  * @}
  */
index 9bcfe40..dca90e3 100644 (file)
@@ -503,8 +503,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
               any host system's pointing device abilities.
 
               A canvas by default begins with no mouse buttons being
-              pressed and only calls to @.event_feed_mouse_down
-              and @.event_feed_mouse_up will alter that.
+              pressed and only calls to @.event_feed can alter that.
 
               The least significant bit corresponds to the first mouse
               button (button 1) and the most significant bit corresponds
@@ -547,20 +546,6 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
             @in y: int; [[The vertical coordinate of the position.]]
          }
       }
-      event_feed_mouse_wheel {
-         [[Mouse wheel event feed.
-
-           This function will set some evas properties that is necessary
-           when the mouse wheel is scrolled up or down. It prepares
-           information to  be treated by the callback function.
-         ]]
-         params {
-            @in direction: int; [[The wheel mouse direction.]]
-            @in z: int; [[How much mouse wheel was scrolled up or down.]]
-            @in timestamp: uint; [[The timestamp of the mouse up event.]]
-            @in data: const(void)*; [[The data for canvas.]]
-         }
-      }
       key_lock_on {
          [[Enables or turns on programmatically the lock key with name
            $keyname.
@@ -661,20 +646,6 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
             @in data: const(void)*; [[The data for canvas.]]
          }
       }
-      event_feed_mouse_move {
-         [[Mouse move event feed.
-
-           This function will set some evas properties that is necessary
-           when the mouse is moved from its last position. It prepares
-           information to be treated by the callback function.
-         ]]
-         params {
-            @in x: int; [[The horizontal position of the mouse pointer.]]
-            @in y: int; [[The vertical position of the mouse pointer.]]
-            @in timestamp: uint; [[The timestamp of the mouse up event.]]
-            @in data: const(void)*; [[The data for canvas.]]
-         }
-      }
       event_feed_key_up {
          [[Key up event feed.
 
@@ -833,26 +804,6 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
       focus_out {
          [[Inform to the evas that it lost the focus.]]
       }
-      event_input_mouse_move {
-         [[Mouse move event feed from input.
-
-           Similar to the @.event_feed_mouse_move, this function will
-           inform Evas about mouse move events which were received by
-           the input system, relative to the 0,0 of the window, not to the
-           canvas 0,0. It will take care of doing any special transformation
-           like adding the framespace offset to the mouse event.
-
-           @since 1.8
-         ]]
-         params {
-            @in x: int; [[The horizontal position of the mouse pointer
-                          relative to the 0,0 of the window/surface.]]
-            @in y: int; [[The vertical position of the mouse pointer
-                          relative to the 0,0 of the window/surface.]]
-            @in timestamp: uint; [[The timestamp of the mouse move event.]]
-            @in data: const(void)*; [[The data for canvas.]]
-         }
-      }
       norender {
          [[Update the canvas internal objects but not triggering immediate
            renderization.
@@ -986,34 +937,6 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
             @in keyname: const(char)* @nonull; [[The name of the modifier to enable.]]
          }
       }
-      event_feed_mouse_up {
-         [[Mouse up event feed.
-
-           This function will set some evas properties that is necessary
-           when the mouse button is released. It prepares information to
-           be treated by the callback function.
-         ]]
-         params {
-            @in b: int; [[The button number.]]
-            @in flags: Evas.Button_Flags; [[Evas button flags.]]
-            @in timestamp: uint; [[The timestamp of the mouse up event.]]
-            @in data: const(void)*; [[The data for canvas.]]
-         }
-      }
-      event_feed_mouse_down {
-         [[Mouse down event feed.
-
-           This function will set some evas properties that is necessary
-           when the mouse button is pressed. It prepares information to
-           be treated by the callback function.
-         ]]
-         params {
-            @in b: int; [[The button number.]]
-            @in flags: Evas.Button_Flags; [[Evas button flags.]]
-            @in timestamp: uint; [[The timestamp of the mouse up event.]]
-            @in data: const(void)*; [[The data for canvas.]]
-         }
-      }
       event_refeed_event {
          [[Re feed event.
 
@@ -1480,8 +1403,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
       event_feed_mouse_cancel {
          [[Mouse cancel event feed.
 
-           This function will call @.event_feed_mouse_up when a
-           mouse cancel event happens.
+           This function will call generate a mouse up event.
          ]]
          params {
             @in timestamp: uint; [[The timestamp of the mouse up event.]]
@@ -1630,6 +1552,13 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
             @in data: const(void)*; [[Data for canvas.]]
          }
       }
+      event_feed {
+         [[Feed an input event.]]
+         legacy: null;
+         params {
+            event: const(Efl.Pointer.Event);
+         }
+      }
    }
    implements {
       Eo.Base.constructor;
index 20651aa..7fc0c8f 100644 (file)
@@ -1,6 +1,9 @@
 #include "evas_common_private.h"
 #include "evas_private.h"
 
+#define EFL_INTERNAL_UNSTABLE
+#include "interfaces/efl_common_internal.h"
+
 static Eina_List *
 _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
                                const Eina_Inlist *list, Evas_Object *stop,
@@ -1008,9 +1011,10 @@ evas_event_thaw_eval(Evas *eo_e)
      }
 }
 
-EOLIAN void
-_evas_canvas_event_feed_mouse_down(Eo *eo_e, Evas_Public_Data *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
+EAPI void
+evas_event_feed_mouse_down(Eo *eo_e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
 {
+   Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
    Eina_List *l, *copy;
    Evas_Event_Mouse_Down ev;
    Evas_Object *eo_obj;
@@ -1230,9 +1234,10 @@ _post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data)
    return post_called;
 }
 
-EOLIAN void
-_evas_canvas_event_feed_mouse_up(Eo *eo_e, Evas_Public_Data *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
+EAPI void
+evas_event_feed_mouse_up(Eo *eo_e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
 {
+   Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
    Eina_List *l, *copy;
 
    INF("ButtonEvent:up time=%u x=%d y=%d button=%d downs=%d", timestamp, e->pointer.x, e->pointer.y, b, e->pointer.downs);
@@ -1359,9 +1364,10 @@ _evas_canvas_event_feed_mouse_cancel(Eo *eo_e, Evas_Public_Data *e, unsigned int
    _evas_unwalk(e);
 }
 
-EOLIAN void
-_evas_canvas_event_feed_mouse_wheel(Eo *eo_e, Evas_Public_Data *e, int direction, int z, unsigned int timestamp, const void *data)
+EAPI void
+evas_event_feed_mouse_wheel(Eo *eo_e, int direction, int z, unsigned int timestamp, const void *data)
 {
+   Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
    Eina_List *l, *copy;
    Evas_Event_Mouse_Wheel ev;
    Evas_Object *eo_obj;
@@ -1904,15 +1910,17 @@ nogrep:
    _evas_unwalk(e);
 }
 
-EOLIAN void
-_evas_canvas_event_input_mouse_move(Eo *eo_e, Evas_Public_Data *e, int x, int y, unsigned int timestamp, const void *data)
+EAPI void
+evas_event_input_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const void *data)
 {
+   Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
    _canvas_event_feed_mouse_move_internal(eo_e, e, x - e->framespace.x, y - e->framespace.y, timestamp, data);
 }
 
-EOLIAN void
-_evas_canvas_event_feed_mouse_move(Eo *eo_e, Evas_Public_Data *e, int x, int y, unsigned int timestamp, const void *data)
+EAPI void
+evas_event_feed_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const void *data)
 {
+   Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
    _canvas_event_feed_mouse_move_internal(eo_e, e, x, y, timestamp, data);
 }
 
@@ -1984,7 +1992,6 @@ _evas_canvas_event_feed_mouse_in(Eo *eo_e, Evas_Public_Data *e, unsigned int tim
 EOLIAN void
 _evas_canvas_event_feed_mouse_out(Eo *eo_e, Evas_Public_Data *e, unsigned int timestamp, const void *data)
 {
-
    Evas_Event_Mouse_Out ev;
    int event_id = 0;
 
@@ -3025,3 +3032,10 @@ _evas_canvas_event_down_count_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
 {
    return e->pointer.downs;
 }
+
+EOLIAN void
+_evas_canvas_event_feed(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, const Efl_Pointer_Event *event)
+{
+   Efl_Pointer_Event_Data *ev = eo_data_scope_get(event, EFL_POINTER_EVENT_CLASS);
+   /* TODO */
+}