evas/gesture: Added Eo classes for evas gesture framework.

This commit is contained in:
smohanty 2017-09-19 15:03:42 +09:00 committed by Jean-Philippe Andre
parent 57aefc53c1
commit b1c6915ab4
9 changed files with 267 additions and 1 deletions

View 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 \

View 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 */

View File

@ -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]]
}
}
}
}

View File

@ -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;
}
}

View File

@ -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]]
}
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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,
}