From da425afd6199995ac7b6f23bf8744a435cc02e23 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 10 Aug 2010 12:45:52 +0100 Subject: Add property declarations to grail-types Also add accumulated values for delta and velocity properties. Signed-off-by: Henrik Rydberg --- src/gestures-pinch.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/gestures-pinch.c') diff --git a/src/gestures-pinch.c b/src/gestures-pinch.c index 3b94a66..18007de 100644 --- a/src/gestures-pinch.c +++ b/src/gestures-pinch.c @@ -35,17 +35,25 @@ static const int getype[DIM_TOUCH + 1] = { static const int fm_mask = 0x04; +static void set_props(struct combo_model *s, const struct move_model *m) +{ + s->prop[GRAIL_PROP_PINCH_DR] = m->fm[FM_R].action_delta; + s->prop[GRAIL_PROP_PINCH_VR] = m->fm[FM_R].velocity; + s->prop[GRAIL_PROP_PINCH_R] = m->fm[FM_R].value; + s->nprop = 3; +} + int gru_pinch(struct grail *ge, const struct touch_frame *frame) { struct gesture_recognizer *gru = ge->gru; struct combo_model *state = &gru->pinch; struct move_model *move = &gru->move; - grail_prop_t prop[DIM_GRAIL_PROP]; int mask = state->active ? (move->active & fm_mask) : fm_mask; if (!move->multi) { if (state->active) { - gru_end(ge, state->gid, move); + gru_end(ge, state->gid, move, + state->prop, state->nprop); state->active = 0; } return 0; @@ -61,7 +69,7 @@ int gru_pinch(struct grail *ge, } if (!(move->active & fm_mask)) return 0; - prop[0] = move->fm[FM_R].action_delta; - gru_event(ge, state->gid, move, prop, 1); + set_props(state, move); + gru_event(ge, state->gid, move, state->prop, state->nprop); return 1; } -- cgit v1.2.3