summaryrefslogtreecommitdiff
path: root/src/grail-gestures.h
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@bitmath.org>2010-08-04 16:47:43 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-08-05 22:48:38 +0200
commit697b5b5c7d2b1c46387061fcbed24cbee51d98ce (patch)
treeb8e8dbf02453f7c7dc31c691822a088123d21cd8 /src/grail-gestures.h
parent642d7ee26f347152a106d48ddad37a8059d36fb1 (diff)
Introduce tapping
Simplify some common parts of the recognizer code and add tapping to the gesture suite. Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Diffstat (limited to 'src/grail-gestures.h')
-rw-r--r--src/grail-gestures.h68
1 files changed, 28 insertions, 40 deletions
diff --git a/src/grail-gestures.h b/src/grail-gestures.h
index 70a5a98..b8f46d4 100644
--- a/src/grail-gestures.h
+++ b/src/grail-gestures.h
@@ -27,59 +27,47 @@
27 27
28#include "grail-inserter.h" 28#include "grail-inserter.h"
29 29
30struct filter_model {
31 float delta, val, orig, fuzz, bar;
32 int tickle, active;
33};
34
30struct move_model { 35struct move_model {
31 float xfuzz, yfuzz, rfuzz, afuzz; 36 struct filter_model x, y, r, a;
32 float xbar, ybar, rbar, abar; 37 int motion, nactive, ntouch;
33 float x, y, r, a; 38 float dx, dy, dr, da;
34 int ntouch; 39 grail_time_t time;
35}; 40};
36 41
37void gru_init_motion(struct grail *ge, 42void gru_init_motion(struct grail *ge,
38 const struct touch_dev_caps *caps); 43 const struct touch_dev_caps *caps);
39void gru_reset_motion(struct grail *ge, 44void gru_motion(struct grail *ge,
40 const struct touch_frame *frame); 45 const struct touch_frame *frame);
41void gru_compute_motion(struct grail *ge, 46void gru_event(struct grail *ge, int gid,
42 const struct touch_frame *frame); 47 const struct move_model *move,
43 48 const grail_prop_t *prop, int nprop);
44struct scroll_model {
45 float x, y;
46 int active, moving, geslot;
47};
48
49void gru_reset_scroll(struct grail *ge,
50 const struct touch_frame *frame);
51int gru_scroll(struct grail *ge,
52 const struct touch_frame *frame);
53
54struct zoom_model {
55 float r;
56 int active, zooming, geslot;
57};
58 49
59void gru_reset_zoom(struct grail *ge, 50struct combo_model {
60 const struct touch_frame *frame); 51 int active, gid;
61int gru_zoom(struct grail *ge,
62 const struct touch_frame *frame);
63
64struct rotate_model {
65 float a;
66 int active, rotating, geslot;
67}; 52};
68 53
69void gru_reset_rotate(struct grail *ge, 54int gru_pan(struct grail *ge,
70 const struct touch_frame *frame); 55 const struct touch_frame *frame);
56int gru_pinch(struct grail *ge,
57 const struct touch_frame *frame);
71int gru_rotate(struct grail *ge, 58int gru_rotate(struct grail *ge,
72 const struct touch_frame *frame); 59 const struct touch_frame *frame);
60int gru_combo(struct grail *ge,
61 const struct touch_frame *frame);
73 62
74struct combo_model { 63struct tapping_model {
75 float x, y, r, a; 64 grail_time_t start;
76 int active, running, geslot; 65 int status, ntouch;
66 int active, gid;
77}; 67};
78 68
79void gru_reset_combo(struct grail *ge, 69int gru_tapping(struct grail *ge,
80 const struct touch_frame *frame); 70 const struct touch_frame *frame);
81int gru_combo(struct grail *ge,
82 const struct touch_frame *frame);
83 71
84#endif 72#endif
85 73