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 --- include/grail-touch.h | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'include/grail-touch.h') diff --git a/include/grail-touch.h b/include/grail-touch.h index e07ffca..5bf0034 100644 --- a/include/grail-touch.h +++ b/include/grail-touch.h @@ -25,12 +25,13 @@ #ifndef _GRAIL_TOUCH_H #define _GRAIL_TOUCH_H +#include #include -#define DIM_TOUCHES 32 +#define DIM_TOUCH 32 +#define DIM_TOUCH_BYTES ((DIM_TOUCH + 7) >> 3) typedef int touch_prop_t; -typedef unsigned touch_prop_mask_t; typedef __u64 touch_time_t; enum touch_prop_list { @@ -45,29 +46,37 @@ enum touch_prop_list { DIM_TOUCH_PROP }; +#define DIM_TOUCH_PROP_BYTES ((DIM_TOUCH_PROP + 7) >> 3) + struct touch { int active; int slot; - int next; touch_prop_t prop[DIM_TOUCH_PROP]; }; struct touch_frame { - int ntouch; - int slot; + int nactive; int ncreate, nmodify, ndestroy; touch_time_t time; - struct touch touch[DIM_TOUCHES]; + grail_mask_t touches[DIM_TOUCH_BYTES]; + struct touch *active[DIM_TOUCH]; + struct touch touch[DIM_TOUCH]; +}; + +struct touch_dev_caps { + grail_mask_t mask[DIM_TOUCH_PROP_BYTES]; + struct input_absinfo info[DIM_TOUCH_PROP]; }; struct touch_dev { void (*event)(struct touch_dev *dev, const struct input_event *ev); void (*create)(struct touch_dev *dev, int slot, - const touch_prop_mask_t *mask, const touch_prop_t *prop); + const grail_mask_t *mask, const touch_prop_t *prop); void (*modify)(struct touch_dev *dev, int slot, - const touch_prop_mask_t *mask, const touch_prop_t *prop); + const grail_mask_t *mask, const touch_prop_t *prop); void (*destroy)(struct touch_dev *dev, int slot); void (*sync)(struct touch_dev *dev, const struct input_event *syn); + struct touch_dev_caps caps; struct touch_dev_impl *impl; void *priv; }; @@ -81,16 +90,6 @@ struct touch_engine { void *priv; }; -static inline int has_prop(const touch_prop_mask_t *mask, int code) -{ - return (mask[code >> 5] >> (code & 31)) & 1; -} - -static inline int next_slot(const struct touch_frame *frame, int slot) -{ - return frame->touch[slot].next; -} - int touch_dev_open(struct touch_dev *dev, int fd); int touch_dev_idle(struct touch_dev *dev, int fd, int ms); int touch_dev_fetch(struct touch_dev *dev, int fd); -- cgit v1.2.3