evas/gesture: Added Eo classes for evas gesture framework.
authorsmohanty <smohantty@gmail.com>
Tue, 19 Sep 2017 06:03:42 +0000 (15:03 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 19 Oct 2017 01:33:12 +0000 (10:33 +0900)
src/Makefile_Evas.am
src/lib/evas/Evas_Eo.h
src/lib/evas/gesture/efl_gesture.eo [new file with mode: 0644]
src/lib/evas/gesture/efl_gesture_manager.eo [new file with mode: 0644]
src/lib/evas/gesture/efl_gesture_recognizer.eo [new file with mode: 0644]
src/lib/evas/gesture/efl_gesture_recognizer_tap.eo [new file with mode: 0644]
src/lib/evas/gesture/efl_gesture_tap.eo [new file with mode: 0644]
src/lib/evas/gesture/efl_gesture_touch.eo [new file with mode: 0644]
src/lib/evas/gesture/efl_gesture_types.eot [new file with mode: 0644]

index 6393381..ed7d1ac 100644 (file)
@@ -60,6 +60,11 @@ evas_eolian_pub_files = \
        lib/evas/canvas/efl_animation_object_group.eo \
        lib/evas/canvas/efl_animation_object_group_parallel.eo \
        lib/evas/canvas/efl_animation_object_group_sequential.eo \
+       lib/evas/gesture/efl_gesture_touch.eo \
+       lib/evas/gesture/efl_gesture.eo \
+       lib/evas/gesture/efl_gesture_tap.eo \
+       lib/evas/gesture/efl_gesture_recognizer.eo \
+       lib/evas/gesture/efl_gesture_manager.eo \
        $(NULL)
 
 evas_eolian_legacy_files = \
@@ -73,11 +78,15 @@ evas_eolian_legacy_files = \
        $(NULL)
 
 evas_eolian_priv_files = \
-       lib/evas/include/evas_ector_buffer.eo
+       lib/evas/include/evas_ector_buffer.eo \
+       lib/evas/gesture/efl_gesture_recognizer_tap.eo
+
 
 evas_eolian_type_files = \
     lib/evas/canvas/evas_canvas3d_types.eot \
     lib/evas/canvas/efl_animation_types.eot
+    lib/evas/gesture/efl_gesture_types.eot
+
 
 evas_eolian_priv_c = $(evas_eolian_priv_files:%.eo=%.eo.c)
 evas_eolian_priv_h = $(evas_eolian_priv_files:%.eo=%.eo.h) \
@@ -454,6 +463,7 @@ lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
 -I$(top_srcdir)/src/static_libs/draw \
 -I$(top_builddir)/src/lib \
 -I$(top_builddir)/src/lib/evas/canvas \
+-I$(top_builddir)/src/lib/evas/gesture \
 -I$(top_builddir)/src/lib/evas/include \
 -I$(top_builddir)/src/modules/evas/engines/software_generic \
 -I$(top_builddir)/src/modules/evas/engines/gl_generic \
index 44b9fcd..a2d6d6e 100644 (file)
@@ -327,3 +327,12 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x,
 #include "canvas/efl_input_interface.eo.h"
 #include "canvas/efl_input_focus.eo.h"
 #endif /* EFL_EO_API_SUPPORT */
+
+#ifdef EFL_EO_API_SUPPORT
+# include "gesture/efl_gesture_types.eot.h"
+# include "gesture/efl_gesture_touch.eo.h"
+# include "gesture/efl_gesture.eo.h"
+# include "gesture/efl_gesture_tap.eo.h"
+# include "gesture/efl_gesture_recognizer.eo.h"
+# include "gesture/efl_gesture_manager.eo.h"
+#endif /* EFL_EO_API_SUPPORT */
diff --git a/src/lib/evas/gesture/efl_gesture.eo b/src/lib/evas/gesture/efl_gesture.eo
new file mode 100644 (file)
index 0000000..2fb73c6
--- /dev/null
@@ -0,0 +1,35 @@
+import efl_gesture_types;
+
+abstract Efl.Gesture(Efl.Object)
+{
+   methods {
+      @property type {
+         [[This property holds the type of the gesture.]]
+         get {
+         }
+         values {
+            type: ptr(const(Efl.Event.Description)); [[gesture type]]
+         }
+      }
+      @property state {
+         [[This property holds the current state of the gesture.]]
+         get {
+         }
+         set {
+         }
+         values {
+            state: Efl.Gesture.State; [[gesture state]]
+         }
+      }
+      @property hotspot {
+         [[This property holds the hotspot of the current gesture.]]
+         get {
+         }
+         set {
+         }
+         values {
+            hotspot: Eina.Vector2;[[hotspot co-ordinate]]
+         }
+      }
+   }
+}
\ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture_manager.eo b/src/lib/evas/gesture/efl_gesture_manager.eo
new file mode 100644 (file)
index 0000000..2292480
--- /dev/null
@@ -0,0 +1,39 @@
+import efl_gesture_types;
+
+class Efl.Gesture.Manager(Efl.Object)
+{
+   methods {
+      recognizer_register {
+         [[This function is called to register a new Efl.Gesture.Recognizer]]
+
+         params {
+            @in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]]
+         }
+         return: ptr(const(Efl.Event.Description)); [[Returns the Efl.Event.Description type the recognizer supports]]
+      }
+      recognizer_unregister {
+         [[This function is called to unregister a Efl.Gesture.Recognizer ]]
+
+         params {
+            @in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]]
+         }
+      }
+      @property config{
+         [[This property holds the config value for the recognizer]]
+         set {
+         }
+         get {
+         }
+         keys {
+            name: string; [[propery name]]
+         }
+         values {
+            value: ptr(any_value); [[value of the property]]
+         }
+      }
+   }
+   implements {
+      Efl.Object.constructor;
+      Efl.Object.destructor;
+   }
+}
\ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer.eo b/src/lib/evas/gesture/efl_gesture_recognizer.eo
new file mode 100644 (file)
index 0000000..f1e340e
--- /dev/null
@@ -0,0 +1,44 @@
+import efl_gesture_types;
+
+abstract Efl.Gesture.Recognizer(Efl.Object)
+{
+   methods {
+      create @pure_virtual{
+         [[This function is called to create a new Efl.Gesture object for the given target]]
+
+         params {
+            @in target: Efl.Object; [[The target widget]]
+         }
+         return: Efl.Gesture; [[Returns the Efl.Gesture event object]]
+      }
+      recognize @pure_virtual{
+         [[Handles the given event for the watched object, updating the state of the gesture object as required, and returns a suitable result for the current recognition step.]]
+
+         params {
+            @in gesture: Efl.Gesture; [[The gesture object]]
+            @in watched: Efl.Object; [[The watched object]]
+            @in event: Efl.Gesture.Touch; [[The pointer event]]
+
+         }
+         return: Efl.Gesture.Recognizer.Result; [[Returns the Efl.Gesture event object]]
+      }
+      reset {
+         [[This function is called by the framework to reset a given gesture.]]
+
+         params {
+            @in gesture: Efl.Gesture; [[The gesture object]]
+         }
+      }
+      @property config{
+         [[This property holds the config value for the recognizer]]
+         get {
+         }
+         keys {
+            name: string; [[propery name]]
+         }
+         values {
+            value: ptr(any_value); [[value of the property]]
+         }
+      }
+   }
+}
\ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo b/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo
new file mode 100644 (file)
index 0000000..509b91d
--- /dev/null
@@ -0,0 +1,10 @@
+class Efl.Gesture.Recognizer.Tap(Efl.Gesture.Recognizer)
+{
+   implements {
+      Efl.Object.constructor;
+      Efl.Object.destructor;
+      Efl.Gesture.Recognizer.create;
+      Efl.Gesture.Recognizer.recognize;
+      Efl.Gesture.Recognizer.reset;
+   }
+}
\ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture_tap.eo b/src/lib/evas/gesture/efl_gesture_tap.eo
new file mode 100644 (file)
index 0000000..6cbfd02
--- /dev/null
@@ -0,0 +1,25 @@
+import efl_gesture_types;
+
+class Efl.Gesture.Tap(Efl.Gesture)
+{
+   methods {
+      @property position {
+         [[This property holds the type of the gesture.]]
+         set {
+         }
+         get {
+         }
+         values {
+            pos: Eina.Vector2;[[position of the mouse event]]
+         }
+      }
+   }
+   event_prefix: efl;
+   events {
+      gesture,tap; [[Event for tap gesture]]
+   }
+
+   implements {
+      Efl.Object.constructor;
+   }
+}
\ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture_touch.eo b/src/lib/evas/gesture/efl_gesture_touch.eo
new file mode 100644 (file)
index 0000000..9df3ed9
--- /dev/null
@@ -0,0 +1,61 @@
+import efl_gesture_types;
+import efl_input_types;
+
+class Efl.Gesture.Touch(Efl.Object)
+{
+   methods {
+      point_record {
+         params {
+            @in tool       : int; [[The finger id ]]
+            @in x          : double; [[The x co-ordinate of the event]]
+            @in y          : double; [[The y co-ordinate of the event]]
+            @in timestamp  : double; [[The timestamp of the event]]
+            @in action     : Efl.Pointer.Action; [[action of the event]]
+         }
+      }
+      delta {
+         params {
+            @in tool        : int; [[The finger id ]]
+            @out x          : double; [[The x co-ordinate of the event]]
+            @out y          : double; [[The y co-ordinate of the event]]
+         }
+      }
+      distance {
+         params {
+            @in tool        : int; [[The finger id ]]
+            @out x          : double; [[The x co-ordinate of the event]]
+            @out y          : double; [[The y co-ordinate of the event]]
+         }
+      }
+      start_point {
+         params {
+            @out x          : double; [[The x co-ordinate of the event]]
+            @out y          : double; [[The y co-ordinate of the event]]
+         }
+      }
+      @property multi_touch {
+         [[This property tells if the event is multi touch.]]
+         get {
+            return: bool; [[returns true if its a multi touch]]
+         }
+      }
+      @property state {
+         [[This property holds the state of the touch event.]]
+         get {
+            return : Efl.Gesture.Touch.State; [[touch event state]]
+         }
+      }
+      @property finger_list {
+         get {
+            [[Get the list of finger id .]]
+         }
+         values {
+            ret: const(list<int>); [[List of finger id]]
+         }
+      }
+   }
+   implements {
+      Efl.Object.constructor;
+      Efl.Object.destructor;
+   }
+}
\ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture_types.eot b/src/lib/evas/gesture/efl_gesture_types.eot
new file mode 100644 (file)
index 0000000..5a41938
--- /dev/null
@@ -0,0 +1,33 @@
+enum Efl.Gesture.Touch.State
+{
+   [[ This enum type describes the state of a touch event. ]]
+   legacy: efl_gesture_touch;
+   unknown = 0, [[Gesture Touch State unknown]]
+   begin ,      [[First fingure touch down]]
+   update,      [[fingure touch update]]
+   end,         [[Last fingure touch up]]
+}
+
+enum Efl.Gesture.State
+{
+   [[ This enum type describes the state of a gesture. ]]
+   legacy: efl_gesture;
+   none    = 0,
+   started = 1, [[A continuous gesture has started.]]
+   updated,     [[A gesture continues.]]
+   finished,    [[A gesture has finished.]]
+   canceled,    [[A gesture was canceled.]]
+}
+
+enum Efl.Gesture.Recognizer.Result
+{
+   [[ This enum type describes the state of a gesture recognizer. ]]
+   legacy: efl_gesture;
+
+   ignore    = 0x0001, [[The event does not change the state of the recognizer.]]
+   maybe     = 0x0002, [[The event changed the internal state of the recognizer, but it isn't clear yet if it is a  gesture or not. The recognizer needs to filter more events to decide.]]
+   trigger   = 0x0004, [[The gesture has been triggered]]
+   finish    = 0x0008, [[The gesture has been finished successfully.]]
+   cancel    = 0x0010, [[The event made it clear that it is not a gesture. If the gesture recognizer was in Triggered state before, then the gesture is canceled.]]
+   result_mask = 0x00ff,
+}
\ No newline at end of file