4 #include <tizen-extension-server-protocol.h>
8 #define GTERR(msg, ARG...) ERR("[tizen_gesture][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
9 #define GTWRN(msg, ARG...) WRN("[tizen_gesture][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
10 #define GTINF(msg, ARG...) INF("[tizen_gesture][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
11 #define GTDBG(msg, ARG...) DBG("[tizen_gesture][%s:%d] "msg, __FUNCTION__, __LINE__, ##ARG)
13 #define E_GESTURE_FINGER_MAX 3
14 #define E_GESTURE_TYPE_MAX TIZEN_GESTURE_TYPE_SWIPE+1
15 #define E_GESTURE_TYPE_ALL TIZEN_GESTURE_TYPE_SWIPE
17 /* FIX ME: Set values in contiguration file, do not use definition */
18 #define E_GESTURE_SWIPE_DONE_TIME 0.5
19 #define E_GESTURE_SWIPE_START_TIME 0.01
20 #define E_GESTURE_SWIPE_START_AREA 50
21 #define E_GESTURE_SWIPE_DIFF_FAIL 100
22 #define E_GESTURE_SWIPE_DIFF_SUCCESS 300
23 #define E_GESTURE_SWIPE_COMBINE_KEY 124
25 #define ABS(x) ((x)>0)?(x):-(x)
27 typedef struct _E_Gesture E_Gesture;
28 typedef struct _E_Gesture* E_GesturePtr;
29 typedef struct _E_Gesture_Event E_Gesture_Event;
30 typedef struct _E_Gesture_Event_Swipe E_Gesture_Event_Swipe;
31 typedef struct _E_Gesture_Event_Swipe_Finger E_Gesture_Event_Swipe_Finger;
32 typedef struct _E_Gesture_Event_Swipe_Finger_Direction E_Gesture_Event_Swipe_Finger_Direction;
33 typedef struct _E_Gesture_Grabbed_Client E_Gesture_Grabbed_Client;
35 typedef struct _Coords Coords;
37 typedef enum _E_Gesture_Direction E_Gesture_Direction;
39 extern E_GesturePtr gesture;
41 #define E_GESTURE_DIRECTION_MAX 4
42 enum _E_Gesture_Direction
44 E_GESTURE_DIRECTION_NONE,
45 E_GESTURE_DIRECTION_DOWN, //Start point is North
46 E_GESTURE_DIRECTION_LEFT, // Start point is East
47 E_GESTURE_DIRECTION_UP, // Start point is South
48 E_GESTURE_DIRECTION_RIGHT // Start point is West
56 struct _E_Gesture_Event_Swipe_Finger_Direction
58 struct wl_client *client;
59 struct wl_resource *res;
62 struct _E_Gesture_Event_Swipe_Finger
66 E_Gesture_Event_Swipe_Finger_Direction direction[E_GESTURE_DIRECTION_MAX+1];
69 struct _E_Gesture_Grabbed_Client
71 struct wl_client *client;
72 struct wl_listener *destroy_listener;
74 E_Gesture_Event_Swipe_Finger swipe_fingers[E_GESTURE_FINGER_MAX+1];
78 struct _E_Gesture_Event_Swipe
80 E_Gesture_Event_Swipe_Finger fingers[E_GESTURE_FINGER_MAX+1];
82 E_Gesture_Direction direction;
84 unsigned int combined_keycode;
86 unsigned int enabled_finger;
87 Ecore_Timer *start_timer;
88 Ecore_Timer *done_timer;
91 struct _E_Gesture_Event
93 E_Gesture_Event_Swipe swipes;
96 Eina_Bool recognized_gesture;
101 struct wl_global *global;
103 Ecore_Event_Filter *ef_handler;
105 Eina_List *grab_client_list;
107 Eina_List *touch_devices;
109 unsigned int grabbed_gesture;
110 E_Gesture_Event gesture_events;
112 unsigned int gesture_filter;
113 unsigned int gesture_recognized;
117 E_API extern E_Module_Api e_modapi;
118 E_API void *e_modapi_init(E_Module *m);
119 E_API int e_modapi_shutdown(E_Module *m);
120 E_API int e_modapi_save(E_Module *m);
122 Eina_Bool e_gesture_process_events(void *event, int type);
123 int e_gesture_type_convert(uint32_t type);