From 0514d53e10b3521bb708a9cbde4bab525248eadb Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 25 Oct 2006 01:10:44 +0300 Subject: [PATCH] xfree86: remove motion history handling Remove motion history handling, as we now deal with this in the DIX. --- hw/xfree86/common/xf86Xinput.c | 58 ---------------------------------- hw/xfree86/common/xf86Xinput.h | 11 ------- hw/xfree86/loader/xf86sym.c | 2 -- 3 files changed, 71 deletions(-) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 36f236286..915a21917 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -138,13 +138,6 @@ xf86ProcessCommonOptions(LocalDevicePtr local, } else { xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name); } - - local->history_size = xf86SetIntOption(list, "HistorySize", 0); - - if (local->history_size > 0) { - xf86Msg(X_CONFIG, "%s: has a history of %d motions\n", local->name, - local->history_size); - } } void @@ -736,57 +729,6 @@ xf86PostKeyboardEvent(DeviceIntPtr device, mieqEnqueue(device, xf86Events + i); } -/* - * Motion history management. - */ - -_X_EXPORT void -xf86MotionHistoryAllocate(LocalDevicePtr local) -{ - ValuatorClassPtr valuator = local->dev->valuator; - - if (!HAS_MOTION_HISTORY(local)) - return; - if (local->motion_history) xfree(local->motion_history); - local->motion_history = xalloc((sizeof(INT32) * valuator->numAxes + sizeof(Time)) - * valuator->numMotionEvents); - local->first = 0; - local->last = 0; -} - -_X_EXPORT int -xf86GetMotionEvents(DeviceIntPtr dev, - xTimecoord *buff, - unsigned long start, - unsigned long stop, - ScreenPtr pScreen) -{ - LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate; - ValuatorClassPtr valuator = dev->valuator; - int num = 0; - int loop = local->first; - int size; - Time current; - - if (!HAS_MOTION_HISTORY(local)) - return 0; - - size = (sizeof(INT32) * valuator->numAxes + sizeof(Time)); - - while (loop != local->last) { - current = *(Time*)(((char *)local->motion_history)+loop*size); - if (current > stop) - return num; - if (current >= start) { - memcpy(((char *)buff)+size*num, - ((char *)local->motion_history)+loop*size, size); - num++; - } - loop = (loop + 1) % valuator->numMotionEvents; - } - return num; -} - _X_EXPORT LocalDevicePtr xf86FirstLocalDevice() { diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index 73dcdb75e..fe65643ce 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -86,10 +86,6 @@ #define XI_PRIVATE(dev) \ (((LocalDevicePtr)((dev)->public.devicePrivate))->private) -#ifdef HAS_MOTION_HISTORY -#undef HAS_MOTION_HISTORY -#endif -#define HAS_MOTION_HISTORY(local) ((local)->dev->valuator && (local)->dev->valuator->numMotionEvents) #ifdef XINPUT /* This holds the input driver entry and module information. */ @@ -138,9 +134,6 @@ typedef struct _LocalDeviceRec { DeviceIntPtr dev; pointer private; int private_flags; - pointer motion_history; - ValuatorMotionProcPtr motion_history_proc; - unsigned int history_size; /* only for configuration purpose */ unsigned int first; unsigned int last; int old_x; @@ -176,10 +169,6 @@ void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down, ...); void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code, int is_down); -void xf86MotionHistoryAllocate(LocalDevicePtr local); -int xf86GetMotionEvents(DeviceIntPtr dev, xTimecoord *buff, - unsigned long start, unsigned long stop, - ScreenPtr pScreen); void xf86XinputFinalizeInit(DeviceIntPtr dev); void xf86ActivateDevice(LocalDevicePtr local); Bool xf86CheckButton(int button, int down); diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 8e39373b3..3051dedaf 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -697,8 +697,6 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86PostButtonEvent) SYMFUNC(xf86PostKeyEvent) SYMFUNC(xf86PostKeyboardEvent) - SYMFUNC(xf86GetMotionEvents) - SYMFUNC(xf86MotionHistoryAllocate) SYMFUNC(xf86FirstLocalDevice) SYMFUNC(xf86ActivateDevice) SYMFUNC(xf86XInputSetScreen)