summaryrefslogtreecommitdiff
path: root/randr/rrsdispatch.c
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2008-08-21 01:32:03 +0200
committerJulien Cristau <jcristau@debian.org>2008-08-21 09:24:02 +0200
commit01264f17925005969c3b71ca945fc1014bcd8c8e (patch)
tree7caeee6cafbbd138380b6c257677a5f54239a90a /randr/rrsdispatch.c
parente02f864fdf19a5ab1682336be343c57fdb69ef43 (diff)
Add swapped dispatch for randr 1.2 requests
Diffstat (limited to 'randr/rrsdispatch.c')
-rw-r--r--randr/rrsdispatch.c215
1 files changed, 154 insertions, 61 deletions
diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c
index 4a6a6e43f..80d16b75a 100644
--- a/randr/rrsdispatch.c
+++ b/randr/rrsdispatch.c
@@ -84,191 +84,284 @@ SProcRRSelectInput (ClientPtr client)
static int
SProcRRGetScreenSizeRange (ClientPtr client)
{
+ int n;
REQUEST(xRRGetScreenSizeRangeReq);
-
+
REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->window, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetScreenSize (ClientPtr client)
{
+ int n;
REQUEST(xRRSetScreenSizeReq);
-
+
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->window, n);
+ swaps(&stuff->width, n);
+ swaps(&stuff->height, n);
+ swapl(&stuff->widthInMillimeters, n);
+ swapl(&stuff->heightInMillimeters, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetScreenResources (ClientPtr client)
{
+ int n;
REQUEST(xRRGetScreenResourcesReq);
-
+
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->window, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetOutputInfo (ClientPtr client)
{
+ int n;
REQUEST(xRRGetOutputInfoReq);;
-
+
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ swapl(&stuff->configTimestamp, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRListOutputProperties (ClientPtr client)
{
+ int n;
REQUEST(xRRListOutputPropertiesReq);
-
+
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRQueryOutputProperty (ClientPtr client)
{
+ int n;
REQUEST(xRRQueryOutputPropertyReq);
-
+
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ swapl(&stuff->property, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRConfigureOutputProperty (ClientPtr client)
{
+ int n;
REQUEST(xRRConfigureOutputPropertyReq);
-
- REQUEST_SIZE_MATCH(xRRConfigureOutputPropertyReq);
- (void) stuff;
- return BadImplementation;
+
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ swapl(&stuff->property, n);
+ SwapRestL(stuff);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRChangeOutputProperty (ClientPtr client)
{
+ int n;
REQUEST(xRRChangeOutputPropertyReq);
-
- REQUEST_SIZE_MATCH(xRRChangeOutputPropertyReq);
- (void) stuff;
- return BadImplementation;
+
+ REQUEST_AT_LEAST_SIZE (xRRChangeOutputPropertyReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ swapl(&stuff->property, n);
+ swapl(&stuff->type, n);
+ swapl(&stuff->nUnits, n);
+ switch(stuff->format) {
+ case 8:
+ break;
+ case 16:
+ SwapRestS(stuff);
+ break;
+ case 32:
+ SwapRestL(stuff);
+ break;
+ default:
+ client->errorValue = stuff->format;
+ return BadValue;
+ }
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRDeleteOutputProperty (ClientPtr client)
{
+ int n;
REQUEST(xRRDeleteOutputPropertyReq);
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ swapl(&stuff->property, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetOutputProperty (ClientPtr client)
{
+ int n;
REQUEST(xRRGetOutputPropertyReq);
-
+
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ swapl(&stuff->property, n);
+ swapl(&stuff->type, n);
+ swapl(&stuff->longOffset, n);
+ swapl(&stuff->longLength, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRCreateMode (ClientPtr client)
{
+ int n;
+ xRRModeInfo *modeinfo;
REQUEST(xRRCreateModeReq);
-
- REQUEST_SIZE_MATCH(xRRCreateModeReq);
- (void) stuff;
- return BadImplementation;
+
+ REQUEST_AT_LEAST_SIZE(xRRCreateModeReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->window, n);
+
+ modeinfo = &stuff->modeInfo;
+ swapl(&modeinfo->id, n);
+ swaps(&modeinfo->width, n);
+ swaps(&modeinfo->height, n);
+ swapl(&modeinfo->dotClock, n);
+ swaps(&modeinfo->hSyncStart, n);
+ swaps(&modeinfo->hSyncEnd, n);
+ swaps(&modeinfo->hTotal, n);
+ swaps(&modeinfo->vSyncStart, n);
+ swaps(&modeinfo->vSyncEnd, n);
+ swaps(&modeinfo->vTotal, n);
+ swaps(&modeinfo->nameLength, n);
+ swapl(&modeinfo->modeFlags, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRDestroyMode (ClientPtr client)
{
+ int n;
REQUEST(xRRDestroyModeReq);
-
+
REQUEST_SIZE_MATCH(xRRDestroyModeReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->mode, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRAddOutputMode (ClientPtr client)
{
+ int n;
REQUEST(xRRAddOutputModeReq);
-
+
REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ swapl(&stuff->mode, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRDeleteOutputMode (ClientPtr client)
{
+ int n;
REQUEST(xRRDeleteOutputModeReq);
-
+
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->output, n);
+ swapl(&stuff->mode, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetCrtcInfo (ClientPtr client)
{
+ int n;
REQUEST(xRRGetCrtcInfoReq);
-
+
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ swapl(&stuff->configTimestamp, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetCrtcConfig (ClientPtr client)
{
+ int n;
REQUEST(xRRSetCrtcConfigReq);
-
- REQUEST_SIZE_MATCH(xRRSetCrtcConfigReq);
- (void) stuff;
- return BadImplementation;
+
+ REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ swapl(&stuff->timestamp, n);
+ swapl(&stuff->configTimestamp, n);
+ swaps(&stuff->x, n);
+ swaps(&stuff->y, n);
+ swapl(&stuff->mode, n);
+ swaps(&stuff->rotation, n);
+ SwapRestL(stuff);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetCrtcGammaSize (ClientPtr client)
{
+ int n;
REQUEST(xRRGetCrtcGammaSizeReq);
-
+
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetCrtcGamma (ClientPtr client)
{
+ int n;
REQUEST(xRRGetCrtcGammaReq);
-
+
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
- (void) stuff;
- return BadImplementation;
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetCrtcGamma (ClientPtr client)
{
+ int n;
REQUEST(xRRSetCrtcGammaReq);
-
- REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq);
- (void) stuff;
- return BadImplementation;
+
+ REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
+ swaps(&stuff->length, n);
+ swapl(&stuff->crtc, n);
+ swaps(&stuff->size, n);
+ SwapRestS(stuff);
+ return (*ProcRandrVector[stuff->randrReqType]) (client);
}
int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {