Update to new XI2 names
This commit is contained in:
parent
bbf266cca3
commit
8ff1bff8f4
|
@ -54,25 +54,25 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
SProcXIChangeDeviceCursor(ClientPtr client)
|
SProcXIChangeCursor(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
|
|
||||||
REQUEST(xXIChangeDeviceCursorReq);
|
REQUEST(xXIChangeCursorReq);
|
||||||
swaps(&stuff->length, n);
|
swaps(&stuff->length, n);
|
||||||
REQUEST_SIZE_MATCH(xXIChangeDeviceCursorReq);
|
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
|
||||||
return (ProcXIChangeDeviceCursor(client));
|
return (ProcXIChangeCursor(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
int ProcXIChangeDeviceCursor(ClientPtr client)
|
int ProcXIChangeCursor(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
WindowPtr pWin = NULL;
|
WindowPtr pWin = NULL;
|
||||||
DeviceIntPtr pDev = NULL;
|
DeviceIntPtr pDev = NULL;
|
||||||
CursorPtr pCursor = NULL;
|
CursorPtr pCursor = NULL;
|
||||||
|
|
||||||
REQUEST(xXIChangeDeviceCursorReq);
|
REQUEST(xXIChangeCursorReq);
|
||||||
REQUEST_SIZE_MATCH(xXIChangeDeviceCursorReq);
|
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
|
||||||
|
|
||||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
|
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#ifndef CHDEVCUR_H
|
#ifndef CHDEVCUR_H
|
||||||
#define CHDEVCUR_H 1
|
#define CHDEVCUR_H 1
|
||||||
|
|
||||||
int SProcXIChangeDeviceCursor(ClientPtr /* client */);
|
int SProcXIChangeCursor(ClientPtr /* client */);
|
||||||
int ProcXIChangeDeviceCursor(ClientPtr /* client */);
|
int ProcXIChangeCursor(ClientPtr /* client */);
|
||||||
|
|
||||||
#endif /* CHDEVCUR_H */
|
#endif /* CHDEVCUR_H */
|
||||||
|
|
|
@ -61,7 +61,7 @@ extern DevPrivateKey XTstDevicePrivateKey;
|
||||||
*/
|
*/
|
||||||
void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
|
void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
|
||||||
{
|
{
|
||||||
xXIDeviceHierarchyEvent *ev;
|
xXIHierarchyEvent *ev;
|
||||||
xXIHierarchyInfo *info;
|
xXIHierarchyInfo *info;
|
||||||
DeviceIntRec dummyDev;
|
DeviceIntRec dummyDev;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
@ -70,7 +70,7 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
|
||||||
if (!flags)
|
if (!flags)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ev = xcalloc(1, sizeof(xXIDeviceHierarchyEvent) +
|
ev = xcalloc(1, sizeof(xXIHierarchyEvent) +
|
||||||
MAXDEVICES * sizeof(xXIHierarchyInfo));
|
MAXDEVICES * sizeof(xXIHierarchyInfo));
|
||||||
ev->type = GenericEvent;
|
ev->type = GenericEvent;
|
||||||
ev->extension = IReqCode;
|
ev->extension = IReqCode;
|
||||||
|
@ -128,29 +128,29 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int SProcXIChangeDeviceHierarchy(ClientPtr client)
|
int SProcXIChangeHierarchy(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
|
|
||||||
REQUEST(xXIChangeDeviceHierarchyReq);
|
REQUEST(xXIChangeHierarchyReq);
|
||||||
swaps(&stuff->length, n);
|
swaps(&stuff->length, n);
|
||||||
return (ProcXIChangeDeviceHierarchy(client));
|
return (ProcXIChangeHierarchy(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SWAPIF(cmd) if (client->swapped) { cmd; }
|
#define SWAPIF(cmd) if (client->swapped) { cmd; }
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIChangeDeviceHierarchy(ClientPtr client)
|
ProcXIChangeHierarchy(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr ptr, keybd, xtstptr, xtstkeybd;
|
DeviceIntPtr ptr, keybd, xtstptr, xtstkeybd;
|
||||||
xXIAnyHierarchyChangeInfo *any;
|
xXIAnyHierarchyChangeInfo *any;
|
||||||
int required_len = sizeof(xXIChangeDeviceHierarchyReq);
|
int required_len = sizeof(xXIChangeHierarchyReq);
|
||||||
char n;
|
char n;
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
int flags[MAXDEVICES] = {0};
|
int flags[MAXDEVICES] = {0};
|
||||||
|
|
||||||
REQUEST(xXIChangeDeviceHierarchyReq);
|
REQUEST(xXIChangeHierarchyReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xXIChangeDeviceHierarchyReq);
|
REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq);
|
||||||
|
|
||||||
if (!stuff->num_changes)
|
if (!stuff->num_changes)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -167,7 +167,7 @@ ProcXIChangeDeviceHierarchy(ClientPtr client)
|
||||||
|
|
||||||
switch(any->type)
|
switch(any->type)
|
||||||
{
|
{
|
||||||
case XICreateMasterDevice:
|
case XICreateMaster:
|
||||||
{
|
{
|
||||||
xXICreateMasterInfo* c = (xXICreateMasterInfo*)any;
|
xXICreateMasterInfo* c = (xXICreateMasterInfo*)any;
|
||||||
char* name;
|
char* name;
|
||||||
|
@ -229,7 +229,7 @@ ProcXIChangeDeviceHierarchy(ClientPtr client)
|
||||||
xfree(name);
|
xfree(name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XIRemoveMasterDevice:
|
case XIRemoveMaster:
|
||||||
{
|
{
|
||||||
xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any;
|
xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any;
|
||||||
DeviceIntPtr xtstdevice;
|
DeviceIntPtr xtstdevice;
|
||||||
|
|
|
@ -36,8 +36,8 @@
|
||||||
#ifndef CHDEVHIER_H
|
#ifndef CHDEVHIER_H
|
||||||
#define CHDEVHIER_H 1
|
#define CHDEVHIER_H 1
|
||||||
|
|
||||||
int SProcXIChangeDeviceHierarchy(ClientPtr /* client */);
|
int SProcXIChangeHierarchy(ClientPtr /* client */);
|
||||||
int ProcXIChangeDeviceHierarchy(ClientPtr /* client */);
|
int ProcXIChangeHierarchy(ClientPtr /* client */);
|
||||||
|
|
||||||
void XISendDeviceHierarchyEvent(int flags[]);
|
void XISendDeviceHierarchyEvent(int flags[]);
|
||||||
|
|
||||||
|
|
36
Xi/extinit.c
36
Xi/extinit.c
|
@ -235,17 +235,17 @@ static int (*ProcIVector[])(ClientPtr) = {
|
||||||
ProcXDeleteDeviceProperty, /* 38 */
|
ProcXDeleteDeviceProperty, /* 38 */
|
||||||
ProcXGetDeviceProperty, /* 39 */
|
ProcXGetDeviceProperty, /* 39 */
|
||||||
/* XI 2 */
|
/* XI 2 */
|
||||||
ProcXIQueryDevicePointer, /* 40 */
|
ProcXIQueryPointer, /* 40 */
|
||||||
ProcXIWarpDevicePointer, /* 41 */
|
ProcXIWarpPointer, /* 41 */
|
||||||
ProcXIChangeDeviceCursor, /* 42 */
|
ProcXIChangeCursor, /* 42 */
|
||||||
ProcXIChangeDeviceHierarchy, /* 43 */
|
ProcXIChangeHierarchy, /* 43 */
|
||||||
ProcXISetClientPointer, /* 44 */
|
ProcXISetClientPointer, /* 44 */
|
||||||
ProcXIGetClientPointer, /* 45 */
|
ProcXIGetClientPointer, /* 45 */
|
||||||
ProcXISelectEvent, /* 46 */
|
ProcXISelectEvent, /* 46 */
|
||||||
ProcXIQueryVersion, /* 47 */
|
ProcXIQueryVersion, /* 47 */
|
||||||
ProcXIQueryDevice, /* 48 */
|
ProcXIQueryDevice, /* 48 */
|
||||||
ProcXISetDeviceFocus, /* 49 */
|
ProcXISetFocus, /* 49 */
|
||||||
ProcXIGetDeviceFocus, /* 50 */
|
ProcXIGetFocus, /* 50 */
|
||||||
ProcXIGrabDevice, /* 51 */
|
ProcXIGrabDevice, /* 51 */
|
||||||
ProcXIUngrabDevice, /* 52 */
|
ProcXIUngrabDevice, /* 52 */
|
||||||
ProcXIAllowEvents, /* 53 */
|
ProcXIAllowEvents, /* 53 */
|
||||||
|
@ -299,17 +299,17 @@ static int (*SProcIVector[])(ClientPtr) = {
|
||||||
SProcXChangeDeviceProperty, /* 37 */
|
SProcXChangeDeviceProperty, /* 37 */
|
||||||
SProcXDeleteDeviceProperty, /* 38 */
|
SProcXDeleteDeviceProperty, /* 38 */
|
||||||
SProcXGetDeviceProperty, /* 39 */
|
SProcXGetDeviceProperty, /* 39 */
|
||||||
SProcXIQueryDevicePointer, /* 40 */
|
SProcXIQueryPointer, /* 40 */
|
||||||
SProcXIWarpDevicePointer, /* 41 */
|
SProcXIWarpPointer, /* 41 */
|
||||||
SProcXIChangeDeviceCursor, /* 42 */
|
SProcXIChangeCursor, /* 42 */
|
||||||
SProcXIChangeDeviceHierarchy, /* 43 */
|
SProcXIChangeHierarchy, /* 43 */
|
||||||
SProcXISetClientPointer, /* 44 */
|
SProcXISetClientPointer, /* 44 */
|
||||||
SProcXIGetClientPointer, /* 45 */
|
SProcXIGetClientPointer, /* 45 */
|
||||||
SProcXISelectEvent, /* 46 */
|
SProcXISelectEvent, /* 46 */
|
||||||
SProcXIQueryVersion, /* 47 */
|
SProcXIQueryVersion, /* 47 */
|
||||||
SProcXIQueryDevice, /* 48 */
|
SProcXIQueryDevice, /* 48 */
|
||||||
SProcXISetDeviceFocus, /* 49 */
|
SProcXISetFocus, /* 49 */
|
||||||
SProcXIGetDeviceFocus, /* 50 */
|
SProcXIGetFocus, /* 50 */
|
||||||
SProcXIGrabDevice, /* 51 */
|
SProcXIGrabDevice, /* 51 */
|
||||||
SProcXIUngrabDevice, /* 52 */
|
SProcXIUngrabDevice, /* 52 */
|
||||||
SProcXIAllowEvents, /* 53 */
|
SProcXIAllowEvents, /* 53 */
|
||||||
|
@ -502,9 +502,8 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||||
SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply*)rep);
|
SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply*)rep);
|
||||||
else if (rep->RepType == X_GetDeviceProperty)
|
else if (rep->RepType == X_GetDeviceProperty)
|
||||||
SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep);
|
SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep);
|
||||||
else if (rep->RepType == X_XIQueryDevicePointer)
|
else if (rep->RepType == X_XIQueryPointer)
|
||||||
SRepXIQueryDevicePointer(client, len,
|
SRepXIQueryPointer(client, len, (xXIQueryPointerReply *) rep);
|
||||||
(xXIQueryDevicePointerReply *) rep);
|
|
||||||
else if (rep->RepType == X_XIGetClientPointer)
|
else if (rep->RepType == X_XIGetClientPointer)
|
||||||
SRepXIGetClientPointer(client, len, (xXIGetClientPointerReply*) rep);
|
SRepXIGetClientPointer(client, len, (xXIGetClientPointerReply*) rep);
|
||||||
else if (rep->RepType == X_XIQueryDevice)
|
else if (rep->RepType == X_XIQueryDevice)
|
||||||
|
@ -763,8 +762,8 @@ static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDeviceHierarchyEvent(xXIDeviceHierarchyEvent *from,
|
static void SDeviceHierarchyEvent(xXIHierarchyEvent *from,
|
||||||
xXIDeviceHierarchyEvent *to)
|
xXIHierarchyEvent *to)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char n;
|
char n;
|
||||||
|
@ -816,8 +815,7 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)
|
||||||
(xXIDeviceChangedEvent*)to);
|
(xXIDeviceChangedEvent*)to);
|
||||||
break;
|
break;
|
||||||
case XI_HierarchyChanged:
|
case XI_HierarchyChanged:
|
||||||
SDeviceHierarchyEvent((xXIDeviceHierarchyEvent*)from,
|
SDeviceHierarchyEvent((xXIHierarchyEvent*)from, (xXIHierarchyEvent*)to);
|
||||||
(xXIDeviceHierarchyEvent*)to);
|
|
||||||
break;
|
break;
|
||||||
case XI_PropertyEvent:
|
case XI_PropertyEvent:
|
||||||
SXIPropertyEvent((xXIPropertyEvent*)from,
|
SXIPropertyEvent((xXIPropertyEvent*)from,
|
||||||
|
|
26
Xi/querydp.c
26
Xi/querydp.c
|
@ -58,26 +58,26 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
SProcXIQueryDevicePointer(ClientPtr client)
|
SProcXIQueryPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
|
|
||||||
REQUEST(xXIQueryDevicePointerReq);
|
REQUEST(xXIQueryPointerReq);
|
||||||
swaps(&stuff->length, n);
|
swaps(&stuff->length, n);
|
||||||
return (ProcXIQueryDevicePointer(client));
|
return (ProcXIQueryPointer(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIQueryDevicePointer(ClientPtr client)
|
ProcXIQueryPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
xXIQueryDevicePointerReply rep;
|
xXIQueryPointerReply rep;
|
||||||
DeviceIntPtr pDev, kbd;
|
DeviceIntPtr pDev, kbd;
|
||||||
WindowPtr pWin, t;
|
WindowPtr pWin, t;
|
||||||
SpritePtr pSprite;
|
SpritePtr pSprite;
|
||||||
|
|
||||||
REQUEST(xXIQueryDevicePointerReq);
|
REQUEST(xXIQueryPointerReq);
|
||||||
REQUEST_SIZE_MATCH(xXIQueryDevicePointerReq);
|
REQUEST_SIZE_MATCH(xXIQueryPointerReq);
|
||||||
|
|
||||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
|
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
@ -92,7 +92,7 @@ ProcXIQueryDevicePointer(ClientPtr client)
|
||||||
rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
{
|
{
|
||||||
SendErrorToClient(client, IReqCode, X_XIQueryDevicePointer,
|
SendErrorToClient(client, IReqCode, X_XIQueryPointer,
|
||||||
stuff->win, rc);
|
stuff->win, rc);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ ProcXIQueryDevicePointer(ClientPtr client)
|
||||||
|
|
||||||
pSprite = pDev->spriteInfo->sprite;
|
pSprite = pDev->spriteInfo->sprite;
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_XIQueryDevicePointer;
|
rep.RepType = X_XIQueryPointer;
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.mask = pDev->button->state;
|
rep.mask = pDev->button->state;
|
||||||
|
@ -146,20 +146,20 @@ ProcXIQueryDevicePointer(ClientPtr client)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xXIQueryDevicePointerReply), &rep);
|
WriteReplyToClient(client, sizeof(xXIQueryPointerReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure writes the reply for the XIQueryDevicePointer function,
|
* This procedure writes the reply for the XIQueryPointer function,
|
||||||
* if the client and server have a different byte ordering.
|
* if the client and server have a different byte ordering.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
SRepXIQueryDevicePointer(ClientPtr client, int size,
|
SRepXIQueryPointer(ClientPtr client, int size,
|
||||||
xXIQueryDevicePointerReply * rep)
|
xXIQueryPointerReply * rep)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@
|
||||||
#ifndef QUERYDP_H
|
#ifndef QUERYDP_H
|
||||||
#define QUERYDP_H 1
|
#define QUERYDP_H 1
|
||||||
|
|
||||||
int SProcXIQueryDevicePointer(ClientPtr /* client */);
|
int SProcXIQueryPointer(ClientPtr /* client */);
|
||||||
int ProcXIQueryDevicePointer(ClientPtr /* client */);
|
int ProcXIQueryPointer(ClientPtr /* client */);
|
||||||
void SRepXIQueryDevicePointer(ClientPtr /* client */ ,
|
void SRepXIQueryPointer(ClientPtr /* client */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xXIQueryDevicePointerReply * /* rep */);
|
xXIQueryPointerReply * /* rep */);
|
||||||
|
|
||||||
#endif /* QUERYDP_H */
|
#endif /* QUERYDP_H */
|
||||||
|
|
|
@ -54,17 +54,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
SProcXIWarpDevicePointer(ClientPtr client)
|
SProcXIWarpPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
|
|
||||||
REQUEST(xXIWarpDevicePointerReq);
|
REQUEST(xXIWarpPointerReq);
|
||||||
swaps(&stuff->length, n);
|
swaps(&stuff->length, n);
|
||||||
return (ProcXIWarpDevicePointer(client));
|
return (ProcXIWarpPointer(client));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIWarpDevicePointer(ClientPtr client)
|
ProcXIWarpPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
@ -73,8 +73,8 @@ ProcXIWarpDevicePointer(ClientPtr client)
|
||||||
SpritePtr pSprite;
|
SpritePtr pSprite;
|
||||||
ScreenPtr newScreen;
|
ScreenPtr newScreen;
|
||||||
|
|
||||||
REQUEST(xXIWarpDevicePointerReq);
|
REQUEST(xXIWarpPointerReq);
|
||||||
REQUEST_SIZE_MATCH(xXIWarpDevicePointerReq);
|
REQUEST_SIZE_MATCH(xXIWarpPointerReq);
|
||||||
|
|
||||||
/* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
|
/* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#ifndef WARPDEVP_H
|
#ifndef WARPDEVP_H
|
||||||
#define WARPDEVP_H 1
|
#define WARPDEVP_H 1
|
||||||
|
|
||||||
int SProcXIWarpDevicePointer(ClientPtr /* client */);
|
int SProcXIWarpPointer(ClientPtr /* client */);
|
||||||
int ProcXIWarpDevicePointer(ClientPtr /* client */);
|
int ProcXIWarpPointer(ClientPtr /* client */);
|
||||||
|
|
||||||
#endif /* WARPDEVP_H */
|
#endif /* WARPDEVP_H */
|
||||||
|
|
|
@ -41,7 +41,7 @@ SProcXISelectEvent(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
int i;
|
int i;
|
||||||
xXIDeviceEventMask* evmask;
|
xXIEventMask* evmask;
|
||||||
|
|
||||||
REQUEST(xXISelectEventsReq);
|
REQUEST(xXISelectEventsReq);
|
||||||
swaps(&stuff->length, n);
|
swaps(&stuff->length, n);
|
||||||
|
@ -49,12 +49,12 @@ SProcXISelectEvent(ClientPtr client)
|
||||||
swapl(&stuff->window, n);
|
swapl(&stuff->window, n);
|
||||||
swaps(&stuff->num_masks, n);
|
swaps(&stuff->num_masks, n);
|
||||||
|
|
||||||
evmask = (xXIDeviceEventMask*)&stuff[1];
|
evmask = (xXIEventMask*)&stuff[1];
|
||||||
for (i = 0; i < stuff->num_masks; i++)
|
for (i = 0; i < stuff->num_masks; i++)
|
||||||
{
|
{
|
||||||
swaps(&evmask->deviceid, n);
|
swaps(&evmask->deviceid, n);
|
||||||
swaps(&evmask->mask_len, n);
|
swaps(&evmask->mask_len, n);
|
||||||
evmask = (xXIDeviceEventMask*)(((char*)evmask) + evmask->mask_len * 4);
|
evmask = (xXIEventMask*)(((char*)evmask) + evmask->mask_len * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ProcXISelectEvent(client));
|
return (ProcXISelectEvent(client));
|
||||||
|
@ -67,7 +67,7 @@ ProcXISelectEvent(ClientPtr client)
|
||||||
WindowPtr win;
|
WindowPtr win;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
DeviceIntRec dummy;
|
DeviceIntRec dummy;
|
||||||
xXIDeviceEventMask *evmask;
|
xXIEventMask *evmask;
|
||||||
int *types = NULL;
|
int *types = NULL;
|
||||||
|
|
||||||
REQUEST(xXISelectEventsReq);
|
REQUEST(xXISelectEventsReq);
|
||||||
|
@ -78,7 +78,7 @@ ProcXISelectEvent(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
/* check request validity */
|
/* check request validity */
|
||||||
evmask = (xXIDeviceEventMask*)&stuff[1];
|
evmask = (xXIEventMask*)&stuff[1];
|
||||||
num_masks = stuff->num_masks;
|
num_masks = stuff->num_masks;
|
||||||
while(num_masks--)
|
while(num_masks--)
|
||||||
{
|
{
|
||||||
|
@ -102,11 +102,11 @@ ProcXISelectEvent(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
evmask = (xXIDeviceEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
|
evmask = (xXIEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set masks on window */
|
/* Set masks on window */
|
||||||
evmask = (xXIDeviceEventMask*)&stuff[1];
|
evmask = (xXIEventMask*)&stuff[1];
|
||||||
num_masks = stuff->num_masks;
|
num_masks = stuff->num_masks;
|
||||||
while(num_masks--)
|
while(num_masks--)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +118,7 @@ ProcXISelectEvent(ClientPtr client)
|
||||||
} else
|
} else
|
||||||
dixLookupDevice(&dev, evmask->deviceid, client, DixReadAccess);
|
dixLookupDevice(&dev, evmask->deviceid, client, DixReadAccess);
|
||||||
XISetEventMask(dev, win, client, evmask->mask_len * 4, (unsigned char*)&evmask[1]);
|
XISetEventMask(dev, win, client, evmask->mask_len * 4, (unsigned char*)&evmask[1]);
|
||||||
evmask = (xXIDeviceEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
|
evmask = (xXIEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
RecalculateDeliverableEvents(win);
|
RecalculateDeliverableEvents(win);
|
||||||
|
|
|
@ -41,39 +41,39 @@
|
||||||
#include "xisetdevfocus.h"
|
#include "xisetdevfocus.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
SProcXISetDeviceFocus(ClientPtr client)
|
SProcXISetFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
|
|
||||||
REQUEST(xXISetDeviceFocusReq);
|
REQUEST(xXISetFocusReq);
|
||||||
swaps(&stuff->length, n);
|
swaps(&stuff->length, n);
|
||||||
swaps(&stuff->deviceid, n);
|
swaps(&stuff->deviceid, n);
|
||||||
swapl(&stuff->focus, n);
|
swapl(&stuff->focus, n);
|
||||||
swapl(&stuff->time, n);
|
swapl(&stuff->time, n);
|
||||||
|
|
||||||
return ProcXISetDeviceFocus(client);
|
return ProcXISetFocus(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SProcXIGetDeviceFocus(ClientPtr client)
|
SProcXIGetFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
char n;
|
char n;
|
||||||
|
|
||||||
REQUEST(xXIGetDeviceFocusReq);
|
REQUEST(xXIGetFocusReq);
|
||||||
swaps(&stuff->length, n);
|
swaps(&stuff->length, n);
|
||||||
swaps(&stuff->deviceid, n);
|
swaps(&stuff->deviceid, n);
|
||||||
|
|
||||||
return ProcXIGetDeviceFocus(client);
|
return ProcXIGetFocus(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXISetDeviceFocus(ClientPtr client)
|
ProcXISetFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
REQUEST(xXISetDeviceFocusReq);
|
REQUEST(xXISetFocusReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xXISetDeviceFocusReq);
|
REQUEST_AT_LEAST_SIZE(xXISetFocusReq);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetFocusAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixSetFocusAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
@ -86,14 +86,14 @@ ProcXISetDeviceFocus(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIGetDeviceFocus(ClientPtr client)
|
ProcXIGetFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXIGetDeviceFocusReply rep;
|
xXIGetFocusReply rep;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
REQUEST(xXIGetDeviceFocusReq);
|
REQUEST(xXIGetFocusReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xXIGetDeviceFocusReq);
|
REQUEST_AT_LEAST_SIZE(xXIGetFocusReq);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
@ -102,7 +102,7 @@ ProcXIGetDeviceFocus(ClientPtr client)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep.repType = X_Reply;
|
||||||
rep.RepType = X_XIGetDeviceFocus;
|
rep.RepType = X_XIGetFocus;
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
|
@ -115,6 +115,6 @@ ProcXIGetDeviceFocus(ClientPtr client)
|
||||||
else
|
else
|
||||||
rep.focus = dev->focus->win->drawable.id;
|
rep.focus = dev->focus->win->drawable.id;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xXIGetDeviceFocusReply), &rep);
|
WriteReplyToClient(client, sizeof(xXIGetFocusReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,10 @@
|
||||||
#ifndef XISETDEVFOCUS_H
|
#ifndef XISETDEVFOCUS_H
|
||||||
#define XISETDEVFOCUS_H 1
|
#define XISETDEVFOCUS_H 1
|
||||||
|
|
||||||
int SProcXISetDeviceFocus(ClientPtr client);
|
int SProcXISetFocus(ClientPtr client);
|
||||||
int ProcXISetDeviceFocus(ClientPtr client);
|
int ProcXISetFocus(ClientPtr client);
|
||||||
|
|
||||||
int SProcXIGetDeviceFocus(ClientPtr client);
|
int SProcXIGetFocus(ClientPtr client);
|
||||||
int ProcXIGetDeviceFocus(ClientPtr client);
|
int ProcXIGetFocus(ClientPtr client);
|
||||||
|
|
||||||
#endif /* XISETDEVFOCUS_H */
|
#endif /* XISETDEVFOCUS_H */
|
||||||
|
|
|
@ -422,9 +422,9 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi)
|
||||||
static int
|
static int
|
||||||
eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
|
eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
|
||||||
{
|
{
|
||||||
xXIRawDeviceEvent* raw;
|
xXIRawEvent* raw;
|
||||||
int vallen, nvals;
|
int vallen, nvals;
|
||||||
int i, len = sizeof(xXIRawDeviceEvent);
|
int i, len = sizeof(xXIRawEvent);
|
||||||
char *ptr;
|
char *ptr;
|
||||||
FP3232 *axisval;
|
FP3232 *axisval;
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi)
|
||||||
len += vallen * 4; /* valuators mask */
|
len += vallen * 4; /* valuators mask */
|
||||||
|
|
||||||
*xi = xcalloc(1, len);
|
*xi = xcalloc(1, len);
|
||||||
raw = (xXIRawDeviceEvent*)*xi;
|
raw = (xXIRawEvent*)*xi;
|
||||||
raw->type = GenericEvent;
|
raw->type = GenericEvent;
|
||||||
raw->extension = IReqCode;
|
raw->extension = IReqCode;
|
||||||
raw->evtype = GetXI2Type((InternalEvent*)ev);
|
raw->evtype = GetXI2Type((InternalEvent*)ev);
|
||||||
|
|
10
test/input.c
10
test/input.c
|
@ -284,16 +284,16 @@ static void xi2_struct_sizes(void)
|
||||||
g_assert(sizeof(req) == sz_##req);
|
g_assert(sizeof(req) == sz_##req);
|
||||||
|
|
||||||
compare(xXIQueryVersionReq);
|
compare(xXIQueryVersionReq);
|
||||||
compare(xXIWarpDevicePointerReq);
|
compare(xXIWarpPointerReq);
|
||||||
compare(xXIChangeDeviceCursorReq);
|
compare(xXIChangeCursorReq);
|
||||||
compare(xXIChangeDeviceHierarchyReq);
|
compare(xXIChangeHierarchyReq);
|
||||||
compare(xXISetClientPointerReq);
|
compare(xXISetClientPointerReq);
|
||||||
compare(xXIGetClientPointerReq);
|
compare(xXIGetClientPointerReq);
|
||||||
compare(xXISelectEventsReq);
|
compare(xXISelectEventsReq);
|
||||||
compare(xXIQueryVersionReq);
|
compare(xXIQueryVersionReq);
|
||||||
compare(xXIQueryDeviceReq);
|
compare(xXIQueryDeviceReq);
|
||||||
compare(xXISetDeviceFocusReq);
|
compare(xXISetFocusReq);
|
||||||
compare(xXIGetDeviceFocusReq);
|
compare(xXIGetFocusReq);
|
||||||
compare(xXIGrabDeviceReq);
|
compare(xXIGrabDeviceReq);
|
||||||
compare(xXIUngrabDeviceReq);
|
compare(xXIUngrabDeviceReq);
|
||||||
compare(xXIAllowEventsReq);
|
compare(xXIAllowEventsReq);
|
||||||
|
|
Loading…
Reference in New Issue