diff options
Diffstat (limited to 'src/gestures-pinch.c')
| -rw-r--r-- | src/gestures-pinch.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/gestures-pinch.c b/src/gestures-pinch.c index 0ddffa4..91e6504 100644 --- a/src/gestures-pinch.c +++ b/src/gestures-pinch.c | |||
| @@ -100,3 +100,44 @@ int gru_pinch(struct grail *ge, | |||
| 100 | gru_event(ge, state->gid, move, state->prop, state->nprop); | 100 | gru_event(ge, state->gid, move, state->prop, state->nprop); |
| 101 | return 1; | 101 | return 1; |
| 102 | } | 102 | } |
| 103 | |||
| 104 | int gru_winpinch(struct grail *ge, | ||
| 105 | const struct touch_frame *frame) | ||
| 106 | { | ||
| 107 | struct gesture_recognizer *gru = ge->gru; | ||
| 108 | struct combo_model *state = &gru->winpinch; | ||
| 109 | struct move_model *move = &gru->move; | ||
| 110 | int mask = state->active ? (move->active & fm_mask) : fm_mask; | ||
| 111 | if (!move->multi) { | ||
| 112 | if (state->active && out_of_bounds(state, move)) { | ||
| 113 | gru_end(ge, state->gid, move, | ||
| 114 | state->prop, state->nprop); | ||
| 115 | state->active = 0; | ||
| 116 | } | ||
| 117 | return 0; | ||
| 118 | } | ||
| 119 | if (!(move->tickle & mask)) | ||
| 120 | return 0; | ||
| 121 | if (!state->active) { | ||
| 122 | if (move->ntouch == 4) { | ||
| 123 | state->gid = gin_gid_begin(ge, GRAIL_TYPE_MPINCH, | ||
| 124 | PRIO_META, frame); | ||
| 125 | state->mintouch = 2; | ||
| 126 | state->maxtouch = 4; | ||
| 127 | state->active = 1; | ||
| 128 | } else if (move->ntouch == 3) { | ||
| 129 | state->gid = gin_gid_begin(ge, GRAIL_TYPE_EPINCH, | ||
| 130 | PRIO_ENV, frame); | ||
| 131 | state->mintouch = 2; | ||
| 132 | state->maxtouch = 3; | ||
| 133 | state->active = 1; | ||
| 134 | } else { | ||
| 135 | return 0; | ||
| 136 | } | ||
| 137 | } | ||
| 138 | if (!(move->active & fm_mask)) | ||
| 139 | return 0; | ||
| 140 | set_props(state, move, frame); | ||
| 141 | gru_event(ge, state->gid, move, state->prop, state->nprop); | ||
| 142 | return 1; | ||
| 143 | } | ||
