diff options
Diffstat (limited to 'src/grail-impl.h')
| -rw-r--r-- | src/grail-impl.h | 38 |
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 | |||
| 41 | typedef 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 | */ | ||
| 47 | static inline int get_slot_count(int n) | ||
| 48 | { | ||
| 49 | return n + n * (n - 1) / 2 + 1; | ||
| 50 | } | ||
| 51 | |||
| 52 | int 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 | |||
| 61 | void destroy_grail2(struct grail_impl *x); | ||
| 36 | 62 | ||
| 37 | struct grail_impl { | 63 | struct 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 |
