summaryrefslogtreecommitdiff
path: root/src/grail-impl.h
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-04-28 18:42:33 +0200
committerHenrik Rydberg <rydberg@euromail.se>2011-04-28 18:42:33 +0200
commit5423ccd321c1c84b0e7736b10b2fe9eeb1833e16 (patch)
treefc12f236a865dceb6008d9bc5691b0fd0cbe582b /src/grail-impl.h
parentd87cde46e25c058ffc76d3871ca4e2ceb3e57991 (diff)
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 <rydberg@euromail.se>
Diffstat (limited to 'src/grail-impl.h')
-rw-r--r--src/grail-impl.h38
1 files changed, 38 insertions, 0 deletions
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 @@
33 33
34#define DIM_TOUCH 32 34#define DIM_TOUCH 32
35#define DIM_TOUCH_BYTES ((DIM_TOUCH + 7) >> 3) 35#define DIM_TOUCH_BYTES ((DIM_TOUCH + 7) >> 3)
36#define GRAIL_ID_MAX 0xffff
37
38#define MIN(a, b) ((a) < (b) ? (a) : (b))
39#define MAX(a, b) ((a) > (b) ? (a) : (b))
40
41typedef void *grail_select_callback;
42
43/*
44 * In this implementation, there can be N one-gestures, N (N - 1) / 2
45 * two-gestures, and one global gesture.
46 */
47static inline int get_slot_count(int n)
48{
49 return n + n * (n - 1) / 2 + 1;
50}
51
52int create_grail2(struct grail_impl *x,
53 utouch_frame_handle fh,
54 unsigned int num_frames,
55 void *select,
56 unsigned int version,
57 unsigned int control_size,
58 unsigned int frame_size,
59 unsigned int slot_size);
60
61void destroy_grail2(struct grail_impl *x);
36 62
37struct grail_impl { 63struct grail_impl {
38 struct evemu_device *evemu; 64 struct evemu_device *evemu;
@@ -45,6 +71,18 @@ struct grail_impl {
45 int ongoing; 71 int ongoing;
46 int gesture; 72 int gesture;
47 FILE *fptest; 73 FILE *fptest;
74 /* new stuff below */
75 struct grail_control *ctl;
76 grail_select_callback select;
77 int num_frames;
78 int num_slots;
79 int num_touches;
80 int nextframe;
81 int seqid;
82 unsigned int control_size;
83 unsigned int frame_size;
84 unsigned int slot_size;
85 struct grail_frame **frames;
48}; 86};
49 87
50#endif 88#endif