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-rotate.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/gestures-rotate.c') diff --git a/src/gestures-rotate.c b/src/gestures-rotate.c index 90f9bdf..6c496d2 100644 --- a/src/gestures-rotate.c +++ b/src/gestures-rotate.c @@ -26,6 +26,15 @@ #include #include +static const int getype[DIM_TOUCH + 1] = { + 0, + 0, + GRAIL_TYPE_ROTATE, + GRAIL_TYPE_TURN, + GRAIL_TYPE_WHIRL, + GRAIL_TYPE_REVOLVE, +}; + int gru_rotate(struct grail *ge, const struct touch_frame *frame) { @@ -43,8 +52,7 @@ int gru_rotate(struct grail *ge, if (!move->a.tickle) return 0; if (!state->active) { - int type = move->ntouch == 2 ? GRAIL_TYPE_ROTATE : - move->ntouch == 3 ? GRAIL_TYPE_TURN : 0; + int type = getype[move->ntouch]; if (!type) return 0; state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); -- cgit v1.2.3