diff options
Diffstat (limited to 'src/grail-inserter.h')
| -rw-r--r-- | src/grail-inserter.h | 46 |
1 files changed, 27 insertions, 19 deletions
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 @@ | |||
| 22 | * | 22 | * |
| 23 | ****************************************************************************/ | 23 | ****************************************************************************/ |
| 24 | 24 | ||
| 25 | #ifndef _GRAIL_GESTURE_H | 25 | #ifndef _GRAIL_INSERTER_H |
| 26 | #define _GRAIL_GESTURE_H | 26 | #define _GRAIL_INSERTER_H |
| 27 | 27 | ||
| 28 | #include <grail-touch.h> | 28 | #include <grail-touch.h> |
| 29 | #include <grail.h> | 29 | #include <grail.h> |
| 30 | #include "gebuf.h" | 30 | #include "gebuf.h" |
| 31 | 31 | ||
| 32 | #define DIM_EV_TYPE EV_CNT | 32 | #define DIM_EV_TYPE EV_CNT |
| 33 | #define DIM_EV_TYPE_BYTES (DIM_EV_TYPE >> 3) | 33 | #define DIM_EV_TYPE_BYTES ((DIM_EV_TYPE + 7) >> 3) |
| 34 | 34 | ||
| 35 | #define DIM_SLOT 32 | 35 | #define DIM_INSTANCE 32 |
| 36 | #define DIM_SLOT_BYTES (DIM_SLOT >> 3) | 36 | #define DIM_INSTANCE_BYTES ((DIM_INSTANCE + 7) >> 3) |
| 37 | 37 | ||
| 38 | #define DIM_CLIENT 32 | 38 | #define DIM_CLIENT 32 |
| 39 | 39 | ||
| 40 | struct slot_state { | 40 | struct slot_state { |
| 41 | int type, id, status, x, y, nclient; | 41 | int type; |
| 42 | int priority; | ||
| 43 | int id; | ||
| 44 | int status; | ||
| 45 | int nclient; | ||
| 42 | struct grail_client_id client_id[DIM_CLIENT]; | 46 | struct grail_client_id client_id[DIM_CLIENT]; |
| 43 | grail_mask_t span[DIM_SLOT_BYTES]; | 47 | grail_mask_t span[DIM_TOUCH_BYTES]; |
| 44 | struct gebuf buf; | 48 | struct gebuf buf; |
| 45 | }; | 49 | }; |
| 46 | 50 | ||
| 47 | struct gesture_inserter { | 51 | struct gesture_inserter { |
| 48 | struct slot_state state[DIM_SLOT]; | 52 | struct slot_state state[DIM_INSTANCE]; |
| 49 | grail_mask_t used[DIM_SLOT_BYTES]; | 53 | grail_mask_t unused[DIM_INSTANCE_BYTES]; |
| 54 | grail_mask_t fresh[DIM_INSTANCE_BYTES]; | ||
| 55 | grail_mask_t used[DIM_INSTANCE_BYTES]; | ||
| 50 | grail_time_t time; | 56 | grail_time_t time; |
| 51 | int gestureid; | 57 | int gestureid; |
| 52 | }; | 58 | }; |
| @@ -54,16 +60,18 @@ struct gesture_inserter { | |||
| 54 | int gin_init(struct grail *ge); | 60 | int gin_init(struct grail *ge); |
| 55 | void gin_destroy(struct grail *ge); | 61 | void gin_destroy(struct grail *ge); |
| 56 | 62 | ||
| 57 | void gin_frame_begin(struct grail *ge, grail_time_t time); | 63 | void gin_frame_begin(struct grail *ge, const struct touch_frame *frame); |
| 58 | void gin_frame_end(struct grail *ge, grail_mask_t *filtered); | 64 | void gin_frame_end(struct grail *ge, grail_mask_t *filtered, int max_filtered, |
| 65 | const struct touch_frame *frame); | ||
| 59 | 66 | ||
| 60 | int gin_gesture_begin(struct grail *ge, const struct touch_frame *frame, | 67 | int gin_gesture_begin(struct grail *ge, int type, int priority, |
| 61 | int type, int x, int y, const grail_mask_t *span); | 68 | const grail_mask_t *span, int nspan); |
| 62 | void gin_gesture_discard(struct gesture_inserter *gin, int slot); | 69 | void gin_gesture_end(struct gesture_inserter *gin, int geslot); |
| 63 | void gin_gesture_end(struct gesture_inserter *gin, int slot); | 70 | void gin_gesture_discard(struct gesture_inserter *gin, int geslot); |
| 64 | void gin_gesture_end_all(struct gesture_inserter *gin); | 71 | void gin_gesture_discard_type(struct gesture_inserter *gin, int type); |
| 65 | 72 | ||
| 66 | void gin_gesture_event(struct gesture_inserter *gin, int slot, | 73 | void gin_gesture_event(struct gesture_inserter *gin, int geslot, |
| 67 | const grail_prop_t *prop); | 74 | float x, float y, int ntouch, |
| 75 | const grail_prop_t *prop, int nprop); | ||
| 68 | 76 | ||
| 69 | #endif | 77 | #endif |
