xfixes: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
Use the new macros to make request struct parsing / field swapping much easier. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
c2270f38b3
commit
9b8638da17
200
xfixes/cursor.c
200
xfixes/cursor.c
|
@ -47,6 +47,7 @@
|
|||
#include "dix/cursor_priv.h"
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/input_priv.h"
|
||||
#include "dix/request_priv.h"
|
||||
#include "dix/screen_hooks_priv.h"
|
||||
|
||||
#include "xfixesint.h"
|
||||
|
@ -257,11 +258,13 @@ XFixesSelectCursorInput(ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask)
|
|||
int
|
||||
ProcXFixesSelectCursorInput(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSelectCursorInputReq);
|
||||
REQUEST_HEAD_STRUCT(xXFixesSelectCursorInputReq);
|
||||
REQUEST_FIELD_CARD32(window);
|
||||
REQUEST_FIELD_CARD32(eventMask);
|
||||
|
||||
WindowPtr pWin;
|
||||
int rc;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesSelectCursorInputReq);
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
@ -288,16 +291,6 @@ GetBit(unsigned char *line, int x)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSelectCursorInput(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSelectCursorInputReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSelectCursorInputReq);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->eventMask);
|
||||
return ProcXFixesSelectCursorInput(client);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SXFixesCursorNotifyEvent(xXFixesCursorNotifyEvent * from,
|
||||
xXFixesCursorNotifyEvent * to)
|
||||
|
@ -353,11 +346,11 @@ CopyCursorToImage(CursorPtr pCursor, CARD32 *image)
|
|||
int
|
||||
ProcXFixesGetCursorImage(ClientPtr client)
|
||||
{
|
||||
/* REQUEST(xXFixesGetCursorImageReq); */
|
||||
REQUEST_HEAD_STRUCT(xXFixesGetCursorImageReq);
|
||||
|
||||
CursorPtr pCursor;
|
||||
int npixels, width, height, rc, x, y;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorImageReq);
|
||||
pCursor = CursorForClient(client);
|
||||
if (!pCursor)
|
||||
return BadCursor;
|
||||
|
@ -403,23 +396,18 @@ ProcXFixesGetCursorImage(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesGetCursorImage(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesGetCursorImageReq);
|
||||
return ProcXFixesGetCursorImage(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesSetCursorName(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_AT_LEAST(xXFixesSetCursorNameReq);
|
||||
REQUEST_FIELD_CARD32(cursor);
|
||||
REQUEST_FIELD_CARD16(nbytes);
|
||||
REQUEST_FIXED_SIZE(xXFixesSetCursorNameReq, stuff->nbytes);
|
||||
|
||||
CursorPtr pCursor;
|
||||
char *tchar;
|
||||
|
||||
REQUEST(xXFixesSetCursorNameReq);
|
||||
Atom atom;
|
||||
|
||||
REQUEST_FIXED_SIZE(xXFixesSetCursorNameReq, stuff->nbytes);
|
||||
VERIFY_CURSOR(pCursor, stuff->cursor, client, DixSetAttrAccess);
|
||||
tchar = (char *) &stuff[1];
|
||||
atom = MakeAtom(tchar, stuff->nbytes, TRUE);
|
||||
|
@ -430,26 +418,16 @@ ProcXFixesSetCursorName(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSetCursorName(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetCursorNameReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq);
|
||||
swapl(&stuff->cursor);
|
||||
swaps(&stuff->nbytes);
|
||||
return ProcXFixesSetCursorName(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesGetCursorName(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesGetCursorNameReq);
|
||||
REQUEST_HEAD_STRUCT(xXFixesGetCursorNameReq);
|
||||
REQUEST_FIELD_CARD32(cursor);
|
||||
|
||||
CursorPtr pCursor;
|
||||
const char *str;
|
||||
int len;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
|
||||
VERIFY_CURSOR(pCursor, stuff->cursor, client, DixGetAttrAccess);
|
||||
if (pCursor->name)
|
||||
str = NameForAtom(pCursor->name);
|
||||
|
@ -476,19 +454,11 @@ ProcXFixesGetCursorName(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesGetCursorName(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesGetCursorNameReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
|
||||
swapl(&stuff->cursor);
|
||||
return ProcXFixesGetCursorName(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesGetCursorImageAndName(ClientPtr client)
|
||||
{
|
||||
/* REQUEST(xXFixesGetCursorImageAndNameReq); */
|
||||
REQUEST_HEAD_STRUCT(xXFixesGetCursorImageAndNameReq);
|
||||
|
||||
CursorPtr pCursor;
|
||||
int npixels;
|
||||
const char *name;
|
||||
|
@ -496,7 +466,6 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
|
|||
int width, height;
|
||||
int rc, x, y;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetCursorImageAndNameReq);
|
||||
pCursor = CursorForClient(client);
|
||||
if (!pCursor)
|
||||
return BadCursor;
|
||||
|
@ -552,13 +521,6 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesGetCursorImageAndName(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesGetCursorImageAndNameReq);
|
||||
return ProcXFixesGetCursorImageAndName(client);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find every cursor reference in the system, ask testCursor
|
||||
* whether it should be replaced with a reference to pCursor.
|
||||
|
@ -664,11 +626,12 @@ TestForCursor(CursorPtr pCursor, void *closure)
|
|||
int
|
||||
ProcXFixesChangeCursor(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesChangeCursorReq);
|
||||
REQUEST_FIELD_CARD32(source);
|
||||
REQUEST_FIELD_CARD32(destination);
|
||||
|
||||
CursorPtr pSource, pDestination;
|
||||
|
||||
REQUEST(xXFixesChangeCursorReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
|
||||
VERIFY_CURSOR(pSource, stuff->source, client,
|
||||
DixReadAccess | DixGetAttrAccess);
|
||||
VERIFY_CURSOR(pDestination, stuff->destination, client,
|
||||
|
@ -678,16 +641,6 @@ ProcXFixesChangeCursor(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesChangeCursor(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesChangeCursorReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
|
||||
swapl(&stuff->source);
|
||||
swapl(&stuff->destination);
|
||||
return ProcXFixesChangeCursor(client);
|
||||
}
|
||||
|
||||
static Bool
|
||||
TestForCursorName(CursorPtr pCursor, void *closure)
|
||||
{
|
||||
|
@ -699,13 +652,15 @@ TestForCursorName(CursorPtr pCursor, void *closure)
|
|||
int
|
||||
ProcXFixesChangeCursorByName(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_AT_LEAST(xXFixesChangeCursorByNameReq);
|
||||
REQUEST_FIELD_CARD32(source);
|
||||
REQUEST_FIELD_CARD16(nbytes);
|
||||
REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes);
|
||||
|
||||
CursorPtr pSource;
|
||||
Atom name;
|
||||
char *tchar;
|
||||
|
||||
REQUEST(xXFixesChangeCursorByNameReq);
|
||||
|
||||
REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes);
|
||||
VERIFY_CURSOR(pSource, stuff->source, client,
|
||||
DixReadAccess | DixGetAttrAccess);
|
||||
tchar = (char *) &stuff[1];
|
||||
|
@ -715,16 +670,6 @@ ProcXFixesChangeCursorByName(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesChangeCursorByName(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesChangeCursorByNameReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesChangeCursorByNameReq);
|
||||
swapl(&stuff->source);
|
||||
swaps(&stuff->nbytes);
|
||||
return ProcXFixesChangeCursorByName(client);
|
||||
}
|
||||
|
||||
/*
|
||||
* Routines for manipulating the per-screen hide counts list.
|
||||
* This list indicates which clients have requested cursor hiding
|
||||
|
@ -821,14 +766,13 @@ deleteCursorHideCountsForScreen(ScreenPtr pScreen)
|
|||
int
|
||||
ProcXFixesHideCursor(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesHideCursorReq);
|
||||
REQUEST_FIELD_CARD32(window);
|
||||
|
||||
WindowPtr pWin;
|
||||
CursorHideCountPtr pChc;
|
||||
|
||||
REQUEST(xXFixesHideCursorReq);
|
||||
int ret;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesHideCursorReq);
|
||||
|
||||
ret = dixLookupResourceByType((void **) &pWin, stuff->window, X11_RESTYPE_WINDOW,
|
||||
client, DixGetAttrAccess);
|
||||
if (ret != Success) {
|
||||
|
@ -870,26 +814,16 @@ ProcXFixesHideCursor(ClientPtr client)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesHideCursor(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesHideCursorReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesHideCursorReq);
|
||||
swapl(&stuff->window);
|
||||
return ProcXFixesHideCursor(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesShowCursor(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesShowCursorReq);
|
||||
REQUEST_FIELD_CARD32(window);
|
||||
|
||||
WindowPtr pWin;
|
||||
CursorHideCountPtr pChc;
|
||||
int rc;
|
||||
|
||||
REQUEST(xXFixesShowCursorReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesShowCursorReq);
|
||||
|
||||
rc = dixLookupResourceByType((void **) &pWin, stuff->window, X11_RESTYPE_WINDOW,
|
||||
client, DixGetAttrAccess);
|
||||
if (rc != Success) {
|
||||
|
@ -918,15 +852,6 @@ ProcXFixesShowCursor(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesShowCursor(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesShowCursorReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesShowCursorReq);
|
||||
swapl(&stuff->window);
|
||||
return ProcXFixesShowCursor(client);
|
||||
}
|
||||
|
||||
static int
|
||||
CursorFreeClient(void *data, XID id)
|
||||
{
|
||||
|
@ -977,61 +902,40 @@ CursorFreeWindow(void *data, XID id)
|
|||
int
|
||||
ProcXFixesCreatePointerBarrier(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCreatePointerBarrierReq);
|
||||
|
||||
REQUEST_HEAD_AT_LEAST(xXFixesCreatePointerBarrierReq);
|
||||
REQUEST_FIELD_CARD16(num_devices);
|
||||
REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq,
|
||||
pad_to_int32(stuff->num_devices * sizeof(CARD16)));
|
||||
|
||||
REQUEST_FIELD_CARD32(barrier);
|
||||
REQUEST_FIELD_CARD32(window);
|
||||
REQUEST_FIELD_CARD16(x1);
|
||||
REQUEST_FIELD_CARD16(y1);
|
||||
REQUEST_FIELD_CARD16(x2);
|
||||
REQUEST_FIELD_CARD16(y2);
|
||||
REQUEST_FIELD_CARD32(directions);
|
||||
|
||||
// FIXME
|
||||
if (client->swapped) {
|
||||
CARD16 *in_devices = (CARD16 *) &stuff[1];
|
||||
for (int i = 0; i < stuff->num_devices; i++) {
|
||||
swaps(in_devices + i);
|
||||
}
|
||||
}
|
||||
|
||||
LEGAL_NEW_RESOURCE(stuff->barrier, client);
|
||||
|
||||
return XICreatePointerBarrier(client, stuff);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesCreatePointerBarrier(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCreatePointerBarrierReq);
|
||||
int i;
|
||||
CARD16 *in_devices = (CARD16 *) &stuff[1];
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesCreatePointerBarrierReq);
|
||||
|
||||
swaps(&stuff->num_devices);
|
||||
REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq,
|
||||
pad_to_int32(stuff->num_devices * sizeof(CARD16)));
|
||||
|
||||
swapl(&stuff->barrier);
|
||||
swapl(&stuff->window);
|
||||
swaps(&stuff->x1);
|
||||
swaps(&stuff->y1);
|
||||
swaps(&stuff->x2);
|
||||
swaps(&stuff->y2);
|
||||
swapl(&stuff->directions);
|
||||
for (i = 0; i < stuff->num_devices; i++) {
|
||||
swaps(in_devices + i);
|
||||
}
|
||||
|
||||
return ProcXFixesCreatePointerBarrier(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesDestroyPointerBarrier(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesDestroyPointerBarrierReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq);
|
||||
|
||||
REQUEST_HEAD_STRUCT(xXFixesDestroyPointerBarrierReq);
|
||||
REQUEST_FIELD_CARD32(barrier);
|
||||
return XIDestroyPointerBarrier(client, stuff);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesDestroyPointerBarrier(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesDestroyPointerBarrierReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq);
|
||||
swapl(&stuff->barrier);
|
||||
return ProcXFixesDestroyPointerBarrier(client);
|
||||
}
|
||||
|
||||
Bool
|
||||
XFixesCursorInit(void)
|
||||
{
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <dix-config.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/request_priv.h"
|
||||
|
||||
#include "xfixesint.h"
|
||||
|
||||
|
@ -63,32 +64,21 @@ typedef struct _ClientDisconnect {
|
|||
int
|
||||
ProcXFixesSetClientDisconnectMode(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesSetClientDisconnectModeReq);
|
||||
REQUEST_FIELD_CARD32(disconnect_mode);
|
||||
|
||||
ClientDisconnectPtr pDisconnect = GetClientDisconnect(client);
|
||||
|
||||
REQUEST(xXFixesSetClientDisconnectModeReq);
|
||||
|
||||
pDisconnect->disconnect_mode = stuff->disconnect_mode;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSetClientDisconnectMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetClientDisconnectModeReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesSetClientDisconnectModeReq);
|
||||
|
||||
swapl(&stuff->disconnect_mode);
|
||||
|
||||
return ProcXFixesSetClientDisconnectMode(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesGetClientDisconnectMode(ClientPtr client)
|
||||
{
|
||||
ClientDisconnectPtr pDisconnect = GetClientDisconnect(client);
|
||||
REQUEST_HEAD_STRUCT(xXFixesGetClientDisconnectModeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesGetClientDisconnectModeReq);
|
||||
ClientDisconnectPtr pDisconnect = GetClientDisconnect(client);
|
||||
|
||||
xXFixesGetClientDisconnectModeReply rep = {
|
||||
.type = X_Reply,
|
||||
|
@ -105,15 +95,6 @@ ProcXFixesGetClientDisconnectMode(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesGetClientDisconnectMode(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesGetClientDisconnectModeReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesGetClientDisconnectModeReq);
|
||||
|
||||
return ProcXFixesGetClientDisconnectMode(client);
|
||||
}
|
||||
|
||||
Bool
|
||||
XFixesShouldDisconnectClient(ClientPtr client)
|
||||
{
|
||||
|
|
317
xfixes/region.c
317
xfixes/region.c
|
@ -23,6 +23,7 @@
|
|||
#include <dix-config.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/request_priv.h"
|
||||
#include "render/picturestr_priv.h"
|
||||
#include "Xext/panoramiX.h"
|
||||
#include "Xext/panoramiXsrv.h"
|
||||
|
@ -71,12 +72,13 @@ XFixesRegionInit(void)
|
|||
int
|
||||
ProcXFixesCreateRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_AT_LEAST(xXFixesCreateRegionReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_REST_CARD16();
|
||||
|
||||
int things;
|
||||
RegionPtr pRegion;
|
||||
|
||||
REQUEST(xXFixesCreateRegionReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq);
|
||||
LEGAL_NEW_RESOURCE(stuff->region, client);
|
||||
|
||||
things = (client->req_len << 2) - sizeof(xXFixesCreateRegionReq);
|
||||
|
@ -93,26 +95,17 @@ ProcXFixesCreateRegion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesCreateRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCreateRegionReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq);
|
||||
swapl(&stuff->region);
|
||||
SwapRestS(stuff);
|
||||
return ProcXFixesCreateRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesCreateRegionFromBitmap(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesCreateRegionFromBitmapReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_FIELD_CARD32(bitmap);
|
||||
|
||||
RegionPtr pRegion;
|
||||
PixmapPtr pPixmap;
|
||||
int rc;
|
||||
|
||||
REQUEST(xXFixesCreateRegionFromBitmapReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromBitmapReq);
|
||||
LEGAL_NEW_RESOURCE(stuff->region, client);
|
||||
|
||||
rc = dixLookupResourceByType((void **) &pPixmap, stuff->bitmap, X11_RESTYPE_PIXMAP,
|
||||
|
@ -135,27 +128,18 @@ ProcXFixesCreateRegionFromBitmap(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesCreateRegionFromBitmap(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCreateRegionFromBitmapReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromBitmapReq);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->bitmap);
|
||||
return ProcXFixesCreateRegionFromBitmap(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesCreateRegionFromWindow(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesCreateRegionFromWindowReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_FIELD_CARD32(window);
|
||||
|
||||
RegionPtr pRegion;
|
||||
Bool copy = TRUE;
|
||||
WindowPtr pWin;
|
||||
int rc;
|
||||
|
||||
REQUEST(xXFixesCreateRegionFromWindowReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromWindowReq);
|
||||
LEGAL_NEW_RESOURCE(stuff->region, client);
|
||||
rc = dixLookupResourceByType((void **) &pWin, stuff->window, X11_RESTYPE_WINDOW,
|
||||
client, DixGetAttrAccess);
|
||||
|
@ -192,26 +176,17 @@ ProcXFixesCreateRegionFromWindow(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesCreateRegionFromWindow(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCreateRegionFromWindowReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromWindowReq);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->window);
|
||||
return ProcXFixesCreateRegionFromWindow(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesCreateRegionFromGC(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesCreateRegionFromGCReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_FIELD_CARD32(gc);
|
||||
|
||||
RegionPtr pRegion, pClip;
|
||||
GCPtr pGC;
|
||||
int rc;
|
||||
|
||||
REQUEST(xXFixesCreateRegionFromGCReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromGCReq);
|
||||
LEGAL_NEW_RESOURCE(stuff->region, client);
|
||||
|
||||
rc = dixLookupGC(&pGC, stuff->gc, client, DixGetAttrAccess);
|
||||
|
@ -233,25 +208,16 @@ ProcXFixesCreateRegionFromGC(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesCreateRegionFromGC(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCreateRegionFromGCReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromGCReq);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->gc);
|
||||
return ProcXFixesCreateRegionFromGC(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesCreateRegionFromPicture(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesCreateRegionFromPictureReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_FIELD_CARD32(picture);
|
||||
|
||||
RegionPtr pRegion;
|
||||
PicturePtr pPicture;
|
||||
|
||||
REQUEST(xXFixesCreateRegionFromPictureReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromPictureReq);
|
||||
LEGAL_NEW_RESOURCE(stuff->region, client);
|
||||
|
||||
VERIFY_PICTURE(pPicture, stuff->picture, client, DixGetAttrAccess);
|
||||
|
@ -273,46 +239,29 @@ ProcXFixesCreateRegionFromPicture(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesCreateRegionFromPicture(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCreateRegionFromPictureReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCreateRegionFromPictureReq);
|
||||
swapl(&stuff->region);
|
||||
swapl(&stuff->picture);
|
||||
return ProcXFixesCreateRegionFromPicture(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesDestroyRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesDestroyRegionReq);
|
||||
REQUEST_HEAD_STRUCT(xXFixesDestroyRegionReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
|
||||
RegionPtr pRegion;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
|
||||
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
|
||||
FreeResource(stuff->region, X11_RESTYPE_NONE);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesDestroyRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesDestroyRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
|
||||
swapl(&stuff->region);
|
||||
return ProcXFixesDestroyRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesSetRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_AT_LEAST(xXFixesSetRegionReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_REST_CARD16();
|
||||
|
||||
int things;
|
||||
RegionPtr pRegion, pNew;
|
||||
|
||||
REQUEST(xXFixesSetRegionReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq);
|
||||
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
|
||||
|
||||
things = (client->req_len << 2) - sizeof(xXFixesCreateRegionReq);
|
||||
|
@ -331,23 +280,14 @@ ProcXFixesSetRegion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSetRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetRegionReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq);
|
||||
swapl(&stuff->region);
|
||||
SwapRestS(stuff);
|
||||
return ProcXFixesSetRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesCopyRegion(ClientPtr client)
|
||||
{
|
||||
RegionPtr pSource, pDestination;
|
||||
REQUEST_HEAD_STRUCT(xXFixesCopyRegionReq);
|
||||
REQUEST_FIELD_CARD32(source);
|
||||
REQUEST_FIELD_CARD32(destination);
|
||||
|
||||
REQUEST(xXFixesCopyRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCopyRegionReq);
|
||||
RegionPtr pSource, pDestination;
|
||||
|
||||
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
|
||||
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
|
||||
|
@ -358,24 +298,16 @@ ProcXFixesCopyRegion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesCopyRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCopyRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCopyRegionReq);
|
||||
swapl(&stuff->source);
|
||||
swapl(&stuff->destination);
|
||||
return ProcXFixesCopyRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesCombineRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesCombineRegionReq);
|
||||
REQUEST_FIELD_CARD32(source1);
|
||||
REQUEST_FIELD_CARD32(source2);
|
||||
REQUEST_FIELD_CARD32(destination);
|
||||
|
||||
RegionPtr pSource1, pSource2, pDestination;
|
||||
|
||||
REQUEST(xXFixesCombineRegionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesCombineRegionReq);
|
||||
VERIFY_REGION(pSource1, stuff->source1, client, DixReadAccess);
|
||||
VERIFY_REGION(pSource2, stuff->source2, client, DixReadAccess);
|
||||
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
|
||||
|
@ -398,26 +330,20 @@ ProcXFixesCombineRegion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesCombineRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesCombineRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesCombineRegionReq);
|
||||
swapl(&stuff->source1);
|
||||
swapl(&stuff->source2);
|
||||
swapl(&stuff->destination);
|
||||
return ProcXFixesCombineRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesInvertRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesInvertRegionReq);
|
||||
REQUEST_FIELD_CARD32(source);
|
||||
REQUEST_FIELD_CARD16(x);
|
||||
REQUEST_FIELD_CARD16(y);
|
||||
REQUEST_FIELD_CARD16(width);
|
||||
REQUEST_FIELD_CARD16(height);
|
||||
REQUEST_FIELD_CARD32(destination);
|
||||
|
||||
RegionPtr pSource, pDestination;
|
||||
BoxRec bounds;
|
||||
|
||||
REQUEST(xXFixesInvertRegionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesInvertRegionReq);
|
||||
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
|
||||
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
|
||||
|
||||
|
@ -440,53 +366,32 @@ ProcXFixesInvertRegion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesInvertRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesInvertRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesInvertRegionReq);
|
||||
swapl(&stuff->source);
|
||||
swaps(&stuff->x);
|
||||
swaps(&stuff->y);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
swapl(&stuff->destination);
|
||||
return ProcXFixesInvertRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesTranslateRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesTranslateRegionReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_FIELD_CARD16(dx);
|
||||
REQUEST_FIELD_CARD16(dy);
|
||||
|
||||
RegionPtr pRegion;
|
||||
|
||||
REQUEST(xXFixesTranslateRegionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
|
||||
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
|
||||
|
||||
RegionTranslate(pRegion, stuff->dx, stuff->dy);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesTranslateRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesTranslateRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
|
||||
swapl(&stuff->region);
|
||||
swaps(&stuff->dx);
|
||||
swaps(&stuff->dy);
|
||||
return ProcXFixesTranslateRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesRegionExtents(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesRegionExtentsReq);
|
||||
|
||||
REQUEST_FIELD_CARD32(source);
|
||||
REQUEST_FIELD_CARD32(destination);
|
||||
|
||||
RegionPtr pSource, pDestination;
|
||||
|
||||
REQUEST(xXFixesRegionExtentsReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq);
|
||||
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
|
||||
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
|
||||
|
||||
|
@ -495,27 +400,17 @@ ProcXFixesRegionExtents(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesRegionExtents(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesRegionExtentsReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq);
|
||||
swapl(&stuff->source);
|
||||
swapl(&stuff->destination);
|
||||
return ProcXFixesRegionExtents(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesFetchRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesFetchRegionReq);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
|
||||
RegionPtr pRegion;
|
||||
BoxPtr pExtent;
|
||||
BoxPtr pBox;
|
||||
int i, nBox;
|
||||
|
||||
REQUEST(xXFixesFetchRegionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
|
||||
VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess);
|
||||
|
||||
pExtent = RegionExtents(pRegion);
|
||||
|
@ -555,15 +450,6 @@ ProcXFixesFetchRegion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesFetchRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesFetchRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
|
||||
swapl(&stuff->region);
|
||||
return ProcXFixesFetchRegion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
PanoramiXFixesSetGCClipRegion(ClientPtr client, xXFixesSetGCClipRegionReq *stuff);
|
||||
|
||||
|
@ -573,10 +459,13 @@ SingleXFixesSetGCClipRegion(ClientPtr client, xXFixesSetGCClipRegionReq *stuff);
|
|||
int
|
||||
ProcXFixesSetGCClipRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetGCClipRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
|
||||
REQUEST_HEAD_STRUCT(xXFixesSetGCClipRegionReq);
|
||||
REQUEST_FIELD_CARD32(gc);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_FIELD_CARD16(xOrigin);
|
||||
REQUEST_FIELD_CARD16(yOrigin);
|
||||
|
||||
#ifdef PANORAMIX
|
||||
#ifdef XINERAMA
|
||||
if (XFixesUseXinerama)
|
||||
return PanoramiXFixesSetGCClipRegion(client, stuff);
|
||||
#endif
|
||||
|
@ -612,18 +501,6 @@ SingleXFixesSetGCClipRegion(ClientPtr client, xXFixesSetGCClipRegionReq *stuff)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSetGCClipRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetGCClipRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
|
||||
swapl(&stuff->gc);
|
||||
swapl(&stuff->region);
|
||||
swaps(&stuff->xOrigin);
|
||||
swaps(&stuff->yOrigin);
|
||||
return ProcXFixesSetGCClipRegion(client);
|
||||
}
|
||||
|
||||
typedef RegionPtr (*CreateDftPtr) (WindowPtr pWin);
|
||||
|
||||
static int
|
||||
|
@ -703,28 +580,19 @@ PanoramiXFixesSetWindowShapeRegion(ClientPtr client, xXFixesSetWindowShapeRegion
|
|||
int
|
||||
ProcXFixesSetWindowShapeRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetWindowShapeRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
|
||||
REQUEST_HEAD_STRUCT(xXFixesSetWindowShapeRegionReq);
|
||||
REQUEST_FIELD_CARD32(dest);
|
||||
REQUEST_FIELD_CARD16(xOff);
|
||||
REQUEST_FIELD_CARD16(yOff);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
|
||||
#ifdef PANORAMIX
|
||||
#ifdef XINERAMA
|
||||
if (XFixesUseXinerama)
|
||||
return PanoramiXFixesSetWindowShapeRegion(client, stuff);
|
||||
#endif
|
||||
return SingleXFixesSetWindowShapeRegion(client, stuff);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSetWindowShapeRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetWindowShapeRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
|
||||
swapl(&stuff->dest);
|
||||
swaps(&stuff->xOff);
|
||||
swaps(&stuff->yOff);
|
||||
swapl(&stuff->region);
|
||||
return ProcXFixesSetWindowShapeRegion(client);
|
||||
}
|
||||
|
||||
static int
|
||||
SingleXFixesSetPictureClipRegion(ClientPtr client, xXFixesSetPictureClipRegionReq *stuff);
|
||||
|
||||
|
@ -734,10 +602,13 @@ PanoramiXFixesSetPictureClipRegion(ClientPtr client, xXFixesSetPictureClipRegion
|
|||
int
|
||||
ProcXFixesSetPictureClipRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetPictureClipRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq);
|
||||
REQUEST_HEAD_STRUCT(xXFixesSetPictureClipRegionReq);
|
||||
REQUEST_FIELD_CARD32(picture);
|
||||
REQUEST_FIELD_CARD32(region);
|
||||
REQUEST_FIELD_CARD16(xOrigin);
|
||||
REQUEST_FIELD_CARD16(yOrigin);
|
||||
|
||||
#ifdef PANORAMIX
|
||||
#ifdef XINERAMA
|
||||
if (XFixesUseXinerama)
|
||||
return PanoramiXFixesSetPictureClipRegion(client, stuff);
|
||||
#endif
|
||||
|
@ -760,30 +631,24 @@ SingleXFixesSetPictureClipRegion(ClientPtr client, xXFixesSetPictureClipRegionRe
|
|||
pRegion);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSetPictureClipRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSetPictureClipRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq);
|
||||
swapl(&stuff->picture);
|
||||
swapl(&stuff->region);
|
||||
swaps(&stuff->xOrigin);
|
||||
swaps(&stuff->yOrigin);
|
||||
return ProcXFixesSetPictureClipRegion(client);
|
||||
}
|
||||
|
||||
int
|
||||
ProcXFixesExpandRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesExpandRegionReq);
|
||||
REQUEST_FIELD_CARD32(source);
|
||||
REQUEST_FIELD_CARD32(destination);
|
||||
REQUEST_FIELD_CARD16(left);
|
||||
REQUEST_FIELD_CARD16(right);
|
||||
REQUEST_FIELD_CARD16(top);
|
||||
REQUEST_FIELD_CARD16(bottom);
|
||||
|
||||
RegionPtr pSource, pDestination;
|
||||
|
||||
REQUEST(xXFixesExpandRegionReq);
|
||||
BoxPtr pTmp;
|
||||
BoxPtr pSrc;
|
||||
int nBoxes;
|
||||
int i;
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesExpandRegionReq);
|
||||
VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
|
||||
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
|
||||
|
||||
|
@ -811,20 +676,6 @@ ProcXFixesExpandRegion(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesExpandRegion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesExpandRegionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesExpandRegionReq);
|
||||
swapl(&stuff->source);
|
||||
swapl(&stuff->destination);
|
||||
swaps(&stuff->left);
|
||||
swaps(&stuff->right);
|
||||
swaps(&stuff->top);
|
||||
swaps(&stuff->bottom);
|
||||
return ProcXFixesExpandRegion(client);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
|
||||
static int
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <dix-config.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/request_priv.h"
|
||||
#include "dix/resource_priv.h"
|
||||
|
||||
#include "xfixesint.h"
|
||||
|
@ -30,13 +31,13 @@
|
|||
int
|
||||
ProcXFixesChangeSaveSet(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesChangeSaveSetReq);
|
||||
REQUEST_FIELD_CARD32(window);
|
||||
|
||||
Bool toRoot, map;
|
||||
int result;
|
||||
WindowPtr pWin;
|
||||
|
||||
REQUEST(xXFixesChangeSaveSetReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq);
|
||||
result = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
|
||||
if (result != Success)
|
||||
return result;
|
||||
|
@ -58,13 +59,3 @@ ProcXFixesChangeSaveSet(ClientPtr client)
|
|||
map = (stuff->map == SaveSetMap);
|
||||
return AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map);
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesChangeSaveSet(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesChangeSaveSetReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq);
|
||||
|
||||
swapl(&stuff->window);
|
||||
return ProcXFixesChangeSaveSet(client);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <dix-config.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/request_priv.h"
|
||||
|
||||
#include "xfixesint.h"
|
||||
#include "xace.h"
|
||||
|
@ -189,15 +190,26 @@ ProcXFixesSelectSelectionInput(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
int _X_COLD
|
||||
SProcXFixesSelectSelectionInput(ClientPtr client)
|
||||
int
|
||||
ProcXFixesSelectSelectionInput(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesSelectSelectionInputReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq);
|
||||
swapl(&stuff->window);
|
||||
swapl(&stuff->selection);
|
||||
swapl(&stuff->eventMask);
|
||||
return ProcXFixesSelectSelectionInput(client);
|
||||
REQUEST_HEAD_STRUCT(xXFixesSelectSelectionInputReq);
|
||||
REQUEST_FIELD_CARD32(window);
|
||||
REQUEST_FIELD_CARD32(selection);
|
||||
REQUEST_FIELD_CARD32(eventMask);
|
||||
|
||||
WindowPtr pWin;
|
||||
int rc;
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
if (stuff->eventMask & ~SelectionAllEvents) {
|
||||
client->errorValue = stuff->eventMask;
|
||||
return BadValue;
|
||||
}
|
||||
return XFixesSelectSelectionInput(client, stuff->selection,
|
||||
pWin, stuff->eventMask);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
|
|
117
xfixes/xfixes.c
117
xfixes/xfixes.c
|
@ -44,6 +44,7 @@
|
|||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "dix/request_priv.h"
|
||||
#include "os/fmt.h"
|
||||
|
||||
#include "xfixesint.h"
|
||||
|
@ -63,6 +64,10 @@ static DevPrivateKeyRec XFixesClientPrivateKeyRec;
|
|||
static int
|
||||
ProcXFixesQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST_HEAD_STRUCT(xXFixesQueryVersionReq);
|
||||
REQUEST_FIELD_CARD32(majorVersion);
|
||||
REQUEST_FIELD_CARD32(minorVersion);
|
||||
|
||||
int major, minor;
|
||||
XFixesClientPtr pXFixesClient = GetXFixesClient(client);
|
||||
xXFixesQueryVersionReply rep = {
|
||||
|
@ -71,10 +76,6 @@ ProcXFixesQueryVersion(ClientPtr client)
|
|||
.length = 0
|
||||
};
|
||||
|
||||
REQUEST(xXFixesQueryVersionReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
|
||||
|
||||
if (version_compare(stuff->majorVersion, stuff->minorVersion,
|
||||
SERVER_XFIXES_MAJOR_VERSION,
|
||||
SERVER_XFIXES_MINOR_VERSION) < 0) {
|
||||
|
@ -205,112 +206,6 @@ ProcXFixesDispatch(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
static _X_COLD int
|
||||
SProcXFixesQueryVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXFixesQueryVersionReq);
|
||||
REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
|
||||
|
||||
swapl(&stuff->majorVersion);
|
||||
swapl(&stuff->minorVersion);
|
||||
return ProcXFixesQueryVersion(client);
|
||||
}
|
||||
|
||||
static _X_COLD int
|
||||
SProcXFixesDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
XFixesClientPtr pXFixesClient = GetXFixesClient(client);
|
||||
|
||||
if (pXFixesClient->major_version >= ARRAY_SIZE(version_requests))
|
||||
return BadRequest;
|
||||
if (stuff->data > version_requests[pXFixesClient->major_version])
|
||||
return BadRequest;
|
||||
|
||||
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 SProcXFixesGetCursorImage(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 SProcXFixesGetCursorImageAndName(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 SProcXFixesGetClientDisconnectMode(client);
|
||||
default:
|
||||
return BadRequest;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
XFixesExtensionInit(void)
|
||||
{
|
||||
|
@ -326,7 +221,7 @@ XFixesExtensionInit(void)
|
|||
XFixesClientDisconnectInit() &&
|
||||
(extEntry = AddExtension(XFIXES_NAME, XFixesNumberEvents,
|
||||
XFixesNumberErrors,
|
||||
ProcXFixesDispatch, SProcXFixesDispatch,
|
||||
ProcXFixesDispatch, ProcXFixesDispatch,
|
||||
NULL, StandardMinorOpcode)) != 0) {
|
||||
XFixesReqCode = (unsigned char) extEntry->base;
|
||||
XFixesEventBase = extEntry->eventBase;
|
||||
|
|
|
@ -73,16 +73,10 @@ typedef struct _XFixesClient {
|
|||
int
|
||||
ProcXFixesChangeSaveSet(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesChangeSaveSet(ClientPtr client);
|
||||
|
||||
/* Selection events */
|
||||
int
|
||||
ProcXFixesSelectSelectionInput(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesSelectSelectionInput(ClientPtr client);
|
||||
|
||||
void
|
||||
|
||||
SXFixesSelectionNotifyEvent(xXFixesSelectionNotifyEvent * from,
|
||||
|
@ -97,54 +91,32 @@ Bool
|
|||
int
|
||||
ProcXFixesSelectCursorInput(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesSelectCursorInput(ClientPtr client);
|
||||
|
||||
void
|
||||
|
||||
SXFixesCursorNotifyEvent(xXFixesCursorNotifyEvent * from,
|
||||
xXFixesCursorNotifyEvent * to);
|
||||
|
||||
int
|
||||
ProcXFixesGetCursorImage(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesGetCursorImage(ClientPtr client);
|
||||
|
||||
/* Cursor names (Version 2) */
|
||||
|
||||
int
|
||||
ProcXFixesSetCursorName(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesSetCursorName(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesGetCursorName(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesGetCursorName(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesGetCursorImageAndName(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesGetCursorImageAndName(ClientPtr client);
|
||||
|
||||
/* Cursor replacement (Version 2) */
|
||||
|
||||
int
|
||||
ProcXFixesChangeCursor(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesChangeCursor(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesChangeCursorByName(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesChangeCursorByName(ClientPtr client);
|
||||
|
||||
/* Region objects (Version 2* */
|
||||
Bool
|
||||
XFixesRegionInit(void);
|
||||
|
@ -152,133 +124,70 @@ Bool
|
|||
int
|
||||
ProcXFixesCreateRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesCreateRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesCreateRegionFromBitmap(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesCreateRegionFromBitmap(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesCreateRegionFromWindow(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesCreateRegionFromWindow(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesCreateRegionFromGC(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesCreateRegionFromGC(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesCreateRegionFromPicture(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesCreateRegionFromPicture(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesDestroyRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesDestroyRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesSetRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesSetRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesCopyRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesCopyRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesCombineRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesCombineRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesInvertRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesInvertRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesTranslateRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesTranslateRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesRegionExtents(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesRegionExtents(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesFetchRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesFetchRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesSetGCClipRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesSetGCClipRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesSetWindowShapeRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesSetWindowShapeRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesSetPictureClipRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesSetPictureClipRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesExpandRegion(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesExpandRegion(ClientPtr client);
|
||||
|
||||
/* Cursor Visibility (Version 4) */
|
||||
|
||||
int
|
||||
ProcXFixesHideCursor(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesHideCursor(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesShowCursor(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesShowCursor(ClientPtr client);
|
||||
|
||||
/* Version 5 */
|
||||
|
||||
int
|
||||
ProcXFixesCreatePointerBarrier(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesCreatePointerBarrier(ClientPtr client);
|
||||
|
||||
int
|
||||
ProcXFixesDestroyPointerBarrier(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesDestroyPointerBarrier(ClientPtr client);
|
||||
|
||||
/* Version 6 */
|
||||
|
||||
Bool
|
||||
|
@ -290,12 +199,6 @@ int
|
|||
int
|
||||
ProcXFixesGetClientDisconnectMode(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesSetClientDisconnectMode(ClientPtr client);
|
||||
|
||||
int
|
||||
SProcXFixesGetClientDisconnectMode(ClientPtr client);
|
||||
|
||||
Bool
|
||||
XFixesShouldDisconnectClient(ClientPtr client);
|
||||
|
||||
|
|
Loading…
Reference in New Issue