input: change axisVal from uint to double.
With subpixel support, uint just doesn't cut it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
25b6fc4a42
commit
80837dbefd
|
@ -539,7 +539,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
|
|||
|
||||
to->valuator = xrealloc(to->valuator, sizeof(ValuatorClassRec) +
|
||||
from->valuator->numAxes * sizeof(AxisInfo) +
|
||||
from->valuator->numAxes * sizeof(unsigned int));
|
||||
from->valuator->numAxes * sizeof(double));
|
||||
v = to->valuator;
|
||||
if (!v)
|
||||
FatalError("[Xi] no memory for class shift.\n");
|
||||
|
@ -548,7 +548,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
|
|||
v->axes = (AxisInfoPtr)&v[1];
|
||||
memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo));
|
||||
|
||||
v->axisVal = (int*)(v->axes + from->valuator->numAxes);
|
||||
v->axisVal = (double*)(v->axes + from->valuator->numAxes);
|
||||
v->sourceid = from->id;
|
||||
} else if (to->valuator && !from->valuator)
|
||||
{
|
||||
|
@ -844,6 +844,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
|
|||
{
|
||||
/* XXX: Relative/Absolute mode */
|
||||
v->axisVal[i] = event->valuators.data[i];
|
||||
v->axisVal[i] += event->valuators.data_frac[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ ProcXQueryDeviceState(ClientPtr client)
|
|||
xValuatorState *tv;
|
||||
xQueryDeviceStateReply rep;
|
||||
DeviceIntPtr dev;
|
||||
int *values;
|
||||
double *values;
|
||||
|
||||
REQUEST(xQueryDeviceStateReq);
|
||||
REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
|
||||
|
|
|
@ -1170,7 +1170,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes,
|
|||
|
||||
valc = (ValuatorClassPtr)xcalloc(1, sizeof(ValuatorClassRec) +
|
||||
numAxes * sizeof(AxisInfo) +
|
||||
numAxes * sizeof(unsigned int));
|
||||
numAxes * sizeof(double));
|
||||
if (!valc)
|
||||
return FALSE;
|
||||
|
||||
|
@ -1184,7 +1184,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes,
|
|||
valc->numAxes = numAxes;
|
||||
valc->mode = mode;
|
||||
valc->axes = (AxisInfoPtr)(valc + 1);
|
||||
valc->axisVal = (int *)(valc->axes + numAxes);
|
||||
valc->axisVal = (double *)(valc->axes + numAxes);
|
||||
dev->valuator = valc;
|
||||
|
||||
AllocateMotionHistory(dev);
|
||||
|
|
|
@ -235,7 +235,7 @@ typedef struct _ValuatorClassRec {
|
|||
|
||||
AxisInfoPtr axes;
|
||||
unsigned short numAxes;
|
||||
int *axisVal; /* always absolute, but device-coord system */
|
||||
double *axisVal; /* always absolute, but device-coord system */
|
||||
CARD8 mode;
|
||||
ValuatorAccelerationRec accelScheme;
|
||||
} ValuatorClassRec, *ValuatorClassPtr;
|
||||
|
|
Loading…
Reference in New Issue