diff options
| author | Henrik Rydberg <rydberg@bitmath.org> | 2010-08-04 16:47:43 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-08-05 22:48:38 +0200 |
| commit | 697b5b5c7d2b1c46387061fcbed24cbee51d98ce (patch) | |
| tree | b8e8dbf02453f7c7dc31c691822a088123d21cd8 /src/grail-gestures.h | |
| parent | 642d7ee26f347152a106d48ddad37a8059d36fb1 (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.h | 68 |
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 | ||
| 30 | struct filter_model { | ||
| 31 | float delta, val, orig, fuzz, bar; | ||
| 32 | int tickle, active; | ||
| 33 | }; | ||
| 34 | |||
| 30 | struct move_model { | 35 | struct 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 | ||
| 37 | void gru_init_motion(struct grail *ge, | 42 | void gru_init_motion(struct grail *ge, |
| 38 | const struct touch_dev_caps *caps); | 43 | const struct touch_dev_caps *caps); |
| 39 | void gru_reset_motion(struct grail *ge, | 44 | void gru_motion(struct grail *ge, |
| 40 | const struct touch_frame *frame); | 45 | const struct touch_frame *frame); |
| 41 | void gru_compute_motion(struct grail *ge, | 46 | void 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); | |
| 44 | struct scroll_model { | ||
| 45 | float x, y; | ||
| 46 | int active, moving, geslot; | ||
| 47 | }; | ||
| 48 | |||
| 49 | void gru_reset_scroll(struct grail *ge, | ||
| 50 | const struct touch_frame *frame); | ||
| 51 | int gru_scroll(struct grail *ge, | ||
| 52 | const struct touch_frame *frame); | ||
| 53 | |||
| 54 | struct zoom_model { | ||
| 55 | float r; | ||
| 56 | int active, zooming, geslot; | ||
| 57 | }; | ||
| 58 | 49 | ||
| 59 | void gru_reset_zoom(struct grail *ge, | 50 | struct combo_model { |
| 60 | const struct touch_frame *frame); | 51 | int active, gid; |
| 61 | int gru_zoom(struct grail *ge, | ||
| 62 | const struct touch_frame *frame); | ||
| 63 | |||
| 64 | struct rotate_model { | ||
| 65 | float a; | ||
| 66 | int active, rotating, geslot; | ||
| 67 | }; | 52 | }; |
| 68 | 53 | ||
| 69 | void gru_reset_rotate(struct grail *ge, | 54 | int gru_pan(struct grail *ge, |
| 70 | const struct touch_frame *frame); | 55 | const struct touch_frame *frame); |
| 56 | int gru_pinch(struct grail *ge, | ||
| 57 | const struct touch_frame *frame); | ||
| 71 | int gru_rotate(struct grail *ge, | 58 | int gru_rotate(struct grail *ge, |
| 72 | const struct touch_frame *frame); | 59 | const struct touch_frame *frame); |
| 60 | int gru_combo(struct grail *ge, | ||
| 61 | const struct touch_frame *frame); | ||
| 73 | 62 | ||
| 74 | struct combo_model { | 63 | struct 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 | ||
| 79 | void gru_reset_combo(struct grail *ge, | 69 | int gru_tapping(struct grail *ge, |
| 80 | const struct touch_frame *frame); | 70 | const struct touch_frame *frame); |
| 81 | int gru_combo(struct grail *ge, | ||
| 82 | const struct touch_frame *frame); | ||
| 83 | 71 | ||
| 84 | #endif | 72 | #endif |
| 85 | 73 | ||
