From ee4a0c6821a1b79c3d18c6ef6d7ed6d37df74755 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Sat, 7 Aug 2010 18:28:29 +0200 Subject: gesture: Improved tickle/active logic Reorganize the mode model to use bitmasks for tickle and active, and refine the tickle logic for each gesture. --- src/gestures-rotate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gestures-rotate.c') diff --git a/src/gestures-rotate.c b/src/gestures-rotate.c index 105340b..5db4228 100644 --- a/src/gestures-rotate.c +++ b/src/gestures-rotate.c @@ -33,6 +33,8 @@ static const int getype[DIM_TOUCH + 1] = { GRAIL_TYPE_REVOLVE, }; +static const int fm_mask = 0x08; + int gru_rotate(struct grail *ge, const struct touch_frame *frame) { @@ -40,6 +42,7 @@ int gru_rotate(struct grail *ge, struct combo_model *state = &gru->rotate; 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); @@ -47,7 +50,7 @@ int gru_rotate(struct grail *ge, } return 0; } - if (!move->a.tickle) + if (!(move->tickle & mask)) return 0; if (!state->active) { int type = getype[move->ntouch]; @@ -56,9 +59,9 @@ int gru_rotate(struct grail *ge, state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame); state->active = 1; } - if (!move->a.active) + if (!(move->active & fm_mask)) return 0; - prop[0] = move->a.delta; + prop[0] = move->fm[FM_A].delta; gru_event(ge, state->gid, move, prop, 1); return 1; } -- cgit v1.2.3