Xi: swap devices property replies.

This commit is contained in:
Peter Hutterer 2008-08-21 17:23:11 +09:30
parent 01264f1792
commit c696da75c7
3 changed files with 55 additions and 0 deletions

View File

@ -478,6 +478,12 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
else if (rep->RepType == X_ChangeDeviceControl)
SRepXChangeDeviceControl(client, len,
(xChangeDeviceControlReply *) rep);
else if (rep->RepType == X_ListDeviceProperties)
SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply*)rep);
else if (rep->RepType == X_QueryDeviceProperty)
SRepXQueryDeviceProperty(client, len, (xQueryDevicePropertyReply*)rep);
else if (rep->RepType == X_GetDeviceProperty)
SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep);
else if (rep->RepType == X_QueryDevicePointer)
SRepXQueryDevicePointer(client, len,
(xQueryDevicePointerReply *) rep);

View File

@ -888,3 +888,43 @@ SProcXGetDeviceProperty (ClientPtr client)
return (ProcXGetDeviceProperty(client));
}
/* Reply swapping */
void
SRepXListDeviceProperties(ClientPtr client, int size,
xListDevicePropertiesReply *rep)
{
char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swaps(&rep->nAtoms, n);
/* properties will be swapped later, see ProcXListDeviceProperties */
WriteToClient(client, size, (char*)rep);
}
void
SRepXQueryDeviceProperty(ClientPtr client, int size,
xQueryDevicePropertyReply *rep)
{
char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
WriteToClient(client, size, (char*)rep);
}
void
SRepXGetDeviceProperty(ClientPtr client, int size,
xGetDevicePropertyReply *rep)
{
char n;
swaps(&rep->sequenceNumber, n);
swapl(&rep->length, n);
swapl(&rep->propertyType, n);
swapl(&rep->bytesAfter, n);
swapl(&rep->nItems, n);
/* data will be swapped, see ProcXGetDeviceProperty */
WriteToClient(client, size, (char*)rep);
}

View File

@ -33,6 +33,7 @@ int ProcXChangeDeviceProperty (ClientPtr client);
int ProcXDeleteDeviceProperty (ClientPtr client);
int ProcXGetDeviceProperty (ClientPtr client);
/* request swapping */
int SProcXListDeviceProperties (ClientPtr client);
int SProcXQueryDeviceProperty (ClientPtr client);
int SProcXConfigureDeviceProperty (ClientPtr client);
@ -40,6 +41,14 @@ int SProcXChangeDeviceProperty (ClientPtr client);
int SProcXDeleteDeviceProperty (ClientPtr client);
int SProcXGetDeviceProperty (ClientPtr client);
/* reply swapping */
void SRepXListDeviceProperties(ClientPtr client, int size,
xListDevicePropertiesReply *rep);
void SRepXQueryDeviceProperty(ClientPtr client, int size,
xQueryDevicePropertyReply *rep);
void SRepXGetDeviceProperty(ClientPtr client, int size,
xGetDevicePropertyReply *rep);
void XIInitKnownProperties(void);
#endif /* XIPROPERTY_C */