From d8e8d112aa907f8021ae99e6d7cd7856f1d90b70 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Thu, 5 Aug 2010 12:40:49 +0200 Subject: Add four-finger and five-finger gestures Add four-finger and five-finger gestures, and move all gesture types out to a separate file. Signed-off-by: Henrik Rydberg --- src/gestures-pan.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/gestures-pan.c') diff --git a/src/gestures-pan.c b/src/gestures-pan.c index 6c34e5d..3094007 100644 --- a/src/gestures-pan.c +++ b/src/gestures-pan.c @@ -26,6 +26,15 @@ #include #include +static const int getype[DIM_TOUCH + 1] = { + 0, + 0, + GRAIL_TYPE_PAN, + GRAIL_TYPE_SWIPE, + GRAIL_TYPE_BRUSH, + GRAIL_TYPE_HAND, +}; + int gru_pan(struct grail *ge, const struct touch_frame *frame) { @@ -43,8 +52,7 @@ int gru_pan(struct grail *ge, if (!move->x.tickle && !move->y.tickle) return 0; if (!state->active) { - int type = move->ntouch == 2 ? GRAIL_TYPE_PAN : - move->ntouch == 3 ? GRAIL_TYPE_SWIPE : 0; + int type = getype[move->ntouch]; if (!type) return 0; state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); -- cgit v1.2.3