diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-08-21 17:23:11 +0930 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-08-22 21:38:01 +0930 |
commit | c696da75c7326c5e1f1cd48292c0519ddc22e11b (patch) | |
tree | a822e425de1ce23d64f39712e8b4b6c13e1285a9 /Xi | |
parent | 01264f17925005969c3b71ca945fc1014bcd8c8e (diff) |
Xi: swap devices property replies.
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/extinit.c | 6 | ||||
-rw-r--r-- | Xi/xiproperty.c | 40 | ||||
-rw-r--r-- | Xi/xiproperty.h | 9 |
3 files changed, 55 insertions, 0 deletions
diff --git a/Xi/extinit.c b/Xi/extinit.c index 979622ff0..ef0a0698d 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -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); diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index ec1ed6c29..df93de5a6 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -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); +} diff --git a/Xi/xiproperty.h b/Xi/xiproperty.h index 47ba0eae3..11af4bc3c 100644 --- a/Xi/xiproperty.h +++ b/Xi/xiproperty.h @@ -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 */ |