From 697b5b5c7d2b1c46387061fcbed24cbee51d98ce Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 4 Aug 2010 16:47:43 +0200 Subject: Introduce tapping Simplify some common parts of the recognizer code and add tapping to the gesture suite. Signed-off-by: Henrik Rydberg --- src/grail-gestures.h | 68 ++++++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 40 deletions(-) (limited to 'src/grail-gestures.h') diff --git a/src/grail-gestures.h b/src/grail-gestures.h index 70a5a98..b8f46d4 100644 --- a/src/grail-gestures.h +++ b/src/grail-gestures.h @@ -27,59 +27,47 @@ #include "grail-inserter.h" +struct filter_model { + float delta, val, orig, fuzz, bar; + int tickle, active; +}; + struct move_model { - float xfuzz, yfuzz, rfuzz, afuzz; - float xbar, ybar, rbar, abar; - float x, y, r, a; - int ntouch; + struct filter_model x, y, r, a; + int motion, nactive, ntouch; + float dx, dy, dr, da; + grail_time_t time; }; void gru_init_motion(struct grail *ge, const struct touch_dev_caps *caps); -void gru_reset_motion(struct grail *ge, - const struct touch_frame *frame); -void gru_compute_motion(struct grail *ge, - const struct touch_frame *frame); - -struct scroll_model { - float x, y; - int active, moving, geslot; -}; - -void gru_reset_scroll(struct grail *ge, - const struct touch_frame *frame); -int gru_scroll(struct grail *ge, - const struct touch_frame *frame); - -struct zoom_model { - float r; - int active, zooming, geslot; -}; +void gru_motion(struct grail *ge, + const struct touch_frame *frame); +void gru_event(struct grail *ge, int gid, + const struct move_model *move, + const grail_prop_t *prop, int nprop); -void gru_reset_zoom(struct grail *ge, - const struct touch_frame *frame); -int gru_zoom(struct grail *ge, - const struct touch_frame *frame); - -struct rotate_model { - float a; - int active, rotating, geslot; +struct combo_model { + int active, gid; }; -void gru_reset_rotate(struct grail *ge, - const struct touch_frame *frame); +int gru_pan(struct grail *ge, + const struct touch_frame *frame); +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); -struct combo_model { - float x, y, r, a; - int active, running, geslot; +struct tapping_model { + grail_time_t start; + int status, ntouch; + int active, gid; }; -void gru_reset_combo(struct grail *ge, - const struct touch_frame *frame); -int gru_combo(struct grail *ge, - const struct touch_frame *frame); +int gru_tapping(struct grail *ge, + const struct touch_frame *frame); #endif -- cgit v1.2.3