diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-08-10 11:47:00 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-08-10 15:04:18 +0100 |
| commit | 7be96df1c903c11711336c5ad1859b347ae4b661 (patch) | |
| tree | a5420af7613448c12e34ade0945b687ea9879836 /src/gestures-combo.c | |
| parent | fff2c89c1651f0c5aef75510f915a999700c31b9 (diff) | |
api: Rename gestures to conform to design docs
Use the names drag, pinch and rotate, and remove the combo gesture.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/gestures-combo.c')
| -rw-r--r-- | src/gestures-combo.c | 70 |
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 | |||
| 27 | static 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 | |||
| 36 | static const int fm_mask = 0x0f; | ||
| 37 | |||
| 38 | int 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 | } | ||
