From 01366bfb5a1bb99af6559df5b5cd87b67674041e Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 22 Nov 2009 22:08:57 +0000 Subject: Prepare for ABI_XINPUT_VERSION 7. Still missing the actual button and axis labeling, this can be added at a later point in time. --- src/ws.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/ws.c b/src/ws.c index cb7fd21..ca21cdb 100644 --- a/src/ws.c +++ b/src/ws.c @@ -339,6 +339,10 @@ wsProc(DeviceIntPtr pWS, int what) WSDevicePtr priv = (WSDevicePtr)XI_PRIVATE(pWS); unsigned char map[NBUTTONS + 1]; int i; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + Atom btn_labels[NBUTTONS] = {0}; + Atom axes_labels[NAXES] = {0}; +#endif switch (what) { case DEVICE_INIT: @@ -353,6 +357,9 @@ wsProc(DeviceIntPtr pWS, int what) map[i + 1] = i + 1; InitPointerDeviceStruct((DevicePtr)pWS, map, min(priv->buttons, NBUTTONS), +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + btn_labels, +#endif #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 miPointerGetMotionEvents, #elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 @@ -363,12 +370,23 @@ wsProc(DeviceIntPtr pWS, int what) miPointerGetMotionBufferSize() #else GetMotionHistorySize(), NAXES +#endif +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + , axes_labels #endif ); - xf86InitValuatorAxisStruct(pWS, 0, 0, -1, 1, 0, 1); + xf86InitValuatorAxisStruct(pWS, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axes_labels[0], +#endif + 0, 0, -1, 1, 0, 1); xf86InitValuatorDefaults(pWS, 0); - xf86InitValuatorAxisStruct(pWS, 1, 0, -1, 1, 0, 1); + xf86InitValuatorAxisStruct(pWS, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axes_labels[1], +#endif + 1, 0, -1, 1, 0, 1); xf86InitValuatorDefaults(pWS, 1); xf86MotionHistoryAllocate(pInfo); AssignTypeAndName(pWS, pInfo->atom, pInfo->name); -- cgit v1.2.3