summaryrefslogtreecommitdiff
path: root/src/hwdata.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hwdata.h')
-rw-r--r--src/hwdata.h95
1 files changed, 0 insertions, 95 deletions
diff --git a/src/hwdata.h b/src/hwdata.h
deleted file mode 100644
index 42d0a19..0000000
--- a/src/hwdata.h
+++ /dev/null
@@ -1,95 +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
27#define DIM_BUTTON 15
28
29#define MT_BUTTON_LEFT 0
30#define MT_BUTTON_MIDDLE 1
31#define MT_BUTTON_RIGHT 2
32#define MT_BUTTON_WHEEL_UP 3
33#define MT_BUTTON_WHEEL_DOWN 4
34#define MT_BUTTON_HWHEEL_LEFT 5
35#define MT_BUTTON_HWHEEL_RIGHT 6
36#define MT_BUTTON_SWIPE_UP 7
37#define MT_BUTTON_SWIPE_DOWN 8
38#define MT_BUTTON_SWIPE_LEFT 9
39#define MT_BUTTON_SWIPE_RIGHT 10
40#define MT_BUTTON_SCALE_DOWN 11
41#define MT_BUTTON_SCALE_UP 12
42#define MT_BUTTON_ROTATE_LEFT 13
43#define MT_BUTTON_ROTATE_RIGHT 14
44
45#define BIT_MT_TOUCH_MAJOR 0
46#define BIT_MT_TOUCH_MINOR 1
47#define BIT_MT_WIDTH_MAJOR 2
48#define BIT_MT_WIDTH_MINOR 3
49#define BIT_MT_ORIENTATION 4
50#define BIT_MT_PRESSURE 5
51#define BIT_MT_POSITION_X 6
52#define BIT_MT_POSITION_Y 7
53#define BIT_MT_CNT 8
54
55struct FingerData {
56 int touch_major, touch_minor;
57 int width_major, width_minor;
58 int orientation, pressure;
59 int position_x, position_y;
60};
61
62/* year-proof millisecond event time */
63typedef __u64 mstime_t;
64
65/**
66 * struct HWData - hardware reads
67 *
68 * @finger: finger data
69 * @mask: bits corresponding to data actually read (readonly)
70 * @mread: bits corresponding to data in progress (writeonly)
71 * @button: bitmask of buttons
72 * @nfinger: number of fingers actually read (readonly)
73 * @nread: number of fingers in progress (writeonly)
74 *
75 */
76struct HWData {
77 struct FingerData finger[DIM_FINGER];
78 unsigned mask[DIM_FINGER], mread[DIM_FINGER];
79 unsigned button;
80 int nfinger, mtread, nread;
81 mstime_t evtime;
82};
83
84void init_hwdata(struct HWData *hw);
85int read_hwdata(struct HWData *hw, const struct input_event* ev);
86void output_hwdata(const struct HWData *hw);
87
88static inline int finger_dist2(const struct FingerData *a,
89 const struct FingerData *b)
90{
91 return dist2(a->position_x - b->position_x,
92 a->position_y - b->position_y);
93}
94
95#endif