diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-08-11 15:30:42 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-08-11 17:59:29 +0100 |
| commit | 477f338c8de5e20d82e7c861bba742bc4c203a42 (patch) | |
| tree | bb5c35fb7acc742f06e5f03bb4702e3e3cfa6e45 /src/grail-gestures.h | |
| parent | 7ce1ea3d30d2827310b04ef316c242b7dbf7f9dd (diff) | |
Add environment and meta gestures
With meta gestures, the gesture starts given a certain number of
fingers, but can then continue even if the number of fingers change.
By configuration, such gestures live on a different priority plane
from normal gestures. To match window manager specs, this patch adds
the environment and meta planes, and add drag, pinch and rotate gestures
initiated with three and four fingers, respectively.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/grail-gestures.h')
| -rw-r--r-- | src/grail-gestures.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/grail-gestures.h b/src/grail-gestures.h index 888a50b..e716757 100644 --- a/src/grail-gestures.h +++ b/src/grail-gestures.h | |||
| @@ -27,7 +27,9 @@ | |||
| 27 | 27 | ||
| 28 | #define PRIO_POINTER 1 | 28 | #define PRIO_POINTER 1 |
| 29 | #define PRIO_GESTURE 2 | 29 | #define PRIO_GESTURE 2 |
| 30 | #define PRIO_TAP 3 | 30 | #define PRIO_ENV 3 |
| 31 | #define PRIO_META 4 | ||
| 32 | #define PRIO_TAP 5 | ||
| 31 | 33 | ||
| 32 | #define DIM_FM 4 | 34 | #define DIM_FM 4 |
| 33 | 35 | ||
| @@ -69,6 +71,7 @@ void gru_end(struct grail *ge, int gid, | |||
| 69 | 71 | ||
| 70 | struct combo_model { | 72 | struct combo_model { |
| 71 | int active, gid; | 73 | int active, gid; |
| 74 | int mintouch, maxtouch; | ||
| 72 | int nprop; | 75 | int nprop; |
| 73 | grail_prop_t prop[DIM_GRAIL_PROP]; | 76 | grail_prop_t prop[DIM_GRAIL_PROP]; |
| 74 | }; | 77 | }; |
| @@ -79,8 +82,19 @@ int gru_pinch(struct grail *ge, | |||
| 79 | const struct touch_frame *frame); | 82 | const struct touch_frame *frame); |
| 80 | int gru_rotate(struct grail *ge, | 83 | int gru_rotate(struct grail *ge, |
| 81 | const struct touch_frame *frame); | 84 | const struct touch_frame *frame); |
| 82 | int gru_combo(struct grail *ge, | 85 | |
| 83 | const struct touch_frame *frame); | 86 | static inline int out_of_bounds(const struct combo_model *s, |
| 87 | const struct move_model *m) | ||
| 88 | { | ||
| 89 | return m->ntouch < s->mintouch || m->ntouch > s->maxtouch; | ||
| 90 | } | ||
| 91 | |||
| 92 | int gru_windrag(struct grail *ge, | ||
| 93 | const struct touch_frame *frame); | ||
| 94 | int gru_winpinch(struct grail *ge, | ||
| 95 | const struct touch_frame *frame); | ||
| 96 | int gru_winrotate(struct grail *ge, | ||
| 97 | const struct touch_frame *frame); | ||
| 84 | 98 | ||
| 85 | struct tapping_model { | 99 | struct tapping_model { |
| 86 | grail_time_t start; | 100 | grail_time_t start; |
