From 477f338c8de5e20d82e7c861bba742bc4c203a42 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 11 Aug 2010 15:30:42 +0100 Subject: 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 --- src/grail-gestures.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/grail-gestures.h') 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 @@ #define PRIO_POINTER 1 #define PRIO_GESTURE 2 -#define PRIO_TAP 3 +#define PRIO_ENV 3 +#define PRIO_META 4 +#define PRIO_TAP 5 #define DIM_FM 4 @@ -69,6 +71,7 @@ void gru_end(struct grail *ge, int gid, struct combo_model { int active, gid; + int mintouch, maxtouch; int nprop; grail_prop_t prop[DIM_GRAIL_PROP]; }; @@ -79,8 +82,19 @@ int gru_pinch(struct grail *ge, const struct touch_frame *frame); int gru_rotate(struct grail *ge, const struct touch_frame *frame); -int gru_combo(struct grail *ge, - const struct touch_frame *frame); + +static inline int out_of_bounds(const struct combo_model *s, + const struct move_model *m) +{ + return m->ntouch < s->mintouch || m->ntouch > s->maxtouch; +} + +int gru_windrag(struct grail *ge, + const struct touch_frame *frame); +int gru_winpinch(struct grail *ge, + const struct touch_frame *frame); +int gru_winrotate(struct grail *ge, + const struct touch_frame *frame); struct tapping_model { grail_time_t start; -- cgit v1.2.3