diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-09-21 09:49:26 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-09-21 12:56:17 +0200 |
| commit | d0f7b524153d1b54128b049841f880ee78c2c529 (patch) | |
| tree | d6a1fa1f3254f183c77b7222b17c4ac60df658f2 /src/grail-api.c | |
| parent | 0e1bf39bd34062f07358dc605c0f03fa5df08356 (diff) | |
Simplify book-keeping of active gestures
The current frame computation returns the event types to filter,
which is less useful than knowing what gesture types are active
in the frame. Add the active gesture types to the frame struct
and simplify usage.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/grail-api.c')
| -rw-r--r-- | src/grail-api.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/grail-api.c b/src/grail-api.c index d0712b3..0673120 100644 --- a/src/grail-api.c +++ b/src/grail-api.c | |||
| @@ -106,13 +106,14 @@ static void tp_sync(struct touch_dev *dev, | |||
| 106 | struct input_event ev; | 106 | struct input_event ev; |
| 107 | struct grail *ge = dev->priv; | 107 | struct grail *ge = dev->priv; |
| 108 | struct grail_impl *impl = ge->impl; | 108 | struct grail_impl *impl = ge->impl; |
| 109 | struct gesture_inserter *gin = ge->gin; | ||
| 109 | struct touch_frame *frame = &dev->frame; | 110 | struct touch_frame *frame = &dev->frame; |
| 110 | grail_mask_t filtered[DIM_EV_TYPE_BYTES]; | 111 | int pointer, used_move, nevent = 0; |
| 111 | int pointer, nevent = 0; | ||
| 112 | gin_frame_begin(ge, frame); | 112 | gin_frame_begin(ge, frame); |
| 113 | gru_recognize(ge, frame); | 113 | gru_recognize(ge, frame); |
| 114 | gin_frame_end(ge, filtered, sizeof(filtered), frame); | 114 | gin_frame_end(ge, frame); |
| 115 | pointer = pointer_active(ge) && !grail_mask_get(filtered, EV_ABS); | 115 | used_move = grail_mask_count(gin->types, sizeof(gin->types)); |
| 116 | pointer = pointer_active(ge) && !used_move; | ||
| 116 | 117 | ||
| 117 | if (!ge->event) { | 118 | if (!ge->event) { |
| 118 | evbuf_clear(&impl->evbuf); | 119 | evbuf_clear(&impl->evbuf); |
