From b12d302df8283186ce87882c29b2b0294adb2770 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 20 May 2009 15:28:16 +1000 Subject: Input: rename DeviceIntRec->isMaster to ->type. isMaster is not enough as long as we differ between master pointers and keyboard. With flexible device classes, the usual checks for whether a master device is a pointer (currently check for ->button, ->valuators or ->key) do not work as an SD may post an event through a master and mess this check up. Example, a device with valuators but no buttons would remove the button class from the VCP and thus result in the IsPointerDevice(inputInfo.pointer) == FALSE. This will become worse in the future when new device classes are introduced that aren't provided in the current system (e.g. a switch class). This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an IsMaster(dev). --- dix/getevents.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dix/getevents.c') diff --git a/dix/getevents.c b/dix/getevents.c index e40b3dbe9..5ff4f91b9 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -325,7 +325,7 @@ AllocateMotionHistory(DeviceIntPtr pDev) * potential valuators, plus the respective range of the valuators. * 3 * INT32 for (min_val, max_val, curr_val)) */ - if (pDev->isMaster) + if (IsMaster(pDev)) size = sizeof(INT32) * 3 * MAX_VALUATORS; else size = sizeof(INT32) * pDev->valuator->numAxes; @@ -369,7 +369,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start, if (core && !pScreen) return 0; - if (pDev->isMaster) + if (IsMaster(pDev)) size = (sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(Time); else size = (sizeof(INT32) * pDev->valuator->numAxes) + sizeof(Time); @@ -421,7 +421,7 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start, coord = rescaleValuatorAxis(coord, &from, to, pScreen->height); memcpy(corebuf, &coord, sizeof(INT16)); - } else if (pDev->isMaster) + } else if (IsMaster(pDev)) { memcpy(obuff, ibuff, sizeof(Time)); /* copy timestamp */ @@ -497,7 +497,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, return; v = pDev->valuator; - if (pDev->isMaster) + if (IsMaster(pDev)) { buff += ((sizeof(INT32) * 3 * MAX_VALUATORS) + sizeof(CARD32)) * v->last_motion; -- cgit v1.2.3