diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 02:30:41 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 02:30:41 +0200 |
| commit | 8dff8642c43a473713d48533974d9c7883bbc5c1 (patch) | |
| tree | ea8513c76d38f2612a1202d30abf0f2e768f204c /include/hwdata.h | |
| parent | 1c73d171b2814bf2809aa48c2d4b683a064a4f7e (diff) | |
refactor: Replace hwdata by mtdev
This patch makes the switch, from using hwdata and the associated
type A parser, to using mtdev and the associated type B parser.
A command-line gesture test program is included.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'include/hwdata.h')
| -rw-r--r-- | include/hwdata.h | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/include/hwdata.h b/include/hwdata.h deleted file mode 100644 index 21864dc..0000000 --- a/include/hwdata.h +++ /dev/null | |||
| @@ -1,75 +0,0 @@ | |||
| 1 | /*************************************************************************** | ||
| 2 | * | ||
| 3 | * Multitouch X driver | ||
| 4 | * Copyright (C) 2008 Henrik Rydberg <rydberg@euromail.se> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | * | ||
| 20 | **************************************************************************/ | ||
| 21 | |||
| 22 | #ifndef HWDATA_H | ||
| 23 | #define HWDATA_H | ||
| 24 | |||
| 25 | #include "common.h" | ||
| 26 | #include "button.h" | ||
| 27 | |||
| 28 | #define BIT_MT_TOUCH_MAJOR 0 | ||
| 29 | #define BIT_MT_TOUCH_MINOR 1 | ||
| 30 | #define BIT_MT_WIDTH_MAJOR 2 | ||
| 31 | #define BIT_MT_WIDTH_MINOR 3 | ||
| 32 | #define BIT_MT_ORIENTATION 4 | ||
| 33 | #define BIT_MT_PRESSURE 5 | ||
| 34 | #define BIT_MT_POSITION_X 6 | ||
| 35 | #define BIT_MT_POSITION_Y 7 | ||
| 36 | #define BIT_MT_CNT 8 | ||
| 37 | |||
| 38 | struct FingerData { | ||
| 39 | int touch_major, touch_minor; | ||
| 40 | int width_major, width_minor; | ||
| 41 | int orientation, pressure; | ||
| 42 | int position_x, position_y; | ||
| 43 | }; | ||
| 44 | |||
| 45 | /** | ||
| 46 | * struct HWData - hardware reads | ||
| 47 | * | ||
| 48 | * @finger: finger data | ||
| 49 | * @mask: bits corresponding to data actually read (readonly) | ||
| 50 | * @mread: bits corresponding to data in progress (writeonly) | ||
| 51 | * @button: bitmask of buttons | ||
| 52 | * @nfinger: number of fingers actually read (readonly) | ||
| 53 | * @nread: number of fingers in progress (writeonly) | ||
| 54 | * | ||
| 55 | */ | ||
| 56 | struct HWData { | ||
| 57 | struct FingerData finger[DIM_FINGER]; | ||
| 58 | unsigned mask[DIM_FINGER], mread[DIM_FINGER]; | ||
| 59 | unsigned button; | ||
| 60 | int nfinger, mtread, nread; | ||
| 61 | mstime_t evtime; | ||
| 62 | }; | ||
| 63 | |||
| 64 | void init_hwdata(struct HWData *hw); | ||
| 65 | int read_hwdata(struct HWData *hw, const struct input_event* ev); | ||
| 66 | void output_hwdata(const struct HWData *hw); | ||
| 67 | |||
| 68 | static inline int finger_dist2(const struct FingerData *a, | ||
| 69 | const struct FingerData *b) | ||
| 70 | { | ||
| 71 | return dist2(a->position_x - b->position_x, | ||
| 72 | a->position_y - b->position_y); | ||
| 73 | } | ||
| 74 | |||
| 75 | #endif | ||
