dix: remove trailing/wrong whitespaces from devices.c and events.c

This commit is contained in:
Peter Hutterer 2007-11-13 16:58:23 +10:30
parent c703849e79
commit 5031238aad
2 changed files with 403 additions and 403 deletions

View File

@ -27,13 +27,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved All Rights Reserved
Permission to use, copy, modify, and distribute this software and its Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission. software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
@ -203,7 +203,7 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart)
* *
* A master pointer device needs to be enabled before a master keyboard * A master pointer device needs to be enabled before a master keyboard
* device. * device.
* *
* @param The device to be enabled. * @param The device to be enabled.
* @return TRUE on success or FALSE otherwise. * @return TRUE on success or FALSE otherwise.
*/ */
@ -300,7 +300,7 @@ DisableDevice(DeviceIntPtr dev)
{ {
if (other->spriteInfo->paired == dev) if (other->spriteInfo->paired == dev)
{ {
ErrorF("[dix] cannot disable device, still paired. " ErrorF("[dix] cannot disable device, still paired. "
"This is a bug. \n"); "This is a bug. \n");
return FALSE; return FALSE;
} }
@ -316,7 +316,7 @@ DisableDevice(DeviceIntPtr dev)
/* float attached devices */ /* float attached devices */
if (dev->isMaster) if (dev->isMaster)
{ {
for (other = inputInfo.devices; other; other = other->next) for (other = inputInfo.devices; other; other = other->next)
{ {
if (other->u.master == dev) if (other->u.master == dev)
AttachDevice(NULL, dev, NULL); AttachDevice(NULL, dev, NULL);
@ -337,7 +337,7 @@ DisableDevice(DeviceIntPtr dev)
/** /**
* Initialise a new device through the driver and tell all clients about the * Initialise a new device through the driver and tell all clients about the
* new device. * new device.
* *
* Must be called before EnableDevice. * Must be called before EnableDevice.
* The device will NOT send events until it is enabled! * The device will NOT send events until it is enabled!
* *
@ -360,7 +360,7 @@ ActivateDevice(DeviceIntPtr dev)
/* Initialize memory for sprites. */ /* Initialize memory for sprites. */
if (dev->isMaster && dev->spriteInfo->spriteOwner) if (dev->isMaster && dev->spriteInfo->spriteOwner)
pScreen->DeviceCursorInitialize(dev, pScreen); pScreen->DeviceCursorInitialize(dev, pScreen);
ev.type = DevicePresenceNotify; ev.type = DevicePresenceNotify;
ev.time = currentTime.milliseconds; ev.time = currentTime.milliseconds;
ev.devchange = DeviceAdded; ev.devchange = DeviceAdded;
@ -391,7 +391,7 @@ CoreKeyboardCtl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
} }
/** /**
* Device control function for the Virtual Core Keyboard. * Device control function for the Virtual Core Keyboard.
*/ */
static int static int
CoreKeyboardProc(DeviceIntPtr pDev, int what) CoreKeyboardProc(DeviceIntPtr pDev, int what)
@ -475,7 +475,7 @@ CoreKeyboardProc(DeviceIntPtr pDev, int what)
/** /**
* Device control function for the Virtual Core Pointer. * Device control function for the Virtual Core Pointer.
* *
* Aside from initialisation, it backs up the original device classes into the * Aside from initialisation, it backs up the original device classes into the
* devicePrivates. This only needs to be done for master devices. * devicePrivates. This only needs to be done for master devices.
*/ */
@ -492,7 +492,7 @@ CorePointerProc(DeviceIntPtr pDev, int what)
if (MasterDevClassesPrivIdx == -1) if (MasterDevClassesPrivIdx == -1)
MasterDevClassesPrivIdx = AllocateDevicePrivateIndex(); MasterDevClassesPrivIdx = AllocateDevicePrivateIndex();
if (!AllocateDevicePrivate(pDev, MasterDevClassesPrivIdx) || if (!AllocateDevicePrivate(pDev, MasterDevClassesPrivIdx) ||
!(classes = xcalloc(1, sizeof(ClassesRec)))) !(classes = xcalloc(1, sizeof(ClassesRec))))
return BadAlloc; return BadAlloc;
@ -553,8 +553,8 @@ InitCoreDevices(void)
CoreDevicePrivatesGeneration = serverGeneration; CoreDevicePrivatesGeneration = serverGeneration;
} }
if (AllocMasterDevice("Virtual core", if (AllocMasterDevice("Virtual core",
&inputInfo.pointer, &inputInfo.pointer,
&inputInfo.keyboard) == BadAlloc) &inputInfo.keyboard) == BadAlloc)
FatalError("Failed to allocate core devices"); FatalError("Failed to allocate core devices");
@ -573,14 +573,14 @@ InitCoreDevices(void)
/** /**
* Activate all switched-off devices and then enable all those devices. * Activate all switched-off devices and then enable all those devices.
* *
* Will return an error if no core keyboard or core pointer is present. * Will return an error if no core keyboard or core pointer is present.
* In theory this should never happen if you call InitCoreDevices() first. * In theory this should never happen if you call InitCoreDevices() first.
* *
* InitAndStartDevices needs to be called AFTER the windows are initialized. * InitAndStartDevices needs to be called AFTER the windows are initialized.
* Devices will start sending events after InitAndStartDevices() has * Devices will start sending events after InitAndStartDevices() has
* completed. * completed.
* *
* @return Success or error code on failure. * @return Success or error code on failure.
*/ */
int int
@ -621,7 +621,7 @@ InitAndStartDevices(WindowPtr root)
} }
/** /**
* Close down a device and free all resources. * Close down a device and free all resources.
* Once closed down, the driver will probably not expect you that you'll ever * Once closed down, the driver will probably not expect you that you'll ever
* enable it again and free associated structs. If you want the device to just * enable it again and free associated structs. If you want the device to just
* be disabled, DisableDevice(). * be disabled, DisableDevice().
@ -654,7 +654,7 @@ CloseDevice(DeviceIntPtr dev)
if (dev->isMaster) if (dev->isMaster)
classes = (ClassesPtr)dev->devPrivates[MasterDevClassesPrivIdx].ptr; classes = (ClassesPtr)dev->devPrivates[MasterDevClassesPrivIdx].ptr;
else else
classes = (ClassesPtr)&dev->key; classes = (ClassesPtr)&dev->key;
if (classes->key) { if (classes->key) {
@ -704,7 +704,7 @@ CloseDevice(DeviceIntPtr dev)
pnext = p->next; pnext = p->next;
xfree(p); xfree(p);
} }
for (i = classes->intfeed; i; i = inext) { for (i = classes->intfeed; i; i = inext) {
inext = i->next; inext = i->next;
xfree(i); xfree(i);
@ -735,7 +735,7 @@ CloseDevice(DeviceIntPtr dev)
while (dev->xkb_interest) while (dev->xkb_interest)
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource); XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
#endif #endif
if (DevHasCursor(dev)) { if (DevHasCursor(dev)) {
xfree(dev->spriteInfo->sprite->spriteTrace); xfree(dev->spriteInfo->sprite->spriteTrace);
xfree(dev->spriteInfo->sprite); xfree(dev->spriteInfo->sprite);
@ -759,7 +759,7 @@ CloseDevice(DeviceIntPtr dev)
} }
/** /**
* Shut down all devices, free all resources, etc. * Shut down all devices, free all resources, etc.
* Only useful if you're shutting down the server! * Only useful if you're shutting down the server!
*/ */
void void
@ -788,7 +788,7 @@ CloseDownDevices(void)
* Remove the cursor sprite for all devices. This needs to be done before any * Remove the cursor sprite for all devices. This needs to be done before any
* resources are freed or any device is deleted. * resources are freed or any device is deleted.
*/ */
void void
UndisplayDevices() UndisplayDevices()
{ {
DeviceIntPtr dev; DeviceIntPtr dev;
@ -802,7 +802,7 @@ UndisplayDevices()
/** /**
* Remove a device from the device list, closes it and thus frees all * Remove a device from the device list, closes it and thus frees all
* resources. * resources.
* Removes both enabled and disabled devices and notifies all devices about * Removes both enabled and disabled devices and notifies all devices about
* the removal of the device. * the removal of the device.
*/ */
@ -855,7 +855,7 @@ RemoveDevice(DeviceIntPtr dev)
ret = Success; ret = Success;
} }
} }
if (ret == Success) { if (ret == Success) {
inputInfo.numDevices--; inputInfo.numDevices--;
ev.type = DevicePresenceNotify; ev.type = DevicePresenceNotify;
@ -873,7 +873,7 @@ RemoveDevice(DeviceIntPtr dev)
int int
NumMotionEvents(void) NumMotionEvents(void)
{ {
/* only called to fill data in initial connection reply. /* only called to fill data in initial connection reply.
* VCP is ok here, it is the only fixed device we have. */ * VCP is ok here, it is the only fixed device we have. */
return inputInfo.pointer->valuator->numMotionEvents; return inputInfo.pointer->valuator->numMotionEvents;
} }
@ -1023,7 +1023,7 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers
{ {
int i; int i;
KeyClassPtr keyc; KeyClassPtr keyc;
keyc = (KeyClassPtr)xalloc(sizeof(KeyClassRec)); keyc = (KeyClassPtr)xalloc(sizeof(KeyClassRec));
if (!keyc) if (!keyc)
return FALSE; return FALSE;
@ -1058,7 +1058,7 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers
} }
_X_EXPORT Bool _X_EXPORT Bool
InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons,
CARD8 *map) CARD8 *map)
{ {
ButtonClassPtr butc; ButtonClassPtr butc;
@ -1082,8 +1082,8 @@ InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons,
} }
_X_EXPORT Bool _X_EXPORT Bool
InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes,
ValuatorMotionProcPtr motionProc, ValuatorMotionProcPtr motionProc,
int numMotionEvents, int mode) int numMotionEvents, int mode)
{ {
int i; int i;
@ -1176,7 +1176,7 @@ InitFocusClassDeviceStruct(DeviceIntPtr dev)
} }
_X_EXPORT Bool _X_EXPORT Bool
InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc,
KbdCtrlProcPtr controlProc) KbdCtrlProcPtr controlProc)
{ {
KbdFeedbackPtr feedc; KbdFeedbackPtr feedc;
@ -1240,7 +1240,7 @@ static IntegerCtrl defaultIntegerControl = {
_X_EXPORT Bool _X_EXPORT Bool
InitStringFeedbackClassDeviceStruct ( InitStringFeedbackClassDeviceStruct (
DeviceIntPtr dev, StringCtrlProcPtr controlProc, DeviceIntPtr dev, StringCtrlProcPtr controlProc,
int max_symbols, int num_symbols_supported, KeySym *symbols) int max_symbols, int num_symbols_supported, KeySym *symbols)
{ {
int i; int i;
@ -1253,9 +1253,9 @@ InitStringFeedbackClassDeviceStruct (
feedc->ctrl.num_symbols_supported = num_symbols_supported; feedc->ctrl.num_symbols_supported = num_symbols_supported;
feedc->ctrl.num_symbols_displayed = 0; feedc->ctrl.num_symbols_displayed = 0;
feedc->ctrl.max_symbols = max_symbols; feedc->ctrl.max_symbols = max_symbols;
feedc->ctrl.symbols_supported = (KeySym *) feedc->ctrl.symbols_supported = (KeySym *)
xalloc (sizeof (KeySym) * num_symbols_supported); xalloc (sizeof (KeySym) * num_symbols_supported);
feedc->ctrl.symbols_displayed = (KeySym *) feedc->ctrl.symbols_displayed = (KeySym *)
xalloc (sizeof (KeySym) * max_symbols); xalloc (sizeof (KeySym) * max_symbols);
if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed) if (!feedc->ctrl.symbols_supported || !feedc->ctrl.symbols_displayed)
{ {
@ -1279,7 +1279,7 @@ InitStringFeedbackClassDeviceStruct (
} }
_X_EXPORT Bool _X_EXPORT Bool
InitBellFeedbackClassDeviceStruct (DeviceIntPtr dev, BellProcPtr bellProc, InitBellFeedbackClassDeviceStruct (DeviceIntPtr dev, BellProcPtr bellProc,
BellCtrlProcPtr controlProc) BellCtrlProcPtr controlProc)
{ {
BellFeedbackPtr feedc; BellFeedbackPtr feedc;
@ -1338,8 +1338,8 @@ InitIntegerFeedbackClassDeviceStruct (DeviceIntPtr dev, IntegerCtrlProcPtr contr
} }
_X_EXPORT Bool _X_EXPORT Bool
InitPointerDeviceStruct(DevicePtr device, CARD8 *map, int numButtons, InitPointerDeviceStruct(DevicePtr device, CARD8 *map, int numButtons,
ValuatorMotionProcPtr motionProc, ValuatorMotionProcPtr motionProc,
PtrCtrlProcPtr controlProc, int numMotionEvents, PtrCtrlProcPtr controlProc, int numMotionEvents,
int numAxes) int numAxes)
{ {
@ -1352,9 +1352,9 @@ InitPointerDeviceStruct(DevicePtr device, CARD8 *map, int numButtons,
} }
_X_EXPORT Bool _X_EXPORT Bool
InitKeyboardDeviceStruct(DevicePtr device, KeySymsPtr pKeySyms, InitKeyboardDeviceStruct(DevicePtr device, KeySymsPtr pKeySyms,
CARD8 pModifiers[], BellProcPtr bellProc, CARD8 pModifiers[], BellProcPtr bellProc,
KbdCtrlProcPtr controlProc) KbdCtrlProcPtr controlProc)
{ {
DeviceIntPtr dev = (DeviceIntPtr)device; DeviceIntPtr dev = (DeviceIntPtr)device;
@ -1525,13 +1525,13 @@ DoSetModifierMapping(ClientPtr client, KeyCode *inputMap,
return Success; return Success;
} }
int int
ProcSetModifierMapping(ClientPtr client) ProcSetModifierMapping(ClientPtr client)
{ {
xSetModifierMappingReply rep; xSetModifierMappingReply rep;
DeviceIntPtr dev; DeviceIntPtr dev;
REQUEST(xSetModifierMappingReq); REQUEST(xSetModifierMappingReq);
REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq); REQUEST_AT_LEAST_SIZE(xSetModifierMappingReq);
if (client->req_len != ((stuff->numKeyPerModifier << 1) + if (client->req_len != ((stuff->numKeyPerModifier << 1) +
@ -1583,7 +1583,7 @@ ProcChangeKeyboardMapping(ClientPtr client)
DeviceIntPtr pDev = NULL; DeviceIntPtr pDev = NULL;
REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
len = client->req_len - (sizeof(xChangeKeyboardMappingReq) >> 2); len = client->req_len - (sizeof(xChangeKeyboardMappingReq) >> 2);
if (len != (stuff->keyCodes * stuff->keySymsPerKeyCode)) if (len != (stuff->keyCodes * stuff->keySymsPerKeyCode))
return BadLength; return BadLength;
@ -1671,7 +1671,7 @@ ProcSetPointerMapping(ClientPtr client)
rep.sequenceNumber = client->sequence; rep.sequenceNumber = client->sequence;
rep.success = MappingSuccess; rep.success = MappingSuccess;
map = (BYTE *)&stuff[1]; map = (BYTE *)&stuff[1];
/* So we're bounded here by the number of core buttons. This check /* So we're bounded here by the number of core buttons. This check
* probably wants disabling through XFixes. */ * probably wants disabling through XFixes. */
/* MPX: With ClientPointer, we can return the right number of buttons. /* MPX: With ClientPointer, we can return the right number of buttons.
@ -1750,7 +1750,7 @@ ProcGetPointerMapping(ClientPtr client)
rep.length = ((unsigned)rep.nElts + (4-1))/4; rep.length = ((unsigned)rep.nElts + (4-1))/4;
WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep); WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep);
(void)WriteToClient(client, (int)rep.nElts, (char *)&butc->map[1]); (void)WriteToClient(client, (int)rep.nElts, (char *)&butc->map[1]);
return Success; return Success;
} }
void void
@ -1790,7 +1790,7 @@ DoChangeKeyboardControl (ClientPtr client, DeviceIntPtr keybd, XID *vlist,
index2 = (BITS32) lowbit (vmask); index2 = (BITS32) lowbit (vmask);
vmask &= ~index2; vmask &= ~index2;
switch (index2) { switch (index2) {
case KBKeyClickPercent: case KBKeyClickPercent:
t = (INT8)*vlist; t = (INT8)*vlist;
vlist++; vlist++;
if (t == -1) { if (t == -1) {
@ -1940,7 +1940,7 @@ DoChangeKeyboardControl (ClientPtr client, DeviceIntPtr keybd, XID *vlist,
return Success; return Success;
#undef DO_ALL #undef DO_ALL
} }
int int
ProcChangeKeyboardControl (ClientPtr client) ProcChangeKeyboardControl (ClientPtr client)
@ -2000,7 +2000,7 @@ ProcGetKeyboardControl (ClientPtr client)
rep.map[i] = ctrl->autoRepeats[i]; rep.map[i] = ctrl->autoRepeats[i];
WriteReplyToClient(client, sizeof(xGetKeyboardControlReply), &rep); WriteReplyToClient(client, sizeof(xGetKeyboardControlReply), &rep);
return Success; return Success;
} }
int int
ProcBell(ClientPtr client) ProcBell(ClientPtr client)
@ -2013,7 +2013,7 @@ ProcBell(ClientPtr client)
if (!keybd->kbdfeed->BellProc) if (!keybd->kbdfeed->BellProc)
return BadDevice; return BadDevice;
if (stuff->percent < -100 || stuff->percent > 100) { if (stuff->percent < -100 || stuff->percent > 100) {
client->errorValue = stuff->percent; client->errorValue = stuff->percent;
return BadValue; return BadValue;
@ -2023,7 +2023,7 @@ ProcBell(ClientPtr client)
if (stuff->percent < 0) if (stuff->percent < 0)
newpercent = base + newpercent; newpercent = base + newpercent;
else else
newpercent = base - newpercent + stuff->percent; newpercent = base - newpercent + stuff->percent;
for (keybd = inputInfo.devices; keybd; keybd = keybd->next) { for (keybd = inputInfo.devices; keybd; keybd = keybd->next) {
if ((keybd->coreEvents || keybd == inputInfo.keyboard) && if ((keybd->coreEvents || keybd == inputInfo.keyboard) &&
@ -2040,7 +2040,7 @@ ProcBell(ClientPtr client)
} }
return Success; return Success;
} }
int int
ProcChangePointerControl(ClientPtr client) ProcChangePointerControl(ClientPtr client)
@ -2050,10 +2050,10 @@ ProcChangePointerControl(ClientPtr client)
REQUEST(xChangePointerControlReq); REQUEST(xChangePointerControlReq);
REQUEST_SIZE_MATCH(xChangePointerControlReq); REQUEST_SIZE_MATCH(xChangePointerControlReq);
if (!mouse->ptrfeed->CtrlProc) if (!mouse->ptrfeed->CtrlProc)
return BadDevice; return BadDevice;
ctrl = mouse->ptrfeed->ctrl; ctrl = mouse->ptrfeed->ctrl;
if ((stuff->doAccel != xTrue) && (stuff->doAccel != xFalse)) { if ((stuff->doAccel != xTrue) && (stuff->doAccel != xFalse)) {
client->errorValue = stuff->doAccel; client->errorValue = stuff->doAccel;
@ -2109,7 +2109,7 @@ ProcChangePointerControl(ClientPtr client)
} }
return Success; return Success;
} }
int int
ProcGetPointerControl(ClientPtr client) ProcGetPointerControl(ClientPtr client)
@ -2231,17 +2231,17 @@ ProcQueryKeymap(ClientPtr client)
bzero((char *)&rep.map[0], 32); bzero((char *)&rep.map[0], 32);
WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep); WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep);
return Success; return Success;
} }
/* Pair the keyboard to the pointer device. Keyboard events will follow the /* Pair the keyboard to the pointer device. Keyboard events will follow the
* pointer sprite. Only applicable for master devices. * pointer sprite. Only applicable for master devices.
* If the client is set, the request to pair comes from some client. In this * If the client is set, the request to pair comes from some client. In this
* case, we need to check for access. If the client is NULL, it's from an * case, we need to check for access. If the client is NULL, it's from an
* internal automatic pairing, we must always permit this. * internal automatic pairing, we must always permit this.
*/ */
int int
PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd) PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
{ {
if (!ptr) if (!ptr)
@ -2277,15 +2277,15 @@ PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd)
* Client is set to the client that issued the request, or NULL if it comes * Client is set to the client that issued the request, or NULL if it comes
* from some internal automatic pairing. * from some internal automatic pairing.
* *
* Master may be NULL to set the device floating. * Master may be NULL to set the device floating.
* *
* We don't allow multi-layer hierarchies right now. You can't attach a slave * We don't allow multi-layer hierarchies right now. You can't attach a slave
* to another slave. * to another slave.
*/ */
int int
AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master) AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
{ {
if (!dev || dev->isMaster) if (!dev || dev->isMaster)
return BadDevice; return BadDevice;
if (master && !master->isMaster) /* can't attach to slaves */ if (master && !master->isMaster) /* can't attach to slaves */
@ -2345,13 +2345,13 @@ AttachDevice(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr master)
/* Send event to clients */ /* Send event to clients */
CreateClassesChangedEvent(&event, master, master); CreateClassesChangedEvent(&event, master, master);
deviceClassesChangedEvent *dcce = deviceClassesChangedEvent *dcce =
(deviceClassesChangedEvent*)event.event; (deviceClassesChangedEvent*)event.event;
dcce->deviceid = master->id; dcce->deviceid = master->id;
dcce->num_classes = 0; dcce->num_classes = 0;
classbuf = (char*)&event.event[1]; classbuf = (char*)&event.event[1];
CopySwapClasses(NullClient, master, &dcce->num_classes, &classbuf); CopySwapClasses(NullClient, master, &dcce->num_classes, &classbuf);
SendEventToAllWindows(master, XI_DeviceClassesChangedMask, SendEventToAllWindows(master, XI_DeviceClassesChangedMask,
event.event, 1); event.event, 1);
xfree(event.event); xfree(event.event);
} }
@ -2380,7 +2380,7 @@ GetPairedDevice(DeviceIntPtr dev)
} }
/* /*
* Register a client to be able to pair devices. * Register a client to be able to pair devices.
*/ */
Bool Bool
RegisterPairingClient(ClientPtr client) RegisterPairingClient(ClientPtr client)
@ -2398,22 +2398,22 @@ RegisterPairingClient(ClientPtr client)
/* /*
* Unregister pairing client; * Unregister pairing client;
*/ */
Bool Bool
UnregisterPairingClient(ClientPtr client) UnregisterPairingClient(ClientPtr client)
{ {
if (pairingClient) if (pairingClient)
{ {
if ( pairingClient == client) if ( pairingClient == client)
{ {
pairingClient = NULL; pairingClient = NULL;
} else } else
return False; return False;
} }
return True; return True;
} }
/* Guess a pointer that could be a good one for pairing. Any pointer that is /* Guess a pointer that could be a good one for pairing. Any pointer that is
* not yet paired with keyboard is considered a good one. * not yet paired with keyboard is considered a good one.
* If no pointer is found, the last real pointer is chosen. If that doesn't * If no pointer is found, the last real pointer is chosen. If that doesn't
* work either, we take the core pointer. * work either, we take the core pointer.
*/ */
@ -2422,7 +2422,7 @@ GuessFreePointerDevice()
{ {
DeviceIntPtr it, it2; DeviceIntPtr it, it2;
DeviceIntPtr lastRealPtr = NULL; DeviceIntPtr lastRealPtr = NULL;
it = inputInfo.devices; it = inputInfo.devices;
while(it) while(it)
@ -2436,7 +2436,7 @@ GuessFreePointerDevice()
while(it2) while(it2)
{ {
/* something paired with it? */ /* something paired with it? */
if (it != it2 && if (it != it2 &&
it2->spriteInfo->sprite == it->spriteInfo->sprite) it2->spriteInfo->sprite == it->spriteInfo->sprite)
break; break;
@ -2458,8 +2458,8 @@ NextFreePointerDevice()
{ {
DeviceIntPtr dev; DeviceIntPtr dev;
for (dev = inputInfo.devices; dev; dev = dev->next) for (dev = inputInfo.devices; dev; dev = dev->next)
if (dev->isMaster && if (dev->isMaster &&
dev->spriteInfo->spriteOwner && dev->spriteInfo->spriteOwner &&
!dev->spriteInfo->paired) !dev->spriteInfo->paired)
return dev; return dev;
return NULL; return NULL;

File diff suppressed because it is too large Load Diff