summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2008-11-08 14:54:15 +0100
committerHenrik Rydberg <rydberg@euromail.se>2008-11-08 14:54:15 +0100
commitad124aac8feeaaa1f131ff35d895e777f4ffdc61 (patch)
tree9c098d598f506b7c6d0bb1be473acd09e8b3c2dd
parent92b22ac5f7b960815fd01db09406017ddccd7bd7 (diff)
ok, down to minimal working config
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r--src/multitouch.c60
1 files changed, 3 insertions, 57 deletions
diff --git a/src/multitouch.c b/src/multitouch.c
index 6271ce9..0c1f9e3 100644
--- a/src/multitouch.c
+++ b/src/multitouch.c
@@ -45,7 +45,7 @@ static int pointer_property(DeviceIntPtr dev,
45static int device_init(DeviceIntPtr dev, LocalDevicePtr local) 45static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
46{ 46{
47 struct MTouch *mt = local->private; 47 struct MTouch *mt = local->private;
48 unsigned char btmap[DIM_BUTTON + 1]; 48 unsigned char btmap[DIM_BUTTON];
49 int i; 49 int i;
50 50
51 local->fd = xf86OpenSerial(local->options); 51 local->fd = xf86OpenSerial(local->options);
@@ -57,11 +57,9 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
57 return -1; 57 return -1;
58 xf86CloseSerial(local->fd); 58 xf86CloseSerial(local->fd);
59 59
60 for (i = 0; i < DIM_BUTTON + 1; i++) 60 for (i = 0; i < DIM_BUTTON; i++)
61 btmap[i] = i; 61 btmap[i] = i;
62 62
63 dev->public.on = FALSE;
64
65 InitPointerDeviceStruct((DevicePtr)dev, 63 InitPointerDeviceStruct((DevicePtr)dev,
66 btmap, 64 btmap,
67 DIM_BUTTON, 65 DIM_BUTTON,
@@ -164,44 +162,6 @@ static void read_input(LocalDevicePtr local)
164 162
165//////////////////////////////////////////////////////////////////////////// 163////////////////////////////////////////////////////////////////////////////
166 164
167static int control_proc(LocalDevicePtr local, xDeviceCtl *control)
168{
169 xf86Msg(X_INFO, "control_proc\n");
170 return Success;
171}
172
173////////////////////////////////////////////////////////////////////////////
174
175static void close_proc(LocalDevicePtr local)
176{
177 xf86Msg(X_INFO, "close_proc\n");
178}
179
180////////////////////////////////////////////////////////////////////////////
181
182static int switch_mode(ClientPtr client, DeviceIntPtr dev, int mode)
183{
184 xf86Msg(X_INFO, "switch mode\n");
185 return Success;
186}
187
188////////////////////////////////////////////////////////////////////////////
189
190static Bool conversion_proc(LocalDevicePtr local, int first, int num,
191 int v0, int v1, int v2, int v3, int v4, int v5,
192 int *x, int *y)
193{
194 if (first != 0 || num != 2)
195 return FALSE;
196
197 *x = v0;
198 *y = v1;
199
200 return TRUE;
201}
202
203////////////////////////////////////////////////////////////////////////////
204
205static Bool device_control(DeviceIntPtr dev, int mode) 165static Bool device_control(DeviceIntPtr dev, int mode)
206{ 166{
207 LocalDevicePtr local = dev->public.devicePrivate; 167 LocalDevicePtr local = dev->public.devicePrivate;
@@ -215,11 +175,9 @@ static Bool device_control(DeviceIntPtr dev, int mode)
215 xf86Msg(X_INFO, "device control: on\n"); 175 xf86Msg(X_INFO, "device control: on\n");
216 if (device_on(local)) 176 if (device_on(local))
217 return !Success; 177 return !Success;
218 dev->public.on = TRUE;
219 return Success; 178 return Success;
220 case DEVICE_OFF: 179 case DEVICE_OFF:
221 xf86Msg(X_INFO, "device control: off\n"); 180 xf86Msg(X_INFO, "device control: off\n");
222 dev->public.on = FALSE;
223 device_off(local); 181 device_off(local);
224 return Success; 182 return Success;
225 case DEVICE_CLOSE: 183 case DEVICE_CLOSE:
@@ -249,24 +207,12 @@ static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags)
249 local->type_name = XI_TOUCHPAD; 207 local->type_name = XI_TOUCHPAD;
250 local->device_control = device_control; 208 local->device_control = device_control;
251 local->read_input = read_input; 209 local->read_input = read_input;
252 local->control_proc = control_proc;
253 local->close_proc = close_proc;
254 local->switch_mode = switch_mode;
255 local->conversion_proc = conversion_proc;
256 local->reverse_conversion_proc = NULL;
257 local->dev = NULL;
258 local->private = mt; 210 local->private = mt;
259 local->private_flags = 0;
260 local->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS; 211 local->flags = XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS;
261 local->conf_idev = dev; 212 local->conf_idev = dev;
262 local->always_core_feedback = 0;
263 213
264 xf86CollectInputOptions(local, NULL, NULL); 214 xf86CollectInputOptions(local, NULL, NULL);
265 xf86OptionListReport(local->options); 215 //xf86OptionListReport(local->options);
266
267 local->history_size = xf86SetIntOption(local->options,
268 "HistorySize", 0);
269
270 xf86ProcessCommonOptions(local, local->options); 216 xf86ProcessCommonOptions(local, local->options);
271 217
272 local->flags |= XI86_CONFIGURED; 218 local->flags |= XI86_CONFIGURED;