Xi: remove trailing whitespaces.
This commit is contained in:
parent
5031238aad
commit
e96d926d64
|
@ -50,9 +50,9 @@ from the author.
|
|||
* This procedure allows a client to change window access control.
|
||||
*/
|
||||
|
||||
int
|
||||
int
|
||||
SProcXChangeWindowAccess(ClientPtr client)
|
||||
{
|
||||
{
|
||||
char n;
|
||||
REQUEST(xChangeWindowAccessReq);
|
||||
|
||||
|
@ -61,7 +61,7 @@ SProcXChangeWindowAccess(ClientPtr client)
|
|||
return ProcXChangeWindowAccess(client);
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
ProcXChangeWindowAccess(ClientPtr client)
|
||||
{
|
||||
int padding, err, i;
|
||||
|
@ -71,14 +71,14 @@ ProcXChangeWindowAccess(ClientPtr client)
|
|||
DeviceIntPtr* deny_devices = NULL;
|
||||
REQUEST(xChangeWindowAccessReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeWindowAccessReq);
|
||||
|
||||
|
||||
|
||||
padding = (4 - (((stuff->npermit + stuff->ndeny) * sizeof(XID)) % 4)) % 4;
|
||||
|
||||
if (stuff->length != ((sizeof(xChangeWindowAccessReq) +
|
||||
if (stuff->length != ((sizeof(xChangeWindowAccessReq) +
|
||||
(((stuff->npermit + stuff->ndeny) * sizeof(XID)) + padding)) >> 2))
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ ProcXChangeWindowAccess(ClientPtr client)
|
|||
err = dixLookupWindow(&win, stuff->win, client, DixWriteAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
stuff->win, err);
|
||||
return Success;
|
||||
}
|
||||
|
@ -106,12 +106,12 @@ ProcXChangeWindowAccess(ClientPtr client)
|
|||
|
||||
if (stuff->npermit)
|
||||
{
|
||||
perm_devices =
|
||||
perm_devices =
|
||||
(DeviceIntPtr*)xalloc(stuff->npermit * sizeof(DeviceIntPtr));
|
||||
if (!perm_devices)
|
||||
{
|
||||
ErrorF("[Xi] ProcXChangeWindowAccess: alloc failure.\n");
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 0,
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 0,
|
||||
BadImplementation);
|
||||
return Success;
|
||||
}
|
||||
|
@ -123,8 +123,8 @@ ProcXChangeWindowAccess(ClientPtr client)
|
|||
if (!perm_devices[i])
|
||||
{
|
||||
xfree(perm_devices);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
deviceids[i], BadDevice);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
deviceids[i], BadDevice);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
@ -132,12 +132,12 @@ ProcXChangeWindowAccess(ClientPtr client)
|
|||
|
||||
if (stuff->ndeny)
|
||||
{
|
||||
deny_devices =
|
||||
deny_devices =
|
||||
(DeviceIntPtr*)xalloc(stuff->ndeny * sizeof(DeviceIntPtr));
|
||||
if (!deny_devices)
|
||||
{
|
||||
ErrorF("[Xi] ProcXChangeWindowAccecss: alloc failure.\n");
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 0,
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess, 0,
|
||||
BadImplementation);
|
||||
|
||||
xfree(perm_devices);
|
||||
|
@ -146,15 +146,15 @@ ProcXChangeWindowAccess(ClientPtr client)
|
|||
|
||||
for (i = 0; i < stuff->ndeny; i++)
|
||||
{
|
||||
deny_devices[i] =
|
||||
deny_devices[i] =
|
||||
LookupDeviceIntRec(deviceids[i+stuff->npermit]);
|
||||
|
||||
|
||||
if (!deny_devices[i])
|
||||
{
|
||||
xfree(perm_devices);
|
||||
xfree(deny_devices);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
deviceids[i + stuff->npermit], BadDevice);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
deviceids[i + stuff->npermit], BadDevice);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
@ -165,11 +165,11 @@ ProcXChangeWindowAccess(ClientPtr client)
|
|||
deny_devices, stuff->ndeny);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
|
||||
stuff->win, err);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
xfree(perm_devices);
|
||||
xfree(deny_devices);
|
||||
return Success;
|
||||
|
|
|
@ -82,7 +82,7 @@ int ProcXChangeDeviceCursor(ClientPtr client)
|
|||
pDev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (pDev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor, 0,
|
||||
BadDevice);
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ int ProcXChangeDeviceCursor(ClientPtr client)
|
|||
err = dixLookupWindow(&pWin, stuff->win, client, DixReadWriteAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
|
||||
stuff->win, err);
|
||||
return Success;
|
||||
}
|
||||
|
@ -103,18 +103,18 @@ int ProcXChangeDeviceCursor(ClientPtr client)
|
|||
pCursor = rootCursor;
|
||||
else
|
||||
pCursor = (CursorPtr)None;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
|
||||
RT_CURSOR, DixReadAccess);
|
||||
RT_CURSOR, DixReadAccess);
|
||||
if (!pCursor)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceCursor,
|
||||
stuff->cursor, BadCursor);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChangeWindowDeviceCursor(pWin, pDev, pCursor);
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
|
||||
/* XXX: check if client is allowed to change hierarch */
|
||||
|
||||
|
||||
|
||||
any = (xAnyHierarchyChangeInfo*)&stuff[1];
|
||||
while(stuff->num_changes--)
|
||||
{
|
||||
|
@ -108,7 +108,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
xCreateMasterInfo* c = (xCreateMasterInfo*)any;
|
||||
char* name;
|
||||
int ret;
|
||||
|
||||
|
||||
SWAPIF(swaps(&c->namelen, n));
|
||||
name = xcalloc(c->namelen + 1, sizeof(char));
|
||||
strncpy(name, (char*)&c[1], c->namelen);
|
||||
|
@ -138,7 +138,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
{
|
||||
xRemoveMasterInfo* r = (xRemoveMasterInfo*)any;
|
||||
|
||||
if (r->returnMode != AttachToMaster &&
|
||||
if (r->returnMode != AttachToMaster &&
|
||||
r->returnMode != Floating)
|
||||
return BadValue;
|
||||
|
||||
|
@ -164,8 +164,8 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
* desired. */
|
||||
if (r->returnMode == AttachToMaster)
|
||||
{
|
||||
DeviceIntPtr attached,
|
||||
newptr,
|
||||
DeviceIntPtr attached,
|
||||
newptr,
|
||||
newkeybd;
|
||||
|
||||
newptr = LookupDeviceIntRec(r->returnPointer);
|
||||
|
@ -174,8 +174,8 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
!newkeybd || !newkeybd->isMaster)
|
||||
return BadDevice;
|
||||
|
||||
for (attached = inputInfo.devices;
|
||||
attached;
|
||||
for (attached = inputInfo.devices;
|
||||
attached;
|
||||
attached = attached->next)
|
||||
{
|
||||
if (!attached->isMaster) {
|
||||
|
@ -216,7 +216,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
if ((IsPointerDevice(newmaster) &&
|
||||
!IsPointerDevice(ptr)) ||
|
||||
(IsKeyboardDevice(newmaster) &&
|
||||
!IsKeyboardDevice(ptr)))
|
||||
!IsKeyboardDevice(ptr)))
|
||||
return BadDevice;
|
||||
AttachDevice(client, ptr, newmaster);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
ev.evtype = XI_DeviceHierarchyChangedNotify;
|
||||
ev.time = GetTimeInMillis();
|
||||
|
||||
SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask,
|
||||
SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask,
|
||||
(xEvent*)&ev, 1);
|
||||
return Success;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ ProcXChangePointerKeyboardPairing(ClientPtr client)
|
|||
{
|
||||
DeviceIntPtr pPointer, pKeyboard;
|
||||
int ret;
|
||||
pairingChangedNotify ev;
|
||||
pairingChangedNotify ev;
|
||||
|
||||
REQUEST(xChangePointerKeyboardPairingReq);
|
||||
REQUEST_SIZE_MATCH(xChangePointerKeyboardPairingReq);
|
||||
|
@ -87,16 +87,16 @@ ProcXChangePointerKeyboardPairing(ClientPtr client)
|
|||
pPointer = LookupDeviceIntRec(stuff->pointer);
|
||||
if (pPointer == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
|
||||
stuff->pointer, BadDevice);
|
||||
SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
|
||||
stuff->pointer, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
pKeyboard = LookupDeviceIntRec(stuff->keyboard);
|
||||
if (pKeyboard == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
|
||||
stuff->keyboard, BadDevice);
|
||||
SendErrorToClient(client, IReqCode, X_ChangePointerKeyboardPairing,
|
||||
stuff->keyboard, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -116,15 +116,15 @@ ProcXChangePointerKeyboardPairing(ClientPtr client)
|
|||
ev.keyboard = pKeyboard->id;
|
||||
ev.length = 0;
|
||||
ev.time = currentTime.milliseconds;
|
||||
SendEventToAllWindows(inputInfo.pointer,
|
||||
SendEventToAllWindows(inputInfo.pointer,
|
||||
XI_PointerKeyboardPairingChangedMask,
|
||||
(xEvent*)&ev, 1);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/* Event swap proc */
|
||||
void
|
||||
SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
|
||||
void
|
||||
SPointerKeyboardPairingChangedNotifyEvent (pairingChangedNotify *from,
|
||||
pairingChangedNotify *to)
|
||||
{
|
||||
char n;
|
||||
|
|
|
@ -154,7 +154,7 @@ ProcXCloseDevice(ClientPtr client)
|
|||
if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
|
||||
(*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
|
||||
|
||||
/* Remove event selections from all windows for events from this device
|
||||
/* Remove event selections from all windows for events from this device
|
||||
* and selected by this client.
|
||||
* Delete passive grabs from all windows for this device. */
|
||||
|
||||
|
|
|
@ -103,10 +103,10 @@ RegisterOtherDevice(DeviceIntPtr device)
|
|||
}
|
||||
|
||||
/**
|
||||
* Main device event processing function.
|
||||
* Called from when processing the events from the event queue.
|
||||
* Main device event processing function.
|
||||
* Called from when processing the events from the event queue.
|
||||
* Generates core events for XI events as needed.
|
||||
*
|
||||
*
|
||||
* Note that these core events are then delivered first. For passive grabs, XI
|
||||
* events have preference over core.
|
||||
*/
|
||||
|
@ -309,7 +309,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
|
|||
}
|
||||
}
|
||||
|
||||
if (device->deviceGrab.fromPassiveGrab &&
|
||||
if (device->deviceGrab.fromPassiveGrab &&
|
||||
(key == device->deviceGrab.activatingKey))
|
||||
deactivateDeviceGrab = TRUE;
|
||||
} else if (xE->u.u.type == DeviceButtonPress) {
|
||||
|
@ -357,7 +357,7 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr device, int count)
|
|||
if (xE->u.u.detail <= 5)
|
||||
b->state &= ~((Button1Mask >> 1) << xE->u.u.detail);
|
||||
SetMaskForEvent(Motion_Filter(b), DeviceMotionNotify);
|
||||
if (!b->state
|
||||
if (!b->state
|
||||
&& device->deviceGrab.fromPassiveGrab)
|
||||
deactivateDeviceGrab = TRUE;
|
||||
} else if (xE->u.u.type == ProximityIn)
|
||||
|
@ -413,7 +413,7 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
|
|||
int resolution, int min_res, int max_res)
|
||||
{
|
||||
AxisInfoPtr ax;
|
||||
|
||||
|
||||
if (!dev || !dev->valuator)
|
||||
return;
|
||||
|
||||
|
@ -1122,7 +1122,7 @@ DeleteDeviceFromAnyExtEvents(WindowPtr pWin, DeviceIntPtr dev)
|
|||
if (dev->deviceGrab.grab && (dev->deviceGrab.grab->window == pWin))
|
||||
(*dev->deviceGrab.DeactivateGrab) (dev);
|
||||
|
||||
/* If the focus window is a root window (ie. has no parent)
|
||||
/* If the focus window is a root window (ie. has no parent)
|
||||
* then don't delete the focus from it. */
|
||||
|
||||
if (dev->focus && (pWin == dev->focus->win) && (pWin->parent != NullWindow)) {
|
||||
|
|
|
@ -55,7 +55,7 @@ from the author.
|
|||
|
||||
#include "extgrbdev.h"
|
||||
|
||||
int
|
||||
int
|
||||
SProcXExtendedGrabDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
@ -89,15 +89,15 @@ SProcXExtendedGrabDevice(ClientPtr client)
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
int
|
||||
ProcXExtendedGrabDevice(ClientPtr client)
|
||||
{
|
||||
xExtendedGrabDeviceReply rep;
|
||||
DeviceIntPtr dev;
|
||||
int err = Success,
|
||||
int err = Success,
|
||||
errval = 0,
|
||||
i;
|
||||
WindowPtr grab_window,
|
||||
WindowPtr grab_window,
|
||||
confineTo = 0;
|
||||
CursorPtr cursor = NULL;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
|
@ -119,7 +119,7 @@ ProcXExtendedGrabDevice(ClientPtr client)
|
|||
rep.length = 0;
|
||||
|
||||
if (!stuff->ungrab && /* other fields are undefined for ungrab */
|
||||
(stuff->length != (sizeof(xExtendedGrabDeviceReq) >> 2) +
|
||||
(stuff->length != (sizeof(xExtendedGrabDeviceReq) >> 2) +
|
||||
stuff->event_count + 2 * stuff->generic_event_count))
|
||||
{
|
||||
errval = 0;
|
||||
|
@ -141,21 +141,21 @@ ProcXExtendedGrabDevice(ClientPtr client)
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
err = dixLookupWindow(&grab_window,
|
||||
stuff->grab_window,
|
||||
client,
|
||||
err = dixLookupWindow(&grab_window,
|
||||
stuff->grab_window,
|
||||
client,
|
||||
DixReadAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
errval = stuff->grab_window;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
||||
if (stuff->confine_to)
|
||||
{
|
||||
err = dixLookupWindow(&confineTo,
|
||||
stuff->confine_to,
|
||||
client,
|
||||
err = dixLookupWindow(&confineTo,
|
||||
stuff->confine_to,
|
||||
client,
|
||||
DixReadAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
|
@ -166,10 +166,10 @@ ProcXExtendedGrabDevice(ClientPtr client)
|
|||
|
||||
if (stuff->cursor)
|
||||
{
|
||||
cursor = (CursorPtr)SecurityLookupIDByType(client,
|
||||
cursor = (CursorPtr)SecurityLookupIDByType(client,
|
||||
stuff->cursor,
|
||||
RT_CURSOR,
|
||||
DixReadAccess);
|
||||
RT_CURSOR,
|
||||
DixReadAccess);
|
||||
if (!cursor)
|
||||
{
|
||||
errval = stuff->cursor;
|
||||
|
@ -178,11 +178,11 @@ ProcXExtendedGrabDevice(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
if (CreateMaskFromList(client,
|
||||
if (CreateMaskFromList(client,
|
||||
(XEventClass*)&stuff[1],
|
||||
stuff->event_count,
|
||||
tmp,
|
||||
dev,
|
||||
stuff->event_count,
|
||||
tmp,
|
||||
dev,
|
||||
X_GrabDevice) != Success)
|
||||
return Success;
|
||||
|
||||
|
@ -190,7 +190,7 @@ ProcXExtendedGrabDevice(ClientPtr client)
|
|||
|
||||
if (stuff->generic_event_count)
|
||||
{
|
||||
xgeMask =
|
||||
xgeMask =
|
||||
(XGenericEventMask*)(((XEventClass*)&stuff[1]) + stuff->event_count);
|
||||
|
||||
gemasks = xcalloc(1, sizeof(GenericMaskRec));
|
||||
|
@ -203,16 +203,16 @@ ProcXExtendedGrabDevice(ClientPtr client)
|
|||
gemasks->eventMask[xgeMask->extension & 0x7F]= xgeMask->evmask;
|
||||
}
|
||||
|
||||
ExtGrabDevice(client, dev, stuff->device_mode,
|
||||
grab_window, confineTo, time, stuff->owner_events,
|
||||
cursor, tmp[stuff->deviceid].mask,
|
||||
ExtGrabDevice(client, dev, stuff->device_mode,
|
||||
grab_window, confineTo, time, stuff->owner_events,
|
||||
cursor, tmp[stuff->deviceid].mask,
|
||||
gemasks);
|
||||
|
||||
if (err != Success) {
|
||||
errval = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
||||
cleanup:
|
||||
|
||||
if (gemasks)
|
||||
|
@ -221,18 +221,18 @@ cleanup:
|
|||
if (err == Success)
|
||||
{
|
||||
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
SendErrorToClient(client, IReqCode,
|
||||
X_ExtendedGrabDevice,
|
||||
SendErrorToClient(client, IReqCode,
|
||||
X_ExtendedGrabDevice,
|
||||
errval, err);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
void
|
||||
SRepXExtendedGrabDevice(ClientPtr client, int size,
|
||||
SRepXExtendedGrabDevice(ClientPtr client, int size,
|
||||
xExtendedGrabDeviceReply* rep)
|
||||
{
|
||||
char n;
|
||||
|
|
26
Xi/extinit.c
26
Xi/extinit.c
|
@ -133,7 +133,7 @@ Mask ExtExclusiveMasks[EMASKSIZE];
|
|||
|
||||
|
||||
/**
|
||||
* Filters for various generic events.
|
||||
* Filters for various generic events.
|
||||
* Evtype is index, mask is value at index.
|
||||
*/
|
||||
static Mask xi_filters[3] = {
|
||||
|
@ -355,7 +355,7 @@ ProcIDispatch(ClientPtr client)
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SProcXDispatch
|
||||
* SProcXDispatch
|
||||
*
|
||||
* Main swapped dispatch routine for requests to this extension.
|
||||
* This routine is used if server and client do not have the same byte ordering.
|
||||
|
@ -659,7 +659,7 @@ SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to
|
|||
swaps(&to->control, n);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
|
||||
{
|
||||
char n;
|
||||
|
@ -669,7 +669,7 @@ SDeviceEnterNotifyEvent (deviceEnterNotify *from, deviceEnterNotify *to)
|
|||
swapl(&to->time, n);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
|
||||
{
|
||||
char n;
|
||||
|
@ -692,7 +692,7 @@ SRawDeviceEvent(rawDeviceEvent* from, rawDeviceEvent *to)
|
|||
char n;
|
||||
int i;
|
||||
CARD32* valptr;
|
||||
|
||||
|
||||
|
||||
*to = *from;
|
||||
swaps(&to->sequenceNumber, n);
|
||||
|
@ -704,7 +704,7 @@ SRawDeviceEvent(rawDeviceEvent* from, rawDeviceEvent *to)
|
|||
}
|
||||
|
||||
static void
|
||||
SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
|
||||
SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
|
||||
deviceClassesChangedEvent* to)
|
||||
{
|
||||
char n;
|
||||
|
@ -717,7 +717,7 @@ SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
|
|||
swaps(&to->sequenceNumber, n);
|
||||
swapl(&to->length, n);
|
||||
swapl(&to->time, n);
|
||||
|
||||
|
||||
/* now swap the actual classes */
|
||||
any = (xAnyClassPtr)&to[1];
|
||||
for (i = 0; i < to->num_classes; i++)
|
||||
|
@ -796,7 +796,7 @@ GetNextExtEventMask(void)
|
|||
*
|
||||
* Since extension event types will never be less than 64, we can use
|
||||
* 0-63 in the EventInfo array as the "type" to be used to look up this
|
||||
* mask. This means that the corresponding macros such as
|
||||
* mask. This means that the corresponding macros such as
|
||||
* DevicePointerMotionHint must have access to the same constants.
|
||||
*
|
||||
*/
|
||||
|
@ -973,7 +973,7 @@ FixExtensionEvents(ExtensionEntry * extEntry)
|
|||
|
||||
/************************************************************************
|
||||
*
|
||||
* This function restores extension event types and masks to their
|
||||
* This function restores extension event types and masks to their
|
||||
* initial state.
|
||||
*
|
||||
*/
|
||||
|
@ -1189,7 +1189,7 @@ SEventIDispatch(xEvent * from, xEvent * to)
|
|||
* EventSwap for generic events coming from the GE extension.
|
||||
*/
|
||||
|
||||
static void
|
||||
static void
|
||||
XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
|
||||
{
|
||||
int n;
|
||||
|
@ -1201,7 +1201,7 @@ XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
|
|||
SRawDeviceEvent((rawDeviceEvent*)from, (rawDeviceEvent*)to);
|
||||
break;
|
||||
case XI_DeviceClassesChangedNotify:
|
||||
SDeviceClassesChangedEvent((deviceClassesChangedEvent*)from,
|
||||
SDeviceClassesChangedEvent((deviceClassesChangedEvent*)from,
|
||||
(deviceClassesChangedEvent*)to);
|
||||
break;
|
||||
}
|
||||
|
@ -1211,8 +1211,8 @@ XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
|
|||
* EventFill to fill various fields for events before they are delivered to
|
||||
* the client.
|
||||
*/
|
||||
static void
|
||||
XIGEEventFill(xGenericEvent* ev, DeviceIntPtr pDev,
|
||||
static void
|
||||
XIGEEventFill(xGenericEvent* ev, DeviceIntPtr pDev,
|
||||
WindowPtr pWin, GrabPtr grab)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ SProcXFakeDeviceData(ClientPtr client)
|
|||
return ProcXFakeDeviceData(client);;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
ProcXFakeDeviceData(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
|
@ -92,7 +92,7 @@ ProcXFakeDeviceData(ClientPtr client)
|
|||
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_FakeDeviceData, 0, BadDevice);
|
||||
SendErrorToClient(client, IReqCode, X_FakeDeviceData, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,8 +74,8 @@ int ProcXGetClientPointer(ClientPtr client)
|
|||
err = dixLookupWindow(&win, stuff->win, client, DixReadAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_GetClientPointer,
|
||||
stuff->win, err);
|
||||
SendErrorToClient(client, IReqCode, X_GetClientPointer,
|
||||
stuff->win, err);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,8 @@ int ProcXGetClientPointer(ClientPtr client)
|
|||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SRepXGetClientPointer(ClientPtr client, int size,
|
||||
void
|
||||
SRepXGetClientPointer(ClientPtr client, int size,
|
||||
xGetClientPointerReply* rep)
|
||||
{
|
||||
char n;
|
||||
|
|
|
@ -62,7 +62,7 @@ SProcXGrabAccessControl(ClientPtr client)
|
|||
return ProcXGrabAccessControl(client);
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
ProcXGrabAccessControl(ClientPtr client)
|
||||
{
|
||||
xGrabAccessControlReply rep;
|
||||
|
@ -90,7 +90,7 @@ ProcXGrabAccessControl(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGrabAccessControl(ClientPtr client, int size,
|
||||
SRepXGrabAccessControl(ClientPtr client, int size,
|
||||
xGrabAccessControlReply* rep)
|
||||
{
|
||||
char n;
|
||||
|
|
|
@ -147,12 +147,12 @@ ProcXGrabDevice(ClientPtr client)
|
|||
*
|
||||
* This procedure creates an event mask from a list of XEventClasses.
|
||||
*
|
||||
* Procedure is as follows:
|
||||
* Procedure is as follows:
|
||||
* An XEventClass is (deviceid << 8 | eventtype). For each entry in the list,
|
||||
* get the device. Then run through all available event indices (those are
|
||||
* set when XI starts up) and binary OR's the device's mask to whatever the
|
||||
* event mask for the given event type was.
|
||||
* If an error occurs, it is sent to the client. Errors are generated if
|
||||
* event mask for the given event type was.
|
||||
* If an error occurs, it is sent to the client. Errors are generated if
|
||||
* - if the device given in the event classs is invalid
|
||||
* - if the device in the class list is not the device given as parameter (no
|
||||
* error if parameter is NULL)
|
||||
|
|
|
@ -186,7 +186,7 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
|
|||
dev->use = IsXExtensionPointer;
|
||||
else
|
||||
dev->use = IsXExtensionDevice;
|
||||
if (!d->isMaster)
|
||||
if (!d->isMaster)
|
||||
dev->attached = (d->u.master) ? d->u.master->id : IsFloating;
|
||||
|
||||
if (client->swapped) {
|
||||
|
@ -225,7 +225,7 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
|
|||
*
|
||||
* Devices may have up to 255 valuators. The length of a ValuatorClass is
|
||||
* defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
|
||||
* The maximum length is therefore (8 + 255 * 12) = 3068. However, the
|
||||
* The maximum length is therefore (8 + 255 * 12) = 3068. However, the
|
||||
* length field is one byte. If a device has more than 20 valuators, we
|
||||
* must therefore return multiple valuator classes to the client.
|
||||
*
|
||||
|
|
|
@ -78,8 +78,8 @@ ProcXQueryWindowAccess(ClientPtr client)
|
|||
err = dixLookupWindow(&win, stuff->win, client, DixReadAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_QueryWindowAccess,
|
||||
stuff->win, err);
|
||||
SendErrorToClient(client, IReqCode, X_QueryWindowAccess,
|
||||
stuff->win, err);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -100,8 +100,8 @@ ProcXQueryWindowAccess(ClientPtr client)
|
|||
if (!deviceids)
|
||||
{
|
||||
ErrorF("[Xi] ProcXQueryWindowAccess: xalloc failure.\n");
|
||||
SendErrorToClient(client, IReqCode, X_QueryWindowAccess,
|
||||
0, BadImplementation);
|
||||
SendErrorToClient(client, IReqCode, X_QueryWindowAccess,
|
||||
0, BadImplementation);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -117,8 +117,8 @@ ProcXQueryWindowAccess(ClientPtr client)
|
|||
}
|
||||
|
||||
void
|
||||
SRepXQueryWindowAccess(ClientPtr client,
|
||||
int size,
|
||||
SRepXQueryWindowAccess(ClientPtr client,
|
||||
int size,
|
||||
xQueryWindowAccessReply* rep)
|
||||
{
|
||||
char n;
|
||||
|
|
|
@ -86,14 +86,14 @@ ProcXQueryDevicePointer(ClientPtr client)
|
|||
pDev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (pDev == NULL || pDev->valuator == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
|
||||
stuff->deviceid, BadDevice);
|
||||
stuff->deviceid, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
|
||||
SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
|
||||
stuff->win, rc);
|
||||
return Success;
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ ProcXQueryDevicePointer(ClientPtr client)
|
|||
rep.rootX = pSprite->hot.x;
|
||||
rep.rootY = pSprite->hot.y;
|
||||
rep.child = None;
|
||||
rep.shared = (pDev->spriteInfo->spriteOwner) ? xFalse : xTrue;
|
||||
rep.shared = (pDev->spriteInfo->spriteOwner) ? xFalse : xTrue;
|
||||
|
||||
if (pSprite->hot.pScreen == pWin->drawable.pScreen)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ ProcXQueryDevicePointer(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXQueryDevicePointer(ClientPtr client, int size,
|
||||
SRepXQueryDevicePointer(ClientPtr client, int size,
|
||||
xQueryDevicePointerReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
|
|
@ -53,12 +53,12 @@ from the author.
|
|||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure allows a client to register the pairing of a pointer
|
||||
* This procedure allows a client to register the pairing of a pointer
|
||||
* with a keyboard.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
int
|
||||
SProcXRegisterPairingClient(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
@ -67,7 +67,7 @@ SProcXRegisterPairingClient(ClientPtr client)
|
|||
return ProcXRegisterPairingClient(client);
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
ProcXRegisterPairingClient(ClientPtr client)
|
||||
{
|
||||
xRegisterPairingClientReply rep;
|
||||
|
@ -96,7 +96,7 @@ ProcXRegisterPairingClient(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXRegisterPairingClient(ClientPtr client, int size,
|
||||
SRepXRegisterPairingClient(ClientPtr client, int size,
|
||||
xRegisterPairingClientReply* rep)
|
||||
{
|
||||
register char n;
|
||||
|
|
|
@ -110,7 +110,7 @@ SProcXSendExtensionEvent(ClientPtr client)
|
|||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Send an event to some client, as if it had come from an extension input
|
||||
* Send an event to some client, as if it had come from an extension input
|
||||
* device.
|
||||
*
|
||||
*/
|
||||
|
|
10
Xi/stubs.c
10
Xi/stubs.c
|
@ -88,7 +88,7 @@ CloseInputDevice(DeviceIntPtr d, ClientPtr client)
|
|||
*
|
||||
* Caller: ProcXListInputDevices
|
||||
*
|
||||
* This is the implementation-dependent routine to initialize an input
|
||||
* This is the implementation-dependent routine to initialize an input
|
||||
* device to the point that information about it can be listed.
|
||||
* Some implementations open all input devices when the server is first
|
||||
* initialized, and never close them. Other implementations open only
|
||||
|
@ -100,12 +100,12 @@ CloseInputDevice(DeviceIntPtr d, ClientPtr client)
|
|||
* This procedure should be used by implementations that do not initialize
|
||||
* all input devices at server startup. It should do device-dependent
|
||||
* initialization for any devices not previously initialized, and call
|
||||
* AddInputDevice for each of those devices so that a DeviceIntRec will be
|
||||
* AddInputDevice for each of those devices so that a DeviceIntRec will be
|
||||
* created for them.
|
||||
*
|
||||
* The default implementation is to do nothing (assume all input devices
|
||||
* are initialized during X server initialization and kept open).
|
||||
* The commented-out sample code shows what you might do if you don't want
|
||||
* The commented-out sample code shows what you might do if you don't want
|
||||
* the default.
|
||||
*
|
||||
*/
|
||||
|
@ -114,7 +114,7 @@ void
|
|||
AddOtherInputDevices(void)
|
||||
{
|
||||
/**********************************************************************
|
||||
for each uninitialized device, do something like:
|
||||
for each uninitialized device, do something like:
|
||||
|
||||
DeviceIntPtr dev;
|
||||
DeviceProc deviceProc;
|
||||
|
@ -137,7 +137,7 @@ AddOtherInputDevices(void)
|
|||
* initialized, and never close them. Other implementations open only
|
||||
* the X pointer and keyboard devices during server initialization,
|
||||
* and only open other input devices when some client makes an
|
||||
* XOpenDevice request. This entry point is for the latter type of
|
||||
* XOpenDevice request. This entry point is for the latter type of
|
||||
* implementation.
|
||||
*
|
||||
* If the physical device is not already open, do it here. In this case,
|
||||
|
|
|
@ -87,7 +87,7 @@ ProcXWarpDevicePointer(ClientPtr client)
|
|||
if (pDev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
|
||||
stuff->deviceid,
|
||||
BadDevice);
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ ProcXWarpDevicePointer(ClientPtr client)
|
|||
err = dixLookupWindow(&dest, stuff->dst_win, client, DixReadAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
|
||||
SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
|
||||
stuff->dst_win, err);
|
||||
return Success;
|
||||
}
|
||||
|
@ -114,14 +114,14 @@ ProcXWarpDevicePointer(ClientPtr client)
|
|||
err = dixLookupWindow(&src, stuff->src_win, client, DixReadAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
|
||||
SendErrorToClient(client, IReqCode, X_WarpDevicePointer,
|
||||
stuff->src_win, err);
|
||||
return Success;
|
||||
}
|
||||
|
||||
winX = src->drawable.x;
|
||||
winY = src->drawable.y;
|
||||
if (src->drawable.pScreen != pSprite->hotPhys.pScreen ||
|
||||
if (src->drawable.pScreen != pSprite->hotPhys.pScreen ||
|
||||
x < winX + stuff->src_x ||
|
||||
y < winY + stuff->src_y ||
|
||||
(stuff->src_width != 0 &&
|
||||
|
|
Loading…
Reference in New Issue
Block a user