wok-stable view xorg-xf86-input-microtouch/stuff/microtouch.u @ rev 10055
weechat: Add $CONFIGURE_ARGS.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Fri May 20 04:37:16 2011 +0000 (2011-05-20) |
parents | |
children |
line source
1 --- src/microtouch.c
2 +++ src/microtouch.c
3 @@ -404,6 +404,10 @@
4 MuTPrivatePtr priv = (MuTPrivatePtr) (local->private);
5 unsigned char map[] =
6 {0, 1};
7 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
8 + Atom btn_label;
9 + Atom axis_labels[2] = { 0, 0 };
10 +#endif
12 /*
13 * these have to be here instead of in the SetupProc, because when the
14 @@ -415,7 +419,11 @@
15 /*
16 * Device reports button press for 1 button.
17 */
18 - if (InitButtonClassDeviceStruct (dev, 1, map) == FALSE)
19 + if (InitButtonClassDeviceStruct (dev, 1,
20 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
21 + &btn_label,
22 +#endif
23 + map) == FALSE)
24 {
25 ErrorF ("Unable to allocate MicroTouch touchscreen ButtonClassDeviceStruct\n");
26 return !Success;
27 @@ -425,7 +433,13 @@
28 * Device reports motions on 2 axes in absolute coordinates.
29 * Axes min and max values are reported in raw coordinates.
30 */
31 - if (InitValuatorClassDeviceStruct (dev, 2, xf86GetMotionEvents,
32 + if (InitValuatorClassDeviceStruct (dev, 2,
33 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
34 + axis_labels,
35 +#endif
36 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
37 + xf86GetMotionEvents,
38 +#endif
39 local->history_size, Absolute) == FALSE)
40 {
41 ErrorF ("Unable to allocate MicroTouch touchscreen ValuatorClassDeviceStruct\n");
42 @@ -433,11 +447,19 @@
43 }
44 else
45 {
46 - InitValuatorAxisStruct (dev, 0, priv->min_x, priv->max_x,
47 + InitValuatorAxisStruct (dev, 0,
48 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
49 + axis_labels[0],
50 +#endif
51 + priv->min_x, priv->max_x,
52 9500,
53 0 /* min_res */ ,
54 9500 /* max_res */ );
55 - InitValuatorAxisStruct (dev, 1, priv->min_y, priv->max_y,
56 + InitValuatorAxisStruct (dev, 1,
57 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
58 + axis_labels[1],
59 +#endif
60 + priv->min_y, priv->max_y,
61 10500,
62 0 /* min_res */ ,
63 10500 /* max_res */ );