diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 4f4d7cb77..7994890d3 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -137,9 +137,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client) coords = (INT32 *) xalloc(tsize); if (!coords) return BadAlloc; - rep.nEvents = (v->GetMotionProc) (dev, (xTimecoord *) coords, /* XXX */ - start.milliseconds, stop.milliseconds, - (ScreenPtr) NULL); + rep.nEvents = GetMotionHistory(dev, (xTimecoord *) coords,/* XXX */ + start.milliseconds, stop.milliseconds, + (ScreenPtr) NULL); } if (rep.nEvents > 0) { length = (rep.nEvents * size + 3) >> 2; diff --git a/dix/devices.c b/dix/devices.c index 252118690..9db276b16 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -492,7 +492,7 @@ CorePointerProc(DeviceIntPtr pDev, int what) for (i = 1; i <= 32; i++) map[i] = i; InitPointerDeviceStruct((DevicePtr)pDev, map, 32, - GetMotionHistory, (PtrCtrlProcPtr)NoopDDA, + (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2); pDev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2; pDev->last.valuators[0] = pDev->valuator->axisVal[0]; @@ -643,7 +643,7 @@ FreeDeviceClass(int type, pointer *class) ValuatorClassPtr *v = (ValuatorClassPtr*)class; /* Counterpart to 'biggest hack ever' in init. */ - if ((*v)->motion && (*v)->GetMotionProc == GetMotionHistory) + if ((*v)->motion) xfree((*v)->motion); xfree((*v)); break; @@ -1157,7 +1157,6 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, _X_EXPORT Bool InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, - ValuatorMotionProcPtr motionProc, int numMotionEvents, int mode) { int i; @@ -1175,7 +1174,6 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, valc->motion = NULL; valc->first_motion = 0; valc->last_motion = 0; - valc->GetMotionProc = motionProc; valc->numMotionEvents = numMotionEvents; valc->motionHintWindow = NullWindow; @@ -1187,9 +1185,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, valc->dyremaind = 0; dev->valuator = valc; - /* biggest hack ever. */ - if (motionProc == GetMotionHistory) - AllocateMotionHistory(dev); + AllocateMotionHistory(dev); for (i=0; ivaluator->GetMotionProc) (mouse, coords, - start.milliseconds, - stop.milliseconds, - pWin->drawable.pScreen); + count = GetMotionHistory(mouse, coords, start.milliseconds, + stop.milliseconds, pWin->drawable.pScreen); xmin = pWin->drawable.x - wBorderWidth (pWin); xmax = pWin->drawable.x + (int)pWin->drawable.width + wBorderWidth (pWin); diff --git a/dix/getevents.c b/dix/getevents.c index 7c7c63fda..dda681d27 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -238,8 +238,8 @@ AllocateMotionHistory(DeviceIntPtr pDev) if (pDev->valuator->numMotionEvents < 1) return; - pDev->valuator->motion = xalloc(((sizeof(INT32) * pDev->valuator->numAxes) + - sizeof(Time)) * + pDev->valuator->motion = xalloc(((sizeof(INT32) * pDev->valuator->numAxes) + + sizeof(Time)) * pDev->valuator->numMotionEvents); pDev->valuator->first_motion = 0; pDev->valuator->last_motion = 0; diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index c6724e487..005465fb6 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -438,7 +438,6 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff) } InitPointerDeviceStruct(pDev, pi->map, pi->nButtons, - GetMotionHistory, (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), pi->nAxes); diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 3b001eea7..2af3c6421 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -295,7 +295,7 @@ vfbMouseProc(DeviceIntPtr pDevice, int onoff) map[1] = 1; map[2] = 2; map[3] = 3; - InitPointerDeviceStruct(pDev, map, 3, GetMotionHistory, + InitPointerDeviceStruct(pDev, map, 3, (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2); break; diff --git a/hw/xnest/Pointer.c b/hw/xnest/Pointer.c index b0de13b5f..8f764a624 100644 --- a/hw/xnest/Pointer.c +++ b/hw/xnest/Pointer.c @@ -56,7 +56,6 @@ xnestPointerProc(DeviceIntPtr pDev, int onoff) for (i = 0; i <= nmap; i++) map[i] = i; /* buttons are already mapped */ InitPointerDeviceStruct(&pDev->public, map, nmap, - GetMotionHistory, xnestChangePointerControl, GetMotionHistorySize(), 2); break; diff --git a/include/input.h b/include/input.h index 9b92ea33d..70f3de64f 100644 --- a/include/input.h +++ b/include/input.h @@ -274,17 +274,9 @@ extern Bool InitButtonClassDeviceStruct( int /*numButtons*/, CARD8* /*map*/); -typedef int (*ValuatorMotionProcPtr)( - DeviceIntPtr /*pdevice*/, - xTimecoord * /*coords*/, - unsigned long /*start*/, - unsigned long /*stop*/, - ScreenPtr /*pScreen*/); - extern Bool InitValuatorClassDeviceStruct( DeviceIntPtr /*device*/, int /*numAxes*/, - ValuatorMotionProcPtr /* motionProc */, int /*numMotionEvents*/, int /*mode*/); @@ -358,7 +350,6 @@ extern Bool InitPointerDeviceStruct( DevicePtr /*device*/, CARD8* /*map*/, int /*numButtons*/, - ValuatorMotionProcPtr /*motionProc*/, PtrCtrlProcPtr /*controlProc*/, int /*numMotionEvents*/, int /*numAxes*/); diff --git a/include/inputstr.h b/include/inputstr.h index d26eb1377..86b166721 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -164,11 +164,10 @@ typedef struct _AxisInfo { } AxisInfo, *AxisInfoPtr; typedef struct _ValuatorClassRec { - ValuatorMotionProcPtr GetMotionProc; int numMotionEvents; int first_motion; int last_motion; - void *motion; + void *motion; /* motion history buffer */ WindowPtr motionHintWindow;