summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-06-19 08:38:14 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-06-19 08:42:24 +1000
commit1c549f65bdcb735f45000d88ec5e6016fe00b72d (patch)
tree98d8d19690b8a94c8c395dea6e146619e4bb45e8 /src
parentc1932081e5a6ba2f6196b8f862fe246668e92124 (diff)
Adjust for ABI_XINPUT_VERSION >= 7
Diffstat (limited to 'src')
-rw-r--r--src/void.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/void.c b/src/void.c
index ce005d0..9d49308 100644
--- a/src/void.c
+++ b/src/void.c
@@ -52,6 +52,11 @@
#include <xf86Module.h>
#endif
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+#include <X11/Xatom.h>
+#include <xserver-properties.h>
+#endif
+
#define MAXBUTTONS 3
/******************************************************************************
@@ -178,7 +183,18 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
XkbRMLVOSet rmlvo;
#endif
Bool result;
-
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ Atom btn_labels[MAXBUTTONS] = {0};
+ Atom axes_labels[2] = {0};
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
+
+ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+#endif
+
pInfo = device->public.devicePrivate;
switch (what)
@@ -192,6 +208,9 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
if (InitButtonClassDeviceStruct(device,
MAXBUTTONS,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ btn_labels,
+#endif
map) == FALSE) {
ErrorF("unable to allocate Button class device\n");
return !Success;
@@ -224,6 +243,9 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
if (InitValuatorClassDeviceStruct(device,
2,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axes_labels,
+#endif
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
xf86GetMotionEvents,
#endif
@@ -231,12 +253,18 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
Absolute) == FALSE) {
InitValuatorAxisStruct(device,
0,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axes_labels[0],
+#endif
0, /* min val */1, /* max val */
1, /* resolution */
0, /* min_res */
1); /* max_res */
InitValuatorAxisStruct(device,
1,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axes_labels[1],
+#endif
0, /* min val */1, /* max val */
1, /* resolution */
0, /* min_res */