From d07c43f9f19dc0ee38aaf44947cfc396f437490e Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 3 Aug 2010 15:01:50 +0200 Subject: Introduce zoom, rotate and combo gestures Introduce grail_mask bit functions, and add new gestures as separate functions, referring to the same move model. Signed-off-by: Henrik Rydberg --- src/grail-inserter.h | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'src/grail-inserter.h') diff --git a/src/grail-inserter.h b/src/grail-inserter.h index 1e02d5f..cca71d2 100644 --- a/src/grail-inserter.h +++ b/src/grail-inserter.h @@ -22,31 +22,37 @@ * ****************************************************************************/ -#ifndef _GRAIL_GESTURE_H -#define _GRAIL_GESTURE_H +#ifndef _GRAIL_INSERTER_H +#define _GRAIL_INSERTER_H #include #include #include "gebuf.h" #define DIM_EV_TYPE EV_CNT -#define DIM_EV_TYPE_BYTES (DIM_EV_TYPE >> 3) +#define DIM_EV_TYPE_BYTES ((DIM_EV_TYPE + 7) >> 3) -#define DIM_SLOT 32 -#define DIM_SLOT_BYTES (DIM_SLOT >> 3) +#define DIM_INSTANCE 32 +#define DIM_INSTANCE_BYTES ((DIM_INSTANCE + 7) >> 3) -#define DIM_CLIENT 32 +#define DIM_CLIENT 32 struct slot_state { - int type, id, status, x, y, nclient; + int type; + int priority; + int id; + int status; + int nclient; struct grail_client_id client_id[DIM_CLIENT]; - grail_mask_t span[DIM_SLOT_BYTES]; + grail_mask_t span[DIM_TOUCH_BYTES]; struct gebuf buf; }; struct gesture_inserter { - struct slot_state state[DIM_SLOT]; - grail_mask_t used[DIM_SLOT_BYTES]; + struct slot_state state[DIM_INSTANCE]; + grail_mask_t unused[DIM_INSTANCE_BYTES]; + grail_mask_t fresh[DIM_INSTANCE_BYTES]; + grail_mask_t used[DIM_INSTANCE_BYTES]; grail_time_t time; int gestureid; }; @@ -54,16 +60,18 @@ struct gesture_inserter { int gin_init(struct grail *ge); void gin_destroy(struct grail *ge); -void gin_frame_begin(struct grail *ge, grail_time_t time); -void gin_frame_end(struct grail *ge, grail_mask_t *filtered); +void gin_frame_begin(struct grail *ge, const struct touch_frame *frame); +void gin_frame_end(struct grail *ge, grail_mask_t *filtered, int max_filtered, + const struct touch_frame *frame); -int gin_gesture_begin(struct grail *ge, const struct touch_frame *frame, - int type, int x, int y, const grail_mask_t *span); -void gin_gesture_discard(struct gesture_inserter *gin, int slot); -void gin_gesture_end(struct gesture_inserter *gin, int slot); -void gin_gesture_end_all(struct gesture_inserter *gin); +int gin_gesture_begin(struct grail *ge, int type, int priority, + const grail_mask_t *span, int nspan); +void gin_gesture_end(struct gesture_inserter *gin, int geslot); +void gin_gesture_discard(struct gesture_inserter *gin, int geslot); +void gin_gesture_discard_type(struct gesture_inserter *gin, int type); -void gin_gesture_event(struct gesture_inserter *gin, int slot, - const grail_prop_t *prop); +void gin_gesture_event(struct gesture_inserter *gin, int geslot, + float x, float y, int ntouch, + const grail_prop_t *prop, int nprop); #endif -- cgit v1.2.3