aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-02-13 09:54:06 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-02-13 09:54:39 +0100
commita12ed738095819beab0b42c6c8a1566c063bb79e (patch)
tree27220019fadf6e4e782f67f5030435d1caee5d88
parentfc4d145455bec7f3899db992a48ce26b7798b928 (diff)
downloadxorg-input-kobomultitouch-a12ed738095819beab0b42c6c8a1566c063bb79e.tar.gz
xorg-input-kobomultitouch-a12ed738095819beab0b42c6c8a1566c063bb79e.tar.bz2
xorg-input-kobomultitouch-a12ed738095819beab0b42c6c8a1566c063bb79e.zip
Support XINPUT 12
The version 12 input ABI brings substantial changes to driver handling. This patch makes the driver compile and run under the upcoming X server 1.10. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r--driver/multitouch.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/driver/multitouch.c b/driver/multitouch.c
index c9b8bce..99f1484 100644
--- a/driver/multitouch.c
+++ b/driver/multitouch.c
@@ -26,6 +26,10 @@
#include <xserver-properties.h>
#endif
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
+typedef InputInfoPtr LocalDevicePtr;
+#endif
+
/* these should be user-configurable at some point */
static const float vscroll_fraction = 0.025;
static const float hscroll_fraction = 0.05;
@@ -134,7 +138,11 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
#endif
mt->caps.abs[MTDEV_POSITION_X].minimum,
mt->caps.abs[MTDEV_POSITION_X].maximum,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
+ 1, 0, 1, Absolute);
+#else
1, 0, 1);
+#endif
xf86InitValuatorDefaults(dev, 0);
xf86InitValuatorAxisStruct(dev, 1,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
@@ -142,7 +150,11 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
#endif
mt->caps.abs[MTDEV_POSITION_Y].minimum,
mt->caps.abs[MTDEV_POSITION_Y].maximum,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
+ 1, 0, 1, Absolute);
+#else
1, 0, 1);
+#endif
xf86InitValuatorDefaults(dev, 1);
XIRegisterPropertyHandler(dev, pointer_property, NULL, NULL);
@@ -289,6 +301,26 @@ static Bool device_control(DeviceIntPtr dev, int mode)
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
+static int preinit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+{
+ struct MTouch *mt;
+
+ mt = calloc(1, sizeof(*mt));
+ if (!mt)
+ return BadAlloc;
+
+ pInfo->private = mt;
+ pInfo->type_name = XI_TOUCHPAD;
+ pInfo->device_control = device_control;
+ pInfo->read_input = read_input;
+ pInfo->switch_mode = 0;
+ //xf86CollectInputOptions(local, NULL);
+ //xf86ProcessCommonOptions(local, local->options);
+
+ return Success;
+}
+#else
static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags)
{
struct MTouch *mt;
@@ -315,6 +347,7 @@ static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags)
error:
return local;
}
+#endif
static void uninit(InputDriverPtr drv, InputInfoPtr local, int flags)
{