From 036b457c1b3f7d2d174da890cb8598d907181f8e Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 25 Oct 2006 02:22:46 +0300 Subject: support new DIX motion history API Use the DIX motion history if we have ABI version 1 or higher. --- src/evdev.c | 2 ++ src/evdev_axes.c | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/evdev.c b/src/evdev.c index f2d61f6..1bcaef8 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -273,7 +273,9 @@ EvdevNew(evdevDriverPtr driver, evdevDevicePtr device) pInfo->device_control = EvdevProc; pInfo->read_input = EvdevReadInput; pInfo->switch_mode = EvdevSwitchMode; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 pInfo->motion_history_proc = xf86GetMotionEvents; +#endif pInfo->conf_idev = driver->dev; pInfo->private = device; diff --git a/src/evdev_axes.c b/src/evdev_axes.c index 6879ab1..9d2ef20 100644 --- a/src/evdev_axes.c +++ b/src/evdev_axes.c @@ -672,8 +672,14 @@ EvdevAxesInit (DeviceIntPtr device) return Success; if (!InitValuatorClassDeviceStruct(device, axes, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 1 + GetMotionHistory, + GetMotionHistorySize(), +#else miPointerGetMotionEvents, - miPointerGetMotionBufferSize(), 0)) + miPointerGetMotionBufferSize(), +#endif + 0)) return !Success; for (i = 0; i < axes; i++) { @@ -684,7 +690,9 @@ EvdevAxesInit (DeviceIntPtr device) if (!InitPtrFeedbackClassDeviceStruct(device, EvdevPtrCtrlProc)) return !Success; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0 xf86MotionHistoryAllocate (pInfo); +#endif return Success; } -- cgit v1.2.3