From 63155cf985ee15bf6aad95066b076ab680cf5a31 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 4 Aug 2009 15:28:30 +1000 Subject: dmx: pass button/axis labels into the init functions (currently unset) Currently only None labels are passed in, in the future these labels should be whatever the respective buttions/axes are. Signed-off-by: Peter Hutterer --- hw/dmx/input/dmxinputinit.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index 7e3407270..ff444323c 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -436,7 +436,9 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) int fd; DMXLocalInitInfo info; int i; - + Atom btn_labels[MAX_BUTTONS] = {0}; /* FIXME */ + Atom axis_labels[MAX_VALUATORS] = {0}; /* FIXME */ + if (dmxInput->detached) return Success; memset(&info, 0, sizeof(info)); @@ -457,31 +459,38 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) dmxBell, dmxKbdCtrl); } if (info.buttonClass) { - InitButtonClassDeviceStruct(pDevice, info.numButtons, info.map); + InitButtonClassDeviceStruct(pDevice, info.numButtons, + btn_labels, info.map); } if (info.valuatorClass) { if (info.numRelAxes && dmxLocal->sendsCore) { InitValuatorClassDeviceStruct(pDevice, info.numRelAxes, + axis_labels, GetMaximumEventsNum(), Relative); for (i = 0; i < info.numRelAxes; i++) - InitValuatorAxisStruct(pDevice, i, info.minval[0], - info.maxval[0], info.res[0], + InitValuatorAxisStruct(pDevice, i, axis_labels[i], + info.minval[0], info.maxval[0], + info.res[0], info.minres[0], info.maxres[0]); } else if (info.numRelAxes) { InitValuatorClassDeviceStruct(pDevice, info.numRelAxes, + axis_labels, dmxPointerGetMotionBufferSize(), Relative); for (i = 0; i < info.numRelAxes; i++) - InitValuatorAxisStruct(pDevice, i, info.minval[0], + InitValuatorAxisStruct(pDevice, i, axis_labels[i], + info.minval[0], info.maxval[0], info.res[0], info.minres[0], info.maxres[0]); } else if (info.numAbsAxes) { InitValuatorClassDeviceStruct(pDevice, info.numAbsAxes, + axis_labels, dmxPointerGetMotionBufferSize(), Absolute); for (i = 0; i < info.numAbsAxes; i++) InitValuatorAxisStruct(pDevice, i+info.numRelAxes, + axis_labels[i + info.numRelAxes], info.minval[i+1], info.maxval[i+1], info.res[i+1], info.minres[i+1], info.maxres[i+1]); -- cgit v1.2.3