From 9398d62f27ee1b287e4458fd8b011c10f7b59efd Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 21 Mar 2007 00:18:24 +0200 Subject: [PATCH] XFree86 input: Add backwards compatibility for motion history Add the old motion history API back, as a shim around the new mi API. --- hw/xfree86/common/xf86Helper.c | 13 +++++++++++++ hw/xfree86/common/xf86Xinput.c | 3 +++ hw/xfree86/common/xf86Xinput.h | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 93c89fd5f..913735bc9 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -2981,3 +2981,16 @@ xf86IsUnblank(int mode) return TRUE; } } + +_X_EXPORT void +xf86MotionHistoryAllocate(LocalDevicePtr local) +{ + AllocateMotionHistory(local->dev); +} + +_X_EXPORT int +xf86GetMotionEvents(DeviceIntPtr pDev, xTimecoord *buff, unsigned long start, + unsigned long stop, ScreenPtr pScreen) +{ + return GetMotionHistory(pDev, buff, start, stop, pScreen); +} diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index b8f4b69e4..c9c8059c0 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -132,6 +132,9 @@ xf86ProcessCommonOptions(LocalDevicePtr local, } else { xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name); } + + /* Backwards compatibility. */ + local->history_size = GetMotionHistorySize(); } /*********************************************************************** diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 47dbc7023..b2bc8dec1 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -86,6 +86,9 @@ #define XI_PRIVATE(dev) \ (((LocalDevicePtr)((dev)->public.devicePrivate))->private) +/* Stupid API backwards-compatibility. */ +#define TS_Raw 60 +#define TS_Scaled 61 #ifdef XINPUT /* This holds the input driver entry and module information. */ @@ -144,6 +147,7 @@ typedef struct _LocalDeviceRec { InputDriverPtr drv; pointer module; pointer options; + unsigned int history_size; } LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr; typedef struct _DeviceAssocRec