4 #include <X11/keysym.h>
7 +#include <xserver-properties.h>
11 @@ -211,6 +212,15 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
12 unsigned char map[MAXBUTTONS + 1];
15 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
16 + Atom buttons[MAXBUTTONS];
19 + axes[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
20 + axes[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
22 + buttons[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
26 ErrorF("%s\n", __FUNCTION__);
27 @@ -226,33 +236,45 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
31 - if (InitButtonClassDeviceStruct(device,
32 - MAXBUTTONS, map) == FALSE) {
33 + if (InitButtonClassDeviceStruct(device, MAXBUTTONS,
34 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
38 ErrorF("unable to allocate Button class device\n");
42 - if (InitValuatorClassDeviceStruct(device,
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
49 +#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
50 + xf86GetMotionEvents,
52 - 0, Absolute) == FALSE) {
53 + 0, Absolute) == FALSE) {
54 ErrorF("unable to allocate Valuator class device\n");
58 - InitValuatorAxisStruct(device, 0, 0, /* min val */
59 - priv->width - 1, /* max val */
60 - priv->width, /* resolution */
62 - priv->width); /* max_res */
64 - InitValuatorAxisStruct(device, 1, 0, /* min val */
65 - priv->height - 1,/* max val */
66 - priv->height, /* resolution */
68 - priv->height); /* max_res */
69 + InitValuatorAxisStruct(device, 0,
70 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
74 + priv->width - 1, /* max val */
75 + priv->width, /* resolution */
77 + priv->width); /* max_res */
79 + InitValuatorAxisStruct(device, 1,
80 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
84 + priv->height - 1, /* max val */
85 + priv->height, /* resolution */
87 + priv->height); /* max_res */
89 if (InitProximityClassDeviceStruct (device) == FALSE) {
90 ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n");