1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
diff -Naurp xorg-x11-drv-mtev-0.1.13-orig//src/multitouch.c xorg-x11-drv-mtev-0.1.13/src/multitouch.c
--- xorg-x11-drv-mtev-0.1.13-orig//src/multitouch.c 2012-01-04 13:05:27.603707979 +0800
+++ xorg-x11-drv-mtev-0.1.13/src/multitouch.c 2012-01-04 14:48:57.607869339 +0800
@@ -33,6 +33,11 @@
#include "common.h"
#include "mtouch.h"
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
+/* removed from server, purge when dropping support for server 1.10 */
+#define XI86_SEND_DRAG_EVENTS 0x08
+#endif
+
static const char* const axis_labels_str[] = {
AXIS_LABEL_PROP_ABS_MT_POSITION_X,
AXIS_LABEL_PROP_ABS_MT_POSITION_Y,
@@ -114,7 +119,11 @@ static int init_properties(DeviceIntPtr
return Success;
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
+#else
+static int device_init(DeviceIntPtr dev, InputInfoPtr local)
+#endif
{
struct mtev_mtouch *mt = local->private;
Atom atom;
@@ -208,7 +217,11 @@ static int device_init(DeviceIntPtr dev,
xf86InitValuatorAxisStruct(dev, val, axes_labels[val],
min,
max,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 12
+ 1, 0, 1, Absolute);
+#else
1, 0, 1);
+#endif
xf86InitValuatorDefaults(dev, val);
}
}
@@ -218,7 +231,11 @@ static int device_init(DeviceIntPtr dev,
return Success;
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static int device_on(LocalDevicePtr local)
+#else
+static int device_on(InputInfoPtr local)
+#endif
{
struct mtev_mtouch *mt = local->private;
local->fd = xf86OpenSerial(local->options);
@@ -234,7 +251,11 @@ static int device_on(LocalDevicePtr loca
return Success;
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static int device_off(LocalDevicePtr local)
+#else
+static int device_off(InputInfoPtr local)
+#endif
{
struct mtev_mtouch *mt = local->private;
xf86RemoveEnabledDevice(local);
@@ -245,12 +266,20 @@ static int device_off(LocalDevicePtr loc
return Success;
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static int device_close(LocalDevicePtr local)
+#else
+static int device_close(InputInfoPtr local)
+#endif
{
return Success;
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static void process_state(LocalDevicePtr local,
+#else
+static void process_state(InputInfoPtr local,
+#endif
const struct mtev_mtouch *mt)
{
@@ -324,7 +353,11 @@ static void process_state(LocalDevicePtr
}
/* called for each full received packet from the touchpad */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static void read_input(LocalDevicePtr local)
+#else
+static void read_input(InputInfoPtr local)
+#endif
{
struct mtev_mtouch *mt = local->private;
while (mtouch_read_synchronized_event(mt, local->fd)) {
@@ -334,7 +367,12 @@ static void read_input(LocalDevicePtr lo
static Bool device_control(DeviceIntPtr dev, int mode)
{
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
LocalDevicePtr local = dev->public.devicePrivate;
+#else
+ InputInfoPtr local = dev->public.devicePrivate;
+#endif
+
switch (mode) {
case DEVICE_INIT:
xf86Msg(X_INFO, "device control: init\n");
@@ -354,27 +392,46 @@ static Bool device_control(DeviceIntPtr
}
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags)
+#else
+static int preinit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+#endif
{
struct mtev_mtouch *mt;
+ int rc = BadAlloc;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
InputInfoPtr local = xf86AllocateInput(drv, 0);
if (!local)
goto error;
+#else
+ InputInfoPtr local = pInfo;
+#endif
mt = calloc(1, sizeof(struct mtev_mtouch));
if (!mt)
goto error;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
local->name = dev->identifier;
+#endif
local->type_name = XI_TOUCHSCREEN;
local->device_control = device_control;
local->read_input = read_input;
local->private = mt;
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
local->flags = XI86_POINTER_CAPABLE |
XI86_SEND_DRAG_EVENTS;
local->conf_idev = dev;
+#else
+ local->flags = XI86_SEND_DRAG_EVENTS;
+#endif
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
xf86CollectInputOptions(local, NULL, NULL);
+#else
+ xf86CollectInputOptions(local, NULL);
+#endif
//xf86OptionListReport(local->options);
xf86ProcessCommonOptions(local, local->options);
@@ -383,10 +440,17 @@ static InputInfoPtr preinit(InputDriverP
mt->invert_x = xf86SetBoolOption(local->options, "InvertX", FALSE);
mt->invert_y = xf86SetBoolOption(local->options, "InvertY", FALSE);
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
local->flags |= XI86_CONFIGURED;
+#endif
+ rc = Success;
error:
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
return local;
+#else
+ return rc;
+#endif
}
static void uninit(InputDriverPtr drv, InputInfoPtr local, int flags)
@@ -403,7 +467,9 @@ static InputDriverRec MTEV = {
.PreInit = preinit,
.UnInit = uninit,
.module = NULL,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
.refCount = 0
+#endif
};
static XF86ModuleVersionInfo VERSION = {
|