Compare commits
4 Commits
master
...
submit/cle
Author | SHA1 | Date | |
---|---|---|---|
|
87f3335cff | ||
|
911d22b8e0 | ||
|
94310d62ca | ||
|
188651d733 |
181
xfixes/cursor.c
181
xfixes/cursor.c
|
@ -229,11 +229,10 @@ XFixesSelectCursorInput(ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask)
|
|||
return Success;
|
||||
}
|
||||
if (!e) {
|
||||
e = (CursorEventPtr) malloc(sizeof(CursorEventRec));
|
||||
e = (CursorEventPtr) calloc(1, sizeof(CursorEventRec));
|
||||
if (!e)
|
||||
return BadAlloc;
|
||||
|
||||
e->next = 0;
|
||||
e->pClient = pClient;
|
||||
e->pWindow = pWindow;
|
||||
e->clientResource = FakeClientID(pClient->index);
|
||||
|
@ -302,7 +301,7 @@ SProcXFixesSelectCursorInput(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesSelectCursorInputReq);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->eventMask);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesSelectCursorInput(client);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
|
@ -361,9 +360,7 @@ int
|
|||
ProcXFixesGetCursorImage(ClientPtr client)
|
||||
{
|
||||
/* REQUEST(xXFixesGetCursorImageReq); */
|
||||
xXFixesGetCursorImageReply *rep;
|
||||
CursorPtr pCursor;
|
||||
CARD32 *image;
|
||||
int npixels, width, height, rc, x, y;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq);
|
||||
|
@ -378,49 +375,44 @@ ProcXFixesGetCursorImage(ClientPtr client)
|
|||
width = pCursor->bits->width;
|
||||
height = pCursor->bits->height;
|
||||
npixels = width * height;
|
||||
rep = calloc(1,
|
||||
sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32));
|
||||
if (!rep)
|
||||
|
||||
CARD32 *image = calloc(npixels, sizeof(CARD32));
|
||||
if (!image)
|
||||
return BadAlloc;
|
||||
|
||||
rep->type = X_Reply;
|
||||
rep->sequenceNumber = client->sequence;
|
||||
rep->length = npixels;
|
||||
rep->width = width;
|
||||
rep->height = height;
|
||||
rep->x = x;
|
||||
rep->y = y;
|
||||
rep->xhot = pCursor->bits->xhot;
|
||||
rep->yhot = pCursor->bits->yhot;
|
||||
rep->cursorSerial = pCursor->serialNumber;
|
||||
|
||||
image = (CARD32 *) (rep + 1);
|
||||
CopyCursorToImage(pCursor, image);
|
||||
|
||||
xXFixesGetCursorImageReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = npixels,
|
||||
.width = width,
|
||||
.height = height,
|
||||
.x = x,
|
||||
.y = y,
|
||||
.xhot = pCursor->bits->xhot,
|
||||
.yhot = pCursor->bits->yhot,
|
||||
.cursorSerial = pCursor->serialNumber,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->x);
|
||||
swaps(&rep->y);
|
||||
swaps(&rep->width);
|
||||
swaps(&rep->height);
|
||||
swaps(&rep->xhot);
|
||||
swaps(&rep->yhot);
|
||||
swapl(&rep->cursorSerial);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.x);
|
||||
swaps(&rep.y);
|
||||
swaps(&rep.width);
|
||||
swaps(&rep.height);
|
||||
swaps(&rep.xhot);
|
||||
swaps(&rep.yhot);
|
||||
swapl(&rep.cursorSerial);
|
||||
SwapLongs(image, npixels);
|
||||
}
|
||||
WriteToClient(client,
|
||||
sizeof(xXFixesGetCursorImageReply) + (npixels << 2), rep);
|
||||
free(rep);
|
||||
WriteToClient(client, sizeof(xXFixesGetCursorImageReply), &rep);
|
||||
WriteToClient(client, npixels * sizeof(CARD32), image);
|
||||
free(image);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesGetCursorImage(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesGetCursorImageReq);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesSetCursorName(ClientPtr client)
|
||||
{
|
||||
|
@ -448,16 +440,15 @@ SProcXFixesSetCursorName(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq);
|
||||
swapl(&stuff->cursor);
|
||||
swaps(&stuff->nbytes);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesSetCursorName(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesGetCursorName(ClientPtr client)
|
||||
{
|
||||
CursorPtr pCursor;
|
||||
xXFixesGetCursorNameReply reply;
|
||||
|
||||
REQUEST(xXFixesGetCursorNameReq);
|
||||
|
||||
CursorPtr pCursor;
|
||||
const char *str;
|
||||
int len;
|
||||
|
||||
|
@ -469,7 +460,7 @@ ProcXFixesGetCursorName(ClientPtr client)
|
|||
str = "";
|
||||
len = strlen(str);
|
||||
|
||||
reply = (xXFixesGetCursorNameReply) {
|
||||
xXFixesGetCursorNameReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(len),
|
||||
|
@ -477,12 +468,12 @@ ProcXFixesGetCursorName(ClientPtr client)
|
|||
.nbytes = len
|
||||
};
|
||||
if (client->swapped) {
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swapl(&reply.atom);
|
||||
swaps(&reply.nbytes);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.atom);
|
||||
swaps(&rep.nbytes);
|
||||
}
|
||||
WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply);
|
||||
WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &rep);
|
||||
WriteToClient(client, len, str);
|
||||
|
||||
return Success;
|
||||
|
@ -494,19 +485,17 @@ SProcXFixesGetCursorName(ClientPtr client)
|
|||
REQUEST(xXFixesGetCursorNameReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
|
||||
swapl(&stuff->cursor);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesGetCursorName(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesGetCursorImageAndName(ClientPtr client)
|
||||
{
|
||||
/* REQUEST(xXFixesGetCursorImageAndNameReq); */
|
||||
xXFixesGetCursorImageAndNameReply *rep;
|
||||
CursorPtr pCursor;
|
||||
CARD32 *image;
|
||||
int npixels;
|
||||
const char *name;
|
||||
int nbytes, nbytesRound;
|
||||
int nbytes;
|
||||
int width, height;
|
||||
int rc, x, y;
|
||||
|
||||
|
@ -524,55 +513,51 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
|
|||
npixels = width * height;
|
||||
name = pCursor->name ? NameForAtom(pCursor->name) : "";
|
||||
nbytes = strlen(name);
|
||||
nbytesRound = pad_to_int32(nbytes);
|
||||
rep = calloc(1, sizeof(xXFixesGetCursorImageAndNameReply) +
|
||||
npixels * sizeof(CARD32) + nbytesRound);
|
||||
if (!rep)
|
||||
|
||||
// pixmap plus name (padded to 4 bytes)
|
||||
const size_t image_size = (npixels + bytes_to_int32(nbytes)) * sizeof(CARD32);
|
||||
CARD32 *image = calloc(1, image_size);
|
||||
if (!image)
|
||||
return BadAlloc;
|
||||
|
||||
rep->type = X_Reply;
|
||||
rep->sequenceNumber = client->sequence;
|
||||
rep->length = npixels + bytes_to_int32(nbytesRound);
|
||||
rep->width = width;
|
||||
rep->height = height;
|
||||
rep->x = x;
|
||||
rep->y = y;
|
||||
rep->xhot = pCursor->bits->xhot;
|
||||
rep->yhot = pCursor->bits->yhot;
|
||||
rep->cursorSerial = pCursor->serialNumber;
|
||||
rep->cursorName = pCursor->name;
|
||||
rep->nbytes = nbytes;
|
||||
|
||||
image = (CARD32 *) (rep + 1);
|
||||
CopyCursorToImage(pCursor, image);
|
||||
memcpy((image + npixels), name, nbytes);
|
||||
|
||||
xXFixesGetCursorImageAndNameReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(image_size),
|
||||
.width = width,
|
||||
.height = height,
|
||||
.x = x,
|
||||
.y = y,
|
||||
.xhot = pCursor->bits->xhot,
|
||||
.yhot = pCursor->bits->yhot,
|
||||
.cursorSerial = pCursor->serialNumber,
|
||||
.cursorName = pCursor->name,
|
||||
.nbytes = nbytes,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->x);
|
||||
swaps(&rep->y);
|
||||
swaps(&rep->width);
|
||||
swaps(&rep->height);
|
||||
swaps(&rep->xhot);
|
||||
swaps(&rep->yhot);
|
||||
swapl(&rep->cursorSerial);
|
||||
swapl(&rep->cursorName);
|
||||
swaps(&rep->nbytes);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.x);
|
||||
swaps(&rep.y);
|
||||
swaps(&rep.width);
|
||||
swaps(&rep.height);
|
||||
swaps(&rep.xhot);
|
||||
swaps(&rep.yhot);
|
||||
swapl(&rep.cursorSerial);
|
||||
swapl(&rep.cursorName);
|
||||
swaps(&rep.nbytes);
|
||||
SwapLongs(image, npixels);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXFixesGetCursorImageAndNameReply) +
|
||||
(npixels << 2) + nbytesRound, rep);
|
||||
free(rep);
|
||||
WriteToClient(client, sizeof(xXFixesGetCursorImageAndNameReply), &rep);
|
||||
WriteToClient(client, image_size, image);
|
||||
free(image);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesGetCursorImageAndName(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesGetCursorImageAndNameReq);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find every cursor reference in the system, ask testCursor
|
||||
* whether it should be replaced with a reference to pCursor.
|
||||
|
@ -699,7 +684,7 @@ SProcXFixesChangeCursor(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
|
||||
swapl(&stuff->source);
|
||||
swapl(&stuff->destination);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesChangeCursor(client);
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
@ -736,7 +721,7 @@ SProcXFixesChangeCursorByName(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xXFixesChangeCursorByNameReq);
|
||||
swapl(&stuff->source);
|
||||
swaps(&stuff->nbytes);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesChangeCursorByName(client);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -892,7 +877,7 @@ SProcXFixesHideCursor(ClientPtr client)
|
|||
REQUEST(xXFixesHideCursorReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesHideCursorReq);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesHideCursor(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -940,7 +925,7 @@ SProcXFixesShowCursor(ClientPtr client)
|
|||
REQUEST(xXFixesShowCursorReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesShowCursorReq);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesShowCursor(client);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1026,7 +1011,7 @@ SProcXFixesCreatePointerBarrier(ClientPtr client)
|
|||
swaps(in_devices + i);
|
||||
}
|
||||
|
||||
return ProcXFixesVector[stuff->xfixesReqType] (client);
|
||||
return ProcXFixesCreatePointerBarrier(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1045,7 +1030,7 @@ SProcXFixesDestroyPointerBarrier(ClientPtr client)
|
|||
REQUEST(xXFixesDestroyPointerBarrierReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq);
|
||||
swapl(&stuff->barrier);
|
||||
return ProcXFixesVector[stuff->xfixesReqType] (client);
|
||||
return ProcXFixesDestroyPointerBarrier(client);
|
||||
}
|
||||
|
||||
Bool
|
||||
|
|
|
@ -80,41 +80,31 @@ SProcXFixesSetClientDisconnectMode(ClientPtr client)
|
|||
|
||||
swapl(&stuff->disconnect_mode);
|
||||
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesSetClientDisconnectMode(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesGetClientDisconnectMode(ClientPtr client)
|
||||
{
|
||||
ClientDisconnectPtr pDisconnect = GetClientDisconnect(client);
|
||||
xXFixesGetClientDisconnectModeReply reply;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetClientDisconnectModeReq);
|
||||
|
||||
reply = (xXFixesGetClientDisconnectModeReply) {
|
||||
xXFixesGetClientDisconnectModeReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 0,
|
||||
.disconnect_mode = pDisconnect->disconnect_mode,
|
||||
};
|
||||
if (client->swapped) {
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.disconnect_mode);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.disconnect_mode);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXFixesGetClientDisconnectModeReply), &reply);
|
||||
WriteToClient(client, sizeof(xXFixesGetClientDisconnectModeReply), &rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesGetClientDisconnectMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesGetClientDisconnectModeReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesGetClientDisconnectModeReq);
|
||||
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
}
|
||||
|
||||
Bool
|
||||
XFixesShouldDisconnectClient(ClientPtr client)
|
||||
{
|
||||
|
|
175
xfixes/region.c
175
xfixes/region.c
|
@ -98,7 +98,7 @@ SProcXFixesCreateRegion(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq);
|
||||
swapl(&stuff->region);
|
||||
SwapRestS(stuff);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesCreateRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -140,7 +140,7 @@ SProcXFixesCreateRegionFromBitmap(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromBitmapReq);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->bitmap);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesCreateRegionFromBitmap(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -197,7 +197,7 @@ SProcXFixesCreateRegionFromWindow(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromWindowReq);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->window);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesCreateRegionFromWindow(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -238,7 +238,7 @@ SProcXFixesCreateRegionFromGC(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromGCReq);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->gc);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesCreateRegionFromGC(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -278,7 +278,7 @@ SProcXFixesCreateRegionFromPicture(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromPictureReq);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->picture);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesCreateRegionFromPicture(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -299,7 +299,7 @@ SProcXFixesDestroyRegion(ClientPtr client)
|
|||
REQUEST(xXFixesDestroyRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
|
||||
swapl(&stuff->region);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesDestroyRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -336,7 +336,7 @@ SProcXFixesSetRegion(ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq);
|
||||
swapl(&stuff->region);
|
||||
SwapRestS(stuff);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesSetRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -363,7 +363,7 @@ SProcXFixesCopyRegion(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesCopyRegionReq);
|
||||
swapl(&stuff->source);
|
||||
swapl(&stuff->destination);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesCopyRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -404,7 +404,7 @@ SProcXFixesCombineRegion(ClientPtr client)
|
|||
swapl(&stuff->source1);
|
||||
swapl(&stuff->source2);
|
||||
swapl(&stuff->destination);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesCombineRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -449,7 +449,7 @@ SProcXFixesInvertRegion(ClientPtr client)
|
|||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
swapl(&stuff->destination);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesInvertRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -474,7 +474,7 @@ SProcXFixesTranslateRegion(ClientPtr client)
|
|||
swapl(&stuff->region);
|
||||
swaps(&stuff->dx);
|
||||
swaps(&stuff->dy);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesTranslateRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -500,15 +500,13 @@ SProcXFixesRegionExtents(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq);
|
||||
swapl(&stuff->source);
|
||||
swapl(&stuff->destination);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesRegionExtents(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesFetchRegion(ClientPtr client)
|
||||
{
|
||||
RegionPtr pRegion;
|
||||
xXFixesFetchRegionReply *reply;
|
||||
xRectangle *pRect;
|
||||
BoxPtr pExtent;
|
||||
BoxPtr pBox;
|
||||
int i, nBox;
|
||||
|
@ -522,37 +520,39 @@ ProcXFixesFetchRegion(ClientPtr client)
|
|||
pBox = RegionRects(pRegion);
|
||||
nBox = RegionNumRects(pRegion);
|
||||
|
||||
reply = calloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle),
|
||||
1);
|
||||
if (!reply)
|
||||
xRectangle *pRect = calloc(nBox, sizeof(xRectangle));
|
||||
if (!pRect)
|
||||
return BadAlloc;
|
||||
reply->type = X_Reply;
|
||||
reply->sequenceNumber = client->sequence;
|
||||
reply->length = nBox << 1;
|
||||
reply->x = pExtent->x1;
|
||||
reply->y = pExtent->y1;
|
||||
reply->width = pExtent->x2 - pExtent->x1;
|
||||
reply->height = pExtent->y2 - pExtent->y1;
|
||||
|
||||
pRect = (xRectangle *) (reply + 1);
|
||||
for (i = 0; i < nBox; i++) {
|
||||
pRect[i].x = pBox[i].x1;
|
||||
pRect[i].y = pBox[i].y1;
|
||||
pRect[i].width = pBox[i].x2 - pBox[i].x1;
|
||||
pRect[i].height = pBox[i].y2 - pBox[i].y1;
|
||||
}
|
||||
|
||||
xXFixesFetchRegionReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = nBox << 1,
|
||||
.x = pExtent->x1,
|
||||
.y = pExtent->y1,
|
||||
.width = pExtent->x2 - pExtent->x1,
|
||||
.height = pExtent->y2 - pExtent->y1,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&reply->sequenceNumber);
|
||||
swapl(&reply->length);
|
||||
swaps(&reply->x);
|
||||
swaps(&reply->y);
|
||||
swaps(&reply->width);
|
||||
swaps(&reply->height);
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.x);
|
||||
swaps(&rep.y);
|
||||
swaps(&rep.width);
|
||||
swaps(&rep.height);
|
||||
SwapShorts((INT16 *) pRect, nBox * 4);
|
||||
}
|
||||
WriteToClient(client, sizeof(xXFixesFetchRegionReply) +
|
||||
nBox * sizeof(xRectangle), (char *) reply);
|
||||
free(reply);
|
||||
WriteToClient(client, sizeof(xXFixesFetchRegionReply), &rep);
|
||||
WriteToClient(client, sizeof(pRect), pRect);
|
||||
free(pRect);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -562,20 +562,36 @@ SProcXFixesFetchRegion(ClientPtr client)
|
|||
REQUEST(xXFixesFetchRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
|
||||
swapl(&stuff->region);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesFetchRegion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
PanoramiXFixesSetGCClipRegion(ClientPtr client, xXFixesSetGCClipRegionReq *stuff);
|
||||
|
||||
static int
|
||||
SingleXFixesSetGCClipRegion(ClientPtr client, xXFixesSetGCClipRegionReq *stuff);
|
||||
|
||||
int
|
||||
ProcXFixesSetGCClipRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetGCClipRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
|
||||
|
||||
#ifdef XINERAMA
|
||||
if (XFixesUseXinerama)
|
||||
return PanoramiXFixesSetGCClipRegion(client, stuff);
|
||||
#endif
|
||||
return SingleXFixesSetGCClipRegion(client, stuff);
|
||||
}
|
||||
|
||||
static int
|
||||
SingleXFixesSetGCClipRegion(ClientPtr client, xXFixesSetGCClipRegionReq *stuff)
|
||||
{
|
||||
GCPtr pGC;
|
||||
RegionPtr pRegion;
|
||||
ChangeGCVal vals[2];
|
||||
int rc;
|
||||
|
||||
REQUEST(xXFixesSetGCClipRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
|
||||
|
||||
rc = dixLookupGC(&pGC, stuff->gc, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
@ -606,22 +622,19 @@ SProcXFixesSetGCClipRegion(ClientPtr client)
|
|||
swapl(&stuff->region);
|
||||
swaps(&stuff->xOrigin);
|
||||
swaps(&stuff->yOrigin);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesSetGCClipRegion(client);
|
||||
}
|
||||
|
||||
typedef RegionPtr (*CreateDftPtr) (WindowPtr pWin);
|
||||
|
||||
int
|
||||
ProcXFixesSetWindowShapeRegion(ClientPtr client)
|
||||
static int
|
||||
SingleXFixesSetWindowShapeRegion(ClientPtr client, xXFixesSetWindowShapeRegionReq *stuff)
|
||||
{
|
||||
WindowPtr pWin;
|
||||
RegionPtr pRegion;
|
||||
RegionPtr *pDestRegion;
|
||||
int rc;
|
||||
|
||||
REQUEST(xXFixesSetWindowShapeRegionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
|
||||
rc = dixLookupResourceByType((void **) &pWin, stuff->dest, X11_RESTYPE_WINDOW,
|
||||
client, DixSetAttrAccess);
|
||||
if (rc != Success) {
|
||||
|
@ -685,6 +698,22 @@ ProcXFixesSetWindowShapeRegion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
PanoramiXFixesSetWindowShapeRegion(ClientPtr client, xXFixesSetWindowShapeRegionReq *stuff);
|
||||
|
||||
int
|
||||
ProcXFixesSetWindowShapeRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetWindowShapeRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
|
||||
|
||||
#ifdef XINERAMA
|
||||
if (XFixesUseXinerama)
|
||||
return PanoramiXFixesSetWindowShapeRegion(client, stuff);
|
||||
#endif
|
||||
return SingleXFixesSetWindowShapeRegion(client, stuff);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSetWindowShapeRegion(ClientPtr client)
|
||||
{
|
||||
|
@ -694,18 +723,34 @@ SProcXFixesSetWindowShapeRegion(ClientPtr client)
|
|||
swaps(&stuff->xOff);
|
||||
swaps(&stuff->yOff);
|
||||
swapl(&stuff->region);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesSetWindowShapeRegion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SingleXFixesSetPictureClipRegion(ClientPtr client, xXFixesSetPictureClipRegionReq *stuff);
|
||||
|
||||
static int
|
||||
PanoramiXFixesSetPictureClipRegion(ClientPtr client, xXFixesSetPictureClipRegionReq *stuff);
|
||||
|
||||
int
|
||||
ProcXFixesSetPictureClipRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetPictureClipRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq);
|
||||
|
||||
#ifdef XINERAMA
|
||||
if (XFixesUseXinerama)
|
||||
return PanoramiXFixesSetPictureClipRegion(client, stuff);
|
||||
#endif
|
||||
return SingleXFixesSetPictureClipRegion(client, stuff);
|
||||
}
|
||||
|
||||
static int
|
||||
SingleXFixesSetPictureClipRegion(ClientPtr client, xXFixesSetPictureClipRegionReq *stuff)
|
||||
{
|
||||
PicturePtr pPicture;
|
||||
RegionPtr pRegion;
|
||||
|
||||
REQUEST(xXFixesSetPictureClipRegionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq);
|
||||
VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess);
|
||||
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess);
|
||||
|
||||
|
@ -725,7 +770,7 @@ SProcXFixesSetPictureClipRegion(ClientPtr client)
|
|||
swapl(&stuff->region);
|
||||
swaps(&stuff->xOrigin);
|
||||
swaps(&stuff->yOrigin);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesSetPictureClipRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -778,22 +823,19 @@ SProcXFixesExpandRegion(ClientPtr client)
|
|||
swaps(&stuff->right);
|
||||
swaps(&stuff->top);
|
||||
swaps(&stuff->bottom);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesExpandRegion(client);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
|
||||
int
|
||||
PanoramiXFixesSetGCClipRegion(ClientPtr client)
|
||||
static int
|
||||
PanoramiXFixesSetGCClipRegion(ClientPtr client, xXFixesSetGCClipRegionReq *stuff)
|
||||
{
|
||||
REQUEST(xXFixesSetGCClipRegionReq);
|
||||
int result = Success, j;
|
||||
PanoramiXRes *gc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
|
||||
|
||||
if ((result = dixLookupResourceByType((void **) &gc, stuff->gc, XRT_GC,
|
||||
client, DixWriteAccess))) {
|
||||
client->errorValue = stuff->gc;
|
||||
|
@ -802,7 +844,7 @@ PanoramiXFixesSetGCClipRegion(ClientPtr client)
|
|||
|
||||
FOR_NSCREENS_BACKWARD(j) {
|
||||
stuff->gc = gc->info[j].id;
|
||||
result = (*PanoramiXSaveXFixesVector[X_XFixesSetGCClipRegion]) (client);
|
||||
result = SingleXFixesSetGCClipRegion(client, stuff);
|
||||
if (result != Success)
|
||||
break;
|
||||
}
|
||||
|
@ -810,17 +852,13 @@ PanoramiXFixesSetGCClipRegion(ClientPtr client)
|
|||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
PanoramiXFixesSetWindowShapeRegion(ClientPtr client)
|
||||
static int
|
||||
PanoramiXFixesSetWindowShapeRegion(ClientPtr client, xXFixesSetWindowShapeRegionReq *stuff)
|
||||
{
|
||||
int result = Success, j;
|
||||
PanoramiXRes *win;
|
||||
RegionPtr reg = NULL;
|
||||
|
||||
REQUEST(xXFixesSetWindowShapeRegionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
|
||||
|
||||
if ((result = dixLookupResourceByType((void **) &win, stuff->dest,
|
||||
XRT_WINDOW, client,
|
||||
DixWriteAccess))) {
|
||||
|
@ -838,8 +876,7 @@ PanoramiXFixesSetWindowShapeRegion(ClientPtr client)
|
|||
if (reg)
|
||||
RegionTranslate(reg, -screen->x, -screen->y);
|
||||
|
||||
result =
|
||||
(*PanoramiXSaveXFixesVector[X_XFixesSetWindowShapeRegion]) (client);
|
||||
result = SingleXFixesSetWindowShapeRegion(client, stuff);
|
||||
|
||||
if (reg)
|
||||
RegionTranslate(reg, screen->x, screen->y);
|
||||
|
@ -851,16 +888,13 @@ PanoramiXFixesSetWindowShapeRegion(ClientPtr client)
|
|||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
PanoramiXFixesSetPictureClipRegion(ClientPtr client)
|
||||
static int
|
||||
PanoramiXFixesSetPictureClipRegion(ClientPtr client, xXFixesSetPictureClipRegionReq *stuff)
|
||||
{
|
||||
REQUEST(xXFixesSetPictureClipRegionReq);
|
||||
int result = Success, j;
|
||||
PanoramiXRes *pict;
|
||||
RegionPtr reg = NULL;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq);
|
||||
|
||||
if ((result = dixLookupResourceByType((void **) &pict, stuff->picture,
|
||||
XRT_PICTURE, client,
|
||||
DixWriteAccess))) {
|
||||
|
@ -878,8 +912,7 @@ PanoramiXFixesSetPictureClipRegion(ClientPtr client)
|
|||
if (reg)
|
||||
RegionTranslate(reg, -screen->x, -screen->y);
|
||||
|
||||
result =
|
||||
(*PanoramiXSaveXFixesVector[X_XFixesSetPictureClipRegion]) (client);
|
||||
result = SingleXFixesSetPictureClipRegion(client, stuff);
|
||||
|
||||
if (reg)
|
||||
RegionTranslate(reg, screen->x, screen->y);
|
||||
|
|
|
@ -65,5 +65,5 @@ SProcXFixesChangeSaveSet(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq);
|
||||
|
||||
swapl(&stuff->window);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesChangeSaveSet(client);
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ SProcXFixesSelectSelectionInput(ClientPtr client)
|
|||
swapl(&stuff->window);
|
||||
swapl(&stuff->selection);
|
||||
swapl(&stuff->eventMask);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesSelectSelectionInput(client);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
|
|
276
xfixes/xfixes.c
276
xfixes/xfixes.c
|
@ -110,56 +110,99 @@ static const int version_requests[] = {
|
|||
X_XFixesGetClientDisconnectMode, /* Version 6 */
|
||||
};
|
||||
|
||||
int (*ProcXFixesVector[XFixesNumberRequests]) (ClientPtr) = {
|
||||
/*************** Version 1 ******************/
|
||||
ProcXFixesQueryVersion,
|
||||
ProcXFixesChangeSaveSet,
|
||||
ProcXFixesSelectSelectionInput,
|
||||
ProcXFixesSelectCursorInput, ProcXFixesGetCursorImage,
|
||||
/*************** Version 2 ******************/
|
||||
ProcXFixesCreateRegion,
|
||||
ProcXFixesCreateRegionFromBitmap,
|
||||
ProcXFixesCreateRegionFromWindow,
|
||||
ProcXFixesCreateRegionFromGC,
|
||||
ProcXFixesCreateRegionFromPicture,
|
||||
ProcXFixesDestroyRegion,
|
||||
ProcXFixesSetRegion,
|
||||
ProcXFixesCopyRegion,
|
||||
ProcXFixesCombineRegion,
|
||||
ProcXFixesCombineRegion,
|
||||
ProcXFixesCombineRegion,
|
||||
ProcXFixesInvertRegion,
|
||||
ProcXFixesTranslateRegion,
|
||||
ProcXFixesRegionExtents,
|
||||
ProcXFixesFetchRegion,
|
||||
ProcXFixesSetGCClipRegion,
|
||||
ProcXFixesSetWindowShapeRegion,
|
||||
ProcXFixesSetPictureClipRegion,
|
||||
ProcXFixesSetCursorName,
|
||||
ProcXFixesGetCursorName,
|
||||
ProcXFixesGetCursorImageAndName,
|
||||
ProcXFixesChangeCursor, ProcXFixesChangeCursorByName,
|
||||
/*************** Version 3 ******************/
|
||||
ProcXFixesExpandRegion,
|
||||
/*************** Version 4 ****************/
|
||||
ProcXFixesHideCursor, ProcXFixesShowCursor,
|
||||
/*************** Version 5 ****************/
|
||||
ProcXFixesCreatePointerBarrier, ProcXFixesDestroyPointerBarrier,
|
||||
/*************** Version 6 ****************/
|
||||
ProcXFixesSetClientDisconnectMode, ProcXFixesGetClientDisconnectMode,
|
||||
};
|
||||
|
||||
static int
|
||||
ProcXFixesDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesReq);
|
||||
REQUEST(xReq);
|
||||
XFixesClientPtr pXFixesClient = GetXFixesClient(client);
|
||||
|
||||
if (pXFixesClient->major_version >= ARRAY_SIZE(version_requests))
|
||||
return BadRequest;
|
||||
if (stuff->xfixesReqType > version_requests[pXFixesClient->major_version])
|
||||
if (stuff->data > version_requests[pXFixesClient->major_version])
|
||||
return BadRequest;
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
|
||||
switch (stuff->data) {
|
||||
/*************** Version 1 ******************/
|
||||
case X_XFixesQueryVersion:
|
||||
return ProcXFixesQueryVersion(client);
|
||||
case X_XFixesChangeSaveSet:
|
||||
return ProcXFixesChangeSaveSet(client);
|
||||
case X_XFixesSelectSelectionInput:
|
||||
return ProcXFixesSelectSelectionInput(client);
|
||||
case X_XFixesSelectCursorInput:
|
||||
return ProcXFixesSelectCursorInput(client);
|
||||
case X_XFixesGetCursorImage:
|
||||
return ProcXFixesGetCursorImage(client);
|
||||
|
||||
/*************** Version 2 ******************/
|
||||
case X_XFixesCreateRegion:
|
||||
return ProcXFixesCreateRegion(client);
|
||||
case X_XFixesCreateRegionFromBitmap:
|
||||
return ProcXFixesCreateRegionFromBitmap(client);
|
||||
case X_XFixesCreateRegionFromWindow:
|
||||
return ProcXFixesCreateRegionFromWindow(client);
|
||||
case X_XFixesCreateRegionFromGC:
|
||||
return ProcXFixesCreateRegionFromGC(client);
|
||||
case X_XFixesCreateRegionFromPicture:
|
||||
return ProcXFixesCreateRegionFromPicture(client);
|
||||
case X_XFixesDestroyRegion:
|
||||
return ProcXFixesDestroyRegion(client);
|
||||
case X_XFixesSetRegion:
|
||||
return ProcXFixesSetRegion(client);
|
||||
case X_XFixesCopyRegion:
|
||||
return ProcXFixesCopyRegion(client);
|
||||
case X_XFixesUnionRegion:
|
||||
return ProcXFixesCombineRegion(client);
|
||||
case X_XFixesIntersectRegion:
|
||||
return ProcXFixesCombineRegion(client);
|
||||
case X_XFixesSubtractRegion:
|
||||
return ProcXFixesCombineRegion(client);
|
||||
case X_XFixesInvertRegion:
|
||||
return ProcXFixesInvertRegion(client);
|
||||
case X_XFixesTranslateRegion:
|
||||
return ProcXFixesTranslateRegion(client);
|
||||
case X_XFixesRegionExtents:
|
||||
return ProcXFixesRegionExtents(client);
|
||||
case X_XFixesFetchRegion:
|
||||
return ProcXFixesFetchRegion(client);
|
||||
case X_XFixesSetGCClipRegion:
|
||||
return ProcXFixesSetGCClipRegion(client);
|
||||
case X_XFixesSetWindowShapeRegion:
|
||||
return ProcXFixesSetWindowShapeRegion(client);
|
||||
case X_XFixesSetPictureClipRegion:
|
||||
return ProcXFixesSetPictureClipRegion(client);
|
||||
case X_XFixesSetCursorName:
|
||||
return ProcXFixesSetCursorName(client);
|
||||
case X_XFixesGetCursorName:
|
||||
return ProcXFixesGetCursorName(client);
|
||||
case X_XFixesGetCursorImageAndName:
|
||||
return ProcXFixesGetCursorImageAndName(client);
|
||||
case X_XFixesChangeCursor:
|
||||
return ProcXFixesChangeCursor(client);
|
||||
case X_XFixesChangeCursorByName:
|
||||
return ProcXFixesChangeCursorByName(client);
|
||||
|
||||
/*************** Version 3 ******************/
|
||||
case X_XFixesExpandRegion:
|
||||
return ProcXFixesExpandRegion(client);
|
||||
/*************** Version 4 ******************/
|
||||
case X_XFixesHideCursor:
|
||||
return ProcXFixesHideCursor(client);
|
||||
case X_XFixesShowCursor:
|
||||
return ProcXFixesShowCursor(client);
|
||||
/*************** Version 5 ******************/
|
||||
case X_XFixesCreatePointerBarrier:
|
||||
return ProcXFixesCreatePointerBarrier(client);
|
||||
case X_XFixesDestroyPointerBarrier:
|
||||
return ProcXFixesDestroyPointerBarrier(client);
|
||||
/*************** Version 6 ******************/
|
||||
case X_XFixesSetClientDisconnectMode:
|
||||
return ProcXFixesSetClientDisconnectMode(client);
|
||||
case X_XFixesGetClientDisconnectMode:
|
||||
return ProcXFixesGetClientDisconnectMode(client);
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
}
|
||||
|
||||
static _X_COLD int
|
||||
|
@ -170,59 +213,102 @@ SProcXFixesQueryVersion(ClientPtr client)
|
|||
|
||||
swapl(&stuff->majorVersion);
|
||||
swapl(&stuff->minorVersion);
|
||||
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
return ProcXFixesQueryVersion(client);
|
||||
}
|
||||
|
||||
static int (*SProcXFixesVector[XFixesNumberRequests]) (ClientPtr) = {
|
||||
/*************** Version 1 ******************/
|
||||
SProcXFixesQueryVersion,
|
||||
SProcXFixesChangeSaveSet,
|
||||
SProcXFixesSelectSelectionInput,
|
||||
SProcXFixesSelectCursorInput, SProcXFixesGetCursorImage,
|
||||
/*************** Version 2 ******************/
|
||||
SProcXFixesCreateRegion,
|
||||
SProcXFixesCreateRegionFromBitmap,
|
||||
SProcXFixesCreateRegionFromWindow,
|
||||
SProcXFixesCreateRegionFromGC,
|
||||
SProcXFixesCreateRegionFromPicture,
|
||||
SProcXFixesDestroyRegion,
|
||||
SProcXFixesSetRegion,
|
||||
SProcXFixesCopyRegion,
|
||||
SProcXFixesCombineRegion,
|
||||
SProcXFixesCombineRegion,
|
||||
SProcXFixesCombineRegion,
|
||||
SProcXFixesInvertRegion,
|
||||
SProcXFixesTranslateRegion,
|
||||
SProcXFixesRegionExtents,
|
||||
SProcXFixesFetchRegion,
|
||||
SProcXFixesSetGCClipRegion,
|
||||
SProcXFixesSetWindowShapeRegion,
|
||||
SProcXFixesSetPictureClipRegion,
|
||||
SProcXFixesSetCursorName,
|
||||
SProcXFixesGetCursorName,
|
||||
SProcXFixesGetCursorImageAndName,
|
||||
SProcXFixesChangeCursor, SProcXFixesChangeCursorByName,
|
||||
/*************** Version 3 ******************/
|
||||
SProcXFixesExpandRegion,
|
||||
/*************** Version 4 ****************/
|
||||
SProcXFixesHideCursor, SProcXFixesShowCursor,
|
||||
/*************** Version 5 ****************/
|
||||
SProcXFixesCreatePointerBarrier, SProcXFixesDestroyPointerBarrier,
|
||||
/*************** Version 6 ****************/
|
||||
SProcXFixesSetClientDisconnectMode, SProcXFixesGetClientDisconnectMode,
|
||||
};
|
||||
|
||||
static _X_COLD int
|
||||
SProcXFixesDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesReq);
|
||||
REQUEST(xReq);
|
||||
XFixesClientPtr pXFixesClient = GetXFixesClient(client);
|
||||
|
||||
if (pXFixesClient->major_version >= ARRAY_SIZE(version_requests))
|
||||
return BadRequest;
|
||||
if (stuff->xfixesReqType > version_requests[pXFixesClient->major_version])
|
||||
if (stuff->data > version_requests[pXFixesClient->major_version])
|
||||
return BadRequest;
|
||||
return (*SProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||
|
||||
switch (stuff->data) {
|
||||
/*************** Version 1 ******************/
|
||||
case X_XFixesQueryVersion:
|
||||
return SProcXFixesQueryVersion(client);
|
||||
case X_XFixesChangeSaveSet:
|
||||
return SProcXFixesChangeSaveSet(client);
|
||||
case X_XFixesSelectSelectionInput:
|
||||
return SProcXFixesSelectSelectionInput(client);
|
||||
case X_XFixesSelectCursorInput:
|
||||
return SProcXFixesSelectCursorInput(client);
|
||||
case X_XFixesGetCursorImage:
|
||||
return ProcXFixesGetCursorImage(client);
|
||||
|
||||
/*************** Version 2 ******************/
|
||||
case X_XFixesCreateRegion:
|
||||
return SProcXFixesCreateRegion(client);
|
||||
case X_XFixesCreateRegionFromBitmap:
|
||||
return SProcXFixesCreateRegionFromBitmap(client);
|
||||
case X_XFixesCreateRegionFromWindow:
|
||||
return SProcXFixesCreateRegionFromWindow(client);
|
||||
case X_XFixesCreateRegionFromGC:
|
||||
return SProcXFixesCreateRegionFromGC(client);
|
||||
case X_XFixesCreateRegionFromPicture:
|
||||
return SProcXFixesCreateRegionFromPicture(client);
|
||||
case X_XFixesDestroyRegion:
|
||||
return SProcXFixesDestroyRegion(client);
|
||||
case X_XFixesSetRegion:
|
||||
return SProcXFixesSetRegion(client);
|
||||
case X_XFixesCopyRegion:
|
||||
return SProcXFixesCopyRegion(client);
|
||||
case X_XFixesUnionRegion:
|
||||
return SProcXFixesCombineRegion(client);
|
||||
case X_XFixesIntersectRegion:
|
||||
return SProcXFixesCombineRegion(client);
|
||||
case X_XFixesSubtractRegion:
|
||||
return SProcXFixesCombineRegion(client);
|
||||
case X_XFixesInvertRegion:
|
||||
return SProcXFixesInvertRegion(client);
|
||||
case X_XFixesTranslateRegion:
|
||||
return SProcXFixesTranslateRegion(client);
|
||||
case X_XFixesRegionExtents:
|
||||
return SProcXFixesRegionExtents(client);
|
||||
case X_XFixesFetchRegion:
|
||||
return SProcXFixesFetchRegion(client);
|
||||
case X_XFixesSetGCClipRegion:
|
||||
return SProcXFixesSetGCClipRegion(client);
|
||||
case X_XFixesSetWindowShapeRegion:
|
||||
return SProcXFixesSetWindowShapeRegion(client);
|
||||
case X_XFixesSetPictureClipRegion:
|
||||
return SProcXFixesSetPictureClipRegion(client);
|
||||
case X_XFixesSetCursorName:
|
||||
return SProcXFixesSetCursorName(client);
|
||||
case X_XFixesGetCursorName:
|
||||
return SProcXFixesGetCursorName(client);
|
||||
case X_XFixesGetCursorImageAndName:
|
||||
return ProcXFixesGetCursorImageAndName(client);
|
||||
case X_XFixesChangeCursor:
|
||||
return SProcXFixesChangeCursor(client);
|
||||
case X_XFixesChangeCursorByName:
|
||||
return SProcXFixesChangeCursorByName(client);
|
||||
|
||||
/*************** Version 3 ******************/
|
||||
case X_XFixesExpandRegion:
|
||||
return SProcXFixesExpandRegion(client);
|
||||
/*************** Version 4 ******************/
|
||||
case X_XFixesHideCursor:
|
||||
return SProcXFixesHideCursor(client);
|
||||
case X_XFixesShowCursor:
|
||||
return SProcXFixesShowCursor(client);
|
||||
/*************** Version 5 ******************/
|
||||
case X_XFixesCreatePointerBarrier:
|
||||
return SProcXFixesCreatePointerBarrier(client);
|
||||
case X_XFixesDestroyPointerBarrier:
|
||||
return SProcXFixesDestroyPointerBarrier(client);
|
||||
/*************** Version 6 ******************/
|
||||
case X_XFixesSetClientDisconnectMode:
|
||||
return SProcXFixesSetClientDisconnectMode(client);
|
||||
case X_XFixesGetClientDisconnectMode:
|
||||
return ProcXFixesGetClientDisconnectMode(client);
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -257,32 +343,18 @@ XFixesExtensionInit(void)
|
|||
|
||||
#ifdef XINERAMA
|
||||
|
||||
int (*PanoramiXSaveXFixesVector[XFixesNumberRequests]) (ClientPtr);
|
||||
int XFixesUseXinerama = 0;
|
||||
|
||||
void
|
||||
PanoramiXFixesInit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < XFixesNumberRequests; i++)
|
||||
PanoramiXSaveXFixesVector[i] = ProcXFixesVector[i];
|
||||
/*
|
||||
* Stuff in Xinerama aware request processing hooks
|
||||
*/
|
||||
ProcXFixesVector[X_XFixesSetGCClipRegion] = PanoramiXFixesSetGCClipRegion;
|
||||
ProcXFixesVector[X_XFixesSetWindowShapeRegion] =
|
||||
PanoramiXFixesSetWindowShapeRegion;
|
||||
ProcXFixesVector[X_XFixesSetPictureClipRegion] =
|
||||
PanoramiXFixesSetPictureClipRegion;
|
||||
XFixesUseXinerama = 1;
|
||||
}
|
||||
|
||||
void
|
||||
PanoramiXFixesReset(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < XFixesNumberRequests; i++)
|
||||
ProcXFixesVector[i] = PanoramiXSaveXFixesVector[i];
|
||||
XFixesUseXinerama = 0;
|
||||
}
|
||||
|
||||
#endif /* XINERAMA */
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
#include "xfixes.h"
|
||||
|
||||
extern int XFixesEventBase;
|
||||
extern int XFixesUseXinerama;
|
||||
|
||||
typedef struct _XFixesClient {
|
||||
CARD32 major_version;
|
||||
|
@ -68,8 +69,6 @@ typedef struct _XFixesClient {
|
|||
|
||||
#define GetXFixesClient(pClient) ((XFixesClientPtr)dixLookupPrivate(&(pClient)->devPrivates, XFixesClientPrivateKey))
|
||||
|
||||
extern int (*ProcXFixesVector[XFixesNumberRequests]) (ClientPtr);
|
||||
|
||||
/* Save set */
|
||||
int
|
||||
ProcXFixesChangeSaveSet(ClientPtr client);
|
||||
|
@ -109,9 +108,6 @@ SXFixesCursorNotifyEvent(xXFixesCursorNotifyEvent * from,
|
|||
int
|
||||
ProcXFixesGetCursorImage(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesGetCursorImage(ClientPtr client);
|
||||
|
||||
/* Cursor names (Version 2) */
|
||||
|
||||
int
|
||||
|
@ -129,9 +125,6 @@ int
|
|||
int
|
||||
ProcXFixesGetCursorImageAndName(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesGetCursorImageAndName(ClientPtr client);
|
||||
|
||||
/* Cursor replacement (Version 2) */
|
||||
|
||||
int
|
||||
|
@ -252,15 +245,6 @@ int
|
|||
int
|
||||
SProcXFixesExpandRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
PanoramiXFixesSetGCClipRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
PanoramiXFixesSetWindowShapeRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
PanoramiXFixesSetPictureClipRegion(ClientPtr client);
|
||||
|
||||
/* Cursor Visibility (Version 4) */
|
||||
|
||||
int
|
||||
|
@ -303,15 +287,11 @@ int
|
|||
int
|
||||
SProcXFixesSetClientDisconnectMode(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesGetClientDisconnectMode(ClientPtr client);
|
||||
|
||||
Bool
|
||||
XFixesShouldDisconnectClient(ClientPtr client);
|
||||
|
||||
/* Xinerama */
|
||||
#ifdef XINERAMA
|
||||
extern int (*PanoramiXSaveXFixesVector[XFixesNumberRequests]) (ClientPtr);
|
||||
void PanoramiXFixesInit(void);
|
||||
void PanoramiXFixesReset(void);
|
||||
#endif /* XINERAMA */
|
||||
|
|
Loading…
Reference in New Issue