From 5423ccd321c1c84b0e7736b10b2fe9eeb1833e16 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Thu, 28 Apr 2011 18:42:33 +0200 Subject: Introduce gesture frames This patch extends the API with parallel new/delete functions, aiming to eventually replace the open/close function. The new functions give access to the grail gesture frames, containing gestural transform information. This information is useful in its own right, and will eventually replace the internal recognizer. Signed-off-by: Henrik Rydberg --- src/grail-impl.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/grail-impl.h') diff --git a/src/grail-impl.h b/src/grail-impl.h index 8f73a2d..e9b1038 100644 --- a/src/grail-impl.h +++ b/src/grail-impl.h @@ -33,6 +33,32 @@ #define DIM_TOUCH 32 #define DIM_TOUCH_BYTES ((DIM_TOUCH + 7) >> 3) +#define GRAIL_ID_MAX 0xffff + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +typedef void *grail_select_callback; + +/* + * In this implementation, there can be N one-gestures, N (N - 1) / 2 + * two-gestures, and one global gesture. + */ +static inline int get_slot_count(int n) +{ + return n + n * (n - 1) / 2 + 1; +} + +int create_grail2(struct grail_impl *x, + utouch_frame_handle fh, + unsigned int num_frames, + void *select, + unsigned int version, + unsigned int control_size, + unsigned int frame_size, + unsigned int slot_size); + +void destroy_grail2(struct grail_impl *x); struct grail_impl { struct evemu_device *evemu; @@ -45,6 +71,18 @@ struct grail_impl { int ongoing; int gesture; FILE *fptest; + /* new stuff below */ + struct grail_control *ctl; + grail_select_callback select; + int num_frames; + int num_slots; + int num_touches; + int nextframe; + int seqid; + unsigned int control_size; + unsigned int frame_size; + unsigned int slot_size; + struct grail_frame **frames; }; #endif -- cgit v1.2.3