forked from OpenXT/input
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgesture.h
95 lines (83 loc) · 1.84 KB
/
gesture.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Copyright (c) 2012 Citrix Systems, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GESTURE_H
#define GESTURE_H
typedef enum gesture_position
{
eNa_p,
eGiven_p1,
eGiven_p2,
eAbsPosition,
eLeft,
eRight,
eTop,
eBottom,
eTop_Left,
eTop_Right,
eBottom_Left,
eBottom_Right
} gesture_position;
enum action_type
{
eEnd,
eContact,
eRelease,
eMove,
};
typedef enum post_movement
{
eNa_m,
eDontMove,
eMoveAnywhere,
eMoveLeft,
eMoveRight,
eMoveUp,
eMoveDown,
eMoveLeftDown,
eMoveRightDown,
eMoveLeftUp,
eMoveRighUp,
eGiven_m1,
eGiven_m2,
} post_movement;
struct smallaction_slot
{
enum action_type action;
int finger;
enum gesture_position pos;
int timel;
enum post_movement pmove;
};
struct smallaction_list
{
struct smallaction_slot *actions;
gesture_position p1;
gesture_position p2;
post_movement m1;
post_movement m2;
int timelimit;
};
typedef struct gesture
{
struct smallaction_list *actionlist;
void (*callback) (void);
int act;
int sub_act;
char name[10];
} gesture;
#endif