summaryrefslogtreecommitdiff
path: root/src/gestures-tapping.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-08-19 22:15:55 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-08-19 22:15:55 +0200
commit76f51a7675801acfe8e58c6a21192668d23d3320 (patch)
tree73109e613e93fbb8f20fabdbec9f7e0d5356f4dd /src/gestures-tapping.c
parent8331322a0fec7277366a29a970eafbb795c08432 (diff)
Add contact information to the property list
Add the five first contacts to the property list, and unify the handling of all gesture types in this regard. To avoid duplication, move the scaling of properties closer to the gesture recognizer. Move all gesture event handling code to grail-event.c, simplifying the structure somewhat. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/gestures-tapping.c')
-rw-r--r--src/gestures-tapping.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gestures-tapping.c b/src/gestures-tapping.c
index 52c5fdb..371dbde 100644
--- a/src/gestures-tapping.c
+++ b/src/gestures-tapping.c
@@ -31,6 +31,17 @@ static const int TAP_MIN_GAP_MS = 25;
31 31
32static const int fm_mask = 0x03; 32static const int fm_mask = 0x03;
33 33
34static void set_props(const struct gesture_inserter *gin,
35 struct tapping_model *s, const struct move_model *m,
36 const struct touch_frame *frame)
37{
38 s->prop[GRAIL_PROP_TAP_DT] = m->time - s->start;
39 s->prop[GRAIL_PROP_TAP_X] = gin_prop_x(gin, m->fm[FM_X].value);
40 s->prop[GRAIL_PROP_TAP_Y] = gin_prop_y(gin, m->fm[FM_Y].value);
41 s->nprop = 3;
42 s->nprop += gin_add_contact_props(gin, s->prop + s->nprop, frame);
43}
44
34int gru_tapping(struct grail *ge, 45int gru_tapping(struct grail *ge,
35 const struct touch_frame *frame) 46 const struct touch_frame *frame)
36{ 47{
@@ -44,11 +55,7 @@ int gru_tapping(struct grail *ge,
44 if (!state->ntouch) 55 if (!state->ntouch)
45 state->start = move->time; 56 state->start = move->time;
46 if (move->ntouch >= state->ntouch) { 57 if (move->ntouch >= state->ntouch) {
47 state->prop[GRAIL_PROP_TAP_DT] = 58 set_props(ge->gin, state, move, frame);
48 move->time - state->start;
49 state->prop[GRAIL_PROP_TAP_X] = move->fm[FM_X].value;
50 state->prop[GRAIL_PROP_TAP_Y] = move->fm[FM_Y].value;
51 state->nprop = 3;
52 } 59 }
53 if (move->ntouch > state->ntouch) { 60 if (move->ntouch > state->ntouch) {
54 state->ntouch = move->ntouch; 61 state->ntouch = move->ntouch;