xorg-server: Fix linkage
[openwrt/svn-archive/archive.git] / Xorg / driver / xf86-input-tslib / patches / 030-xserver-1.7.patch
1 --- a/src/tslib.c
2 +++ b/src/tslib.c
3 @@ -49,6 +49,7 @@
4 #include <X11/keysym.h>
5 #include <mipointer.h>
6 #include <randrstr.h>
7 +#include <xserver-properties.h>
8
9 #include <tslib.h>
10
11 @@ -211,6 +212,15 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
12 unsigned char map[MAXBUTTONS + 1];
13 int i;
14 struct ts_priv *priv;
15 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
16 + Atom buttons[MAXBUTTONS];
17 + Atom axes[2];
18 +
19 + axes[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
20 + axes[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
21 +
22 + buttons[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
23 +#endif
24
25 #ifdef DEBUG
26 ErrorF("%s\n", __FUNCTION__);
27 @@ -226,33 +236,45 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
28 map[i + 1] = i + 1;
29 }
30
31 - if (InitButtonClassDeviceStruct(device,
32 - MAXBUTTONS, map) == FALSE) {
33 + if (InitButtonClassDeviceStruct(device, MAXBUTTONS,
34 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
35 + buttons,
36 +#endif
37 + map) == FALSE) {
38 ErrorF("unable to allocate Button class device\n");
39 return !Success;
40 }
41
42 - if (InitValuatorClassDeviceStruct(device,
43 - 2,
44 -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
45 - xf86GetMotionEvents,
46 + if (InitValuatorClassDeviceStruct(device, 2,
47 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
48 + axes,
49 +#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
50 + xf86GetMotionEvents,
51 #endif
52 - 0, Absolute) == FALSE) {
53 + 0, Absolute) == FALSE) {
54 ErrorF("unable to allocate Valuator class device\n");
55 return !Success;
56 }
57
58 - InitValuatorAxisStruct(device, 0, 0, /* min val */
59 - priv->width - 1, /* max val */
60 - priv->width, /* resolution */
61 - 0, /* min_res */
62 - priv->width); /* max_res */
63 -
64 - InitValuatorAxisStruct(device, 1, 0, /* min val */
65 - priv->height - 1,/* max val */
66 - priv->height, /* resolution */
67 - 0, /* min_res */
68 - priv->height); /* max_res */
69 + InitValuatorAxisStruct(device, 0,
70 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
71 + axes[0],
72 +#endif
73 + 0, /* min val */
74 + priv->width - 1, /* max val */
75 + priv->width, /* resolution */
76 + 0, /* min_res */
77 + priv->width); /* max_res */
78 +
79 + InitValuatorAxisStruct(device, 1,
80 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
81 + axes[1],
82 +#endif
83 + 0, /* min val */
84 + priv->height - 1, /* max val */
85 + priv->height, /* resolution */
86 + 0, /* min_res */
87 + priv->height); /* max_res */
88
89 if (InitProximityClassDeviceStruct (device) == FALSE) {
90 ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n");
91