diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2011-01-02 11:00:52 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2011-01-02 12:39:07 +0100 |
| commit | c0666a895e7fe8e488332263fd106ced0ed7cab7 (patch) | |
| tree | fca88fbee4aaed6e1eed050a749ce6246a7f1966 /include/grail-touch.h | |
| parent | 1e07054fbeab6e90f104c279d3246097dd838a17 (diff) | |
Replace touch logic with utouch frame engine
The original grail uses an internal touch framework and exports some
touch information as extended attributes to gesture events. This was
never quite the intention, but rather to expose gestures and touches
on a similar footing, such that grail can be input agnostic. This
patch starts off by replacing the internal touch framework with the
utouch-frame engine.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'include/grail-touch.h')
| -rw-r--r-- | include/grail-touch.h | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/include/grail-touch.h b/include/grail-touch.h deleted file mode 100644 index 9c63c80..0000000 --- a/include/grail-touch.h +++ /dev/null | |||
| @@ -1,85 +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 | #ifndef _GRAIL_TOUCH_H | ||
| 24 | #define _GRAIL_TOUCH_H | ||
| 25 | |||
| 26 | #include <grail-bits.h> | ||
| 27 | #include <mtdev.h> | ||
| 28 | |||
| 29 | #define DIM_TOUCH 32 | ||
| 30 | #define DIM_TOUCH_BYTES ((DIM_TOUCH + 7) >> 3) | ||
| 31 | |||
| 32 | typedef __u64 touch_time_t; | ||
| 33 | |||
| 34 | struct touch { | ||
| 35 | int active; | ||
| 36 | int slot; | ||
| 37 | int id; | ||
| 38 | int tool_type; | ||
| 39 | int x, y; | ||
| 40 | int touch_major; | ||
| 41 | int touch_minor; | ||
| 42 | int width_major; | ||
| 43 | int width_minor; | ||
| 44 | int orientation; | ||
| 45 | int pressure; | ||
| 46 | }; | ||
| 47 | |||
| 48 | struct touch_frame { | ||
| 49 | int nactive; | ||
| 50 | int ncreate, nmodify, ndestroy; | ||
| 51 | touch_time_t time; | ||
| 52 | grail_mask_t touches[DIM_TOUCH_BYTES]; | ||
| 53 | struct touch *active[DIM_TOUCH]; | ||
| 54 | struct touch touch[DIM_TOUCH]; | ||
| 55 | }; | ||
| 56 | |||
| 57 | struct touch_caps { | ||
| 58 | float min_x, max_x; | ||
| 59 | float min_y, max_y; | ||
| 60 | float min_orient, max_orient; | ||
| 61 | float min_press, max_press; | ||
| 62 | }; | ||
| 63 | |||
| 64 | struct touch_dev { | ||
| 65 | void (*event)(struct touch_dev *dev, const struct input_event *ev); | ||
| 66 | void (*sync)(struct touch_dev *dev, const struct input_event *syn); | ||
| 67 | void *priv; | ||
| 68 | struct mtdev mtdev; | ||
| 69 | struct touch_frame frame; | ||
| 70 | struct touch_caps caps; | ||
| 71 | int slot; | ||
| 72 | int state; | ||
| 73 | }; | ||
| 74 | |||
| 75 | int touch_caps_is_supported(struct touch_dev *dev, int fd); | ||
| 76 | void touch_caps_init(struct touch_dev *dev); | ||
| 77 | float touch_angle(const struct touch_dev *dev, int orientation); | ||
| 78 | float touch_pressure(const struct touch_dev *dev, int pressure); | ||
| 79 | |||
| 80 | int touch_dev_open(struct touch_dev *dev, int fd); | ||
| 81 | int touch_dev_idle(struct touch_dev *dev, int fd, int ms); | ||
| 82 | int touch_dev_pull(struct touch_dev *dev, int fd); | ||
| 83 | void touch_dev_close(struct touch_dev *dev, int fd); | ||
| 84 | |||
| 85 | #endif | ||
