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-pinch.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/gestures-pinch.c') diff --git a/src/gestures-pinch.c b/src/gestures-pinch.c index 6c5392d..0721e02 100644 --- a/src/gestures-pinch.c +++ b/src/gestures-pinch.c @@ -26,6 +26,15 @@ #include #include +static const int getype[DIM_TOUCH + 1] = { + 0, + 0, + GRAIL_TYPE_PINCH, + GRAIL_TYPE_SCALE, + GRAIL_TYPE_PICK, + GRAIL_TYPE_GRAB, +}; + int gru_pinch(struct grail *ge, const struct touch_frame *frame) { @@ -40,11 +49,12 @@ int gru_pinch(struct grail *ge, } return 0; } + if (!move->a.tickle) + return 0; if (!move->r.tickle) return 0; if (!state->active) { - int type = move->ntouch == 2 ? GRAIL_TYPE_PINCH : - move->ntouch == 3 ? GRAIL_TYPE_SCALE : 0; + int type = getype[move->ntouch]; if (!type) return 0; state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); -- cgit v1.2.3