summaryrefslogtreecommitdiff
path: root/src/gestures-combo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gestures-combo.c')
-rw-r--r--src/gestures-combo.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/src/gestures-combo.c b/src/gestures-combo.c
deleted file mode 100644
index 5b6de5b..0000000
--- a/src/gestures-combo.c
+++ /dev/null
@@ -1,70 +0,0 @@
1/*****************************************************************************
2 *
3 * grail - Gesture Recognition And Instantiation Library
4 *
5 * Copyright (C) 2010 Canonical Ltd.
6 * Copyright (C) 2010 Henrik Rydberg <rydberg@bitmath.org>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 ****************************************************************************/
22
23#include "grail-recognizer.h"
24#include <math.h>
25#include <stdio.h>
26
27static const int getype[DIM_TOUCH + 1] = {
28 0,
29 0,
30 GRAIL_TYPE_COMBO2,
31 GRAIL_TYPE_COMBO3,
32 GRAIL_TYPE_COMBO4,
33 GRAIL_TYPE_COMBO5,
34};
35
36static const int fm_mask = 0x0f;
37
38int gru_combo(struct grail *ge,
39 const struct touch_frame *frame)
40{
41 struct gesture_recognizer *gru = ge->gru;
42 struct combo_model *state = &gru->combo;
43 struct move_model *move = &gru->move;
44 grail_prop_t prop[DIM_GRAIL_PROP];
45 int mask = state->active ? (move->active & fm_mask) : fm_mask;
46 if (!move->multi) {
47 if (state->active) {
48 gru_end(ge, state->gid, move);
49 state->active = 0;
50 }
51 return 0;
52 }
53 if (!(move->tickle & mask))
54 return 0;
55 if (!state->active) {
56 int type = getype[move->ntouch];
57 if (!type)
58 return 0;
59 state->gid = gin_gid_begin(ge, type, PRIO_GESTURE, frame);
60 state->active = 1;
61 }
62 if (!(move->active & fm_mask))
63 return 0;
64 prop[0] = move->fm[FM_X].action_delta;
65 prop[1] = move->fm[FM_Y].action_delta;
66 prop[2] = move->fm[FM_R].action_delta;
67 prop[3] = move->fm[FM_A].action_delta;
68 gru_event(ge, state->gid, move, prop, 4);
69 return 1;
70}