diff options
Diffstat (limited to 'nx-X11/programs/Xserver/xfixes/region.c')
-rw-r--r--[-rwxr-xr-x] | nx-X11/programs/Xserver/xfixes/region.c | 335 |
1 files changed, 156 insertions, 179 deletions
diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 9ceff6d51..18b1d3ff4 100755..100644 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -39,24 +39,24 @@ extern int RenderErrBase; RESTYPE RegionResType; static int -RegionResFree (pointer data, XID id) +RegionResFree (void * data, XID id) { RegionPtr pRegion = (RegionPtr) data; - REGION_DESTROY (0, pRegion); + RegionDestroy(pRegion); return Success; } RegionPtr XFixesRegionCopy (RegionPtr pRegion) { - RegionPtr pNew = REGION_CREATE (0, REGION_EXTENTS(0, pRegion), - REGION_NUM_RECTS(pRegion)); + RegionPtr pNew = RegionCreate(RegionExtents(pRegion), + RegionNumRects(pRegion)); if (!pNew) return 0; - if (!REGION_COPY (0, pNew, pRegion)) + if (!RegionCopy(pNew, pRegion)) { - REGION_DESTROY (0, pNew); + RegionDestroy(pNew); return 0; } return pNew; @@ -84,10 +84,10 @@ ProcXFixesCreateRegion (ClientPtr client) return BadLength; things >>= 3; - pRegion = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED); + pRegion = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED); if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -96,12 +96,11 @@ ProcXFixesCreateRegion (ClientPtr client) int SProcXFixesCreateRegion (ClientPtr client) { - register int n; REQUEST(xXFixesCreateRegionReq); - - swaps(&stuff->length, n); + + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq); - swapl(&stuff->region, n); + swapl(&stuff->region); SwapRestS(stuff); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -118,7 +117,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) pPixmap = (PixmapPtr) SecurityLookupIDByType (client, stuff->bitmap, RT_PIXMAP, - SecurityReadAccess); + DixReadAccess); if (!pPixmap) { client->errorValue = stuff->bitmap; @@ -127,12 +126,12 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) if (pPixmap->drawable.depth != 1) return BadMatch; - pRegion = BITMAP_TO_REGION(pPixmap->drawable.pScreen, pPixmap); + pRegion = BitmapToRegion(pPixmap->drawable.pScreen, pPixmap); if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -141,13 +140,12 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) int SProcXFixesCreateRegionFromBitmap (ClientPtr client) { - int n; - REQUEST (xXFixesCreateRegionFromBitmapReq); + REQUEST(xXFixesCreateRegionFromBitmapReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH (xXFixesCreateRegionFromBitmapReq); - swapl(&stuff->region, n); - swapl(&stuff->bitmap, n); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXFixesCreateRegionFromBitmapReq); + swapl(&stuff->region); + swapl(&stuff->bitmap); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -196,7 +194,7 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) pRegion = XFixesRegionCopy (pRegion); if (!pRegion) return BadAlloc; - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -205,13 +203,12 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client) int SProcXFixesCreateRegionFromWindow (ClientPtr client) { - int n; - REQUEST (xXFixesCreateRegionFromWindowReq); + REQUEST(xXFixesCreateRegionFromWindowReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH (xXFixesCreateRegionFromWindowReq); - swapl(&stuff->region, n); - swapl(&stuff->window, n); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXFixesCreateRegionFromWindowReq); + swapl(&stuff->region); + swapl(&stuff->window); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -225,11 +222,11 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); LEGAL_NEW_RESOURCE (stuff->region, client); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess); + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess); switch (pGC->clientClipType) { case CT_PIXMAP: - pRegion = BITMAP_TO_REGION(pGC->pScreen, (PixmapPtr) pGC->clientClip); + pRegion = BitmapToRegion(pGC->pScreen, (PixmapPtr) pGC->clientClip); if (!pRegion) return BadAlloc; break; @@ -243,7 +240,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) return BadImplementation; /* assume sane server bits */ } - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -252,13 +249,12 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) int SProcXFixesCreateRegionFromGC (ClientPtr client) { - int n; - REQUEST (xXFixesCreateRegionFromGCReq); + REQUEST(xXFixesCreateRegionFromGCReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); - swapl(&stuff->region, n); - swapl(&stuff->gc, n); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXFixesCreateRegionFromGCReq); + swapl(&stuff->region); + swapl(&stuff->gc); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -273,12 +269,12 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq); LEGAL_NEW_RESOURCE (stuff->region, client); - VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityReadAccess, + VERIFY_PICTURE(pPicture, stuff->picture, client, DixReadAccess, RenderErrBase + BadPicture); switch (pPicture->clientClipType) { case CT_PIXMAP: - pRegion = BITMAP_TO_REGION(pPicture->pDrawable->pScreen, + pRegion = BitmapToRegion(pPicture->pDrawable->pScreen, (PixmapPtr) pPicture->clientClip); if (!pRegion) return BadAlloc; @@ -292,7 +288,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) return BadImplementation; /* assume sane server bits */ } - if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) + if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; return(client->noClientException); @@ -304,13 +300,12 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) int SProcXFixesCreateRegionFromPicture (ClientPtr client) { - int n; - REQUEST (xXFixesCreateRegionFromPictureReq); + REQUEST(xXFixesCreateRegionFromPictureReq); - swaps(&stuff->length, n); - REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq); - swapl(&stuff->region, n); - swapl(&stuff->picture, n); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXFixesCreateRegionFromPictureReq); + swapl(&stuff->region); + swapl(&stuff->picture); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -321,7 +316,7 @@ ProcXFixesDestroyRegion (ClientPtr client) RegionPtr pRegion; REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); FreeResource (stuff->region, RT_NONE); return(client->noClientException); } @@ -329,12 +324,11 @@ ProcXFixesDestroyRegion (ClientPtr client) int SProcXFixesDestroyRegion (ClientPtr client) { - int n; - REQUEST (xXFixesDestroyRegionReq); + REQUEST(xXFixesDestroyRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -346,34 +340,33 @@ ProcXFixesSetRegion (ClientPtr client) REQUEST (xXFixesSetRegionReq); REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); things = (client->req_len << 2) - sizeof (xXFixesCreateRegionReq); if (things & 4) return BadLength; things >>= 3; - pNew = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED); + pNew = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED); if (!pNew) return BadAlloc; - if (!REGION_COPY (0, pRegion, pNew)) + if (!RegionCopy(pRegion, pNew)) { - REGION_DESTROY (0, pNew); + RegionDestroy(pNew); return BadAlloc; } - REGION_DESTROY (0, pNew); + RegionDestroy(pNew); return(client->noClientException); } int SProcXFixesSetRegion (ClientPtr client) { - int n; - REQUEST (xXFixesSetRegionReq); + REQUEST(xXFixesSetRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); SwapRestS(stuff); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -384,10 +377,10 @@ ProcXFixesCopyRegion (ClientPtr client) RegionPtr pSource, pDestination; REQUEST (xXFixesCopyRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); - if (!REGION_COPY(pScreen, pDestination, pSource)) + if (!RegionCopy(pDestination, pSource)) return BadAlloc; return(client->noClientException); @@ -396,13 +389,12 @@ ProcXFixesCopyRegion (ClientPtr client) int SProcXFixesCopyRegion (ClientPtr client) { - int n; - REQUEST (xXFixesCopyRegionReq); + REQUEST(xXFixesCopyRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xXFixesCopyRegionReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -414,21 +406,21 @@ ProcXFixesCombineRegion (ClientPtr client) REQUEST (xXFixesCombineRegionReq); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); - VERIFY_REGION(pSource1, stuff->source1, client, SecurityReadAccess); - VERIFY_REGION(pSource2, stuff->source2, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource1, stuff->source1, client, DixReadAccess); + VERIFY_REGION(pSource2, stuff->source2, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); switch (stuff->xfixesReqType) { case X_XFixesUnionRegion: - if (!REGION_UNION (0, pDestination, pSource1, pSource2)) + if (!RegionUnion(pDestination, pSource1, pSource2)) ret = BadAlloc; break; case X_XFixesIntersectRegion: - if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2)) + if (!RegionIntersect(pDestination, pSource1, pSource2)) ret = BadAlloc; break; case X_XFixesSubtractRegion: - if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2)) + if (!RegionSubtract(pDestination, pSource1, pSource2)) ret = BadAlloc; break; } @@ -441,14 +433,13 @@ ProcXFixesCombineRegion (ClientPtr client) int SProcXFixesCombineRegion (ClientPtr client) { - int n; - REQUEST (xXFixesCombineRegionReq); + REQUEST(xXFixesCombineRegionReq); - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); - swapl (&stuff->source1, n); - swapl (&stuff->source2, n); - swapl (&stuff->destination, n); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXFixesCombineRegionReq); + swapl(&stuff->source1); + swapl(&stuff->source2); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -461,8 +452,8 @@ ProcXFixesInvertRegion (ClientPtr client) REQUEST(xXFixesInvertRegionReq); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); /* Compute bounds, limit to 16 bits */ bounds.x1 = stuff->x; @@ -477,7 +468,7 @@ ProcXFixesInvertRegion (ClientPtr client) else bounds.y2 = stuff->y + stuff->height; - if (!REGION_INVERSE(0, pDestination, pSource, &bounds)) + if (!RegionInverse(pDestination, pSource, &bounds)) ret = BadAlloc; if (ret == Success) @@ -488,17 +479,16 @@ ProcXFixesInvertRegion (ClientPtr client) int SProcXFixesInvertRegion (ClientPtr client) { - int n; REQUEST(xXFixesInvertRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); - swapl (&stuff->source, n); - swaps (&stuff->x, n); - swaps (&stuff->y, n); - swaps (&stuff->width, n); - swaps (&stuff->height, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swaps(&stuff->x); + swaps(&stuff->y); + swaps(&stuff->width); + swaps(&stuff->height); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -509,23 +499,22 @@ ProcXFixesTranslateRegion (ClientPtr client) REQUEST(xXFixesTranslateRegionReq); REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); - REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy); + RegionTranslate(pRegion, stuff->dx, stuff->dy); return (client->noClientException); } int SProcXFixesTranslateRegion (ClientPtr client) { - int n; REQUEST(xXFixesTranslateRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); - swapl (&stuff->region, n); - swaps (&stuff->dx, n); - swaps (&stuff->dy, n); + swapl(&stuff->region); + swaps(&stuff->dx); + swaps(&stuff->dy); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -536,10 +525,10 @@ ProcXFixesRegionExtents (ClientPtr client) REQUEST(xXFixesRegionExtentsReq); REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); - REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource)); + RegionReset(pDestination, RegionExtents(pSource)); return (client->noClientException); } @@ -547,13 +536,12 @@ ProcXFixesRegionExtents (ClientPtr client) int SProcXFixesRegionExtents (ClientPtr client) { - int n; REQUEST(xXFixesRegionExtentsReq); - - swaps (&stuff->length, n); + + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); + swapl(&stuff->source); + swapl(&stuff->destination); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -569,13 +557,13 @@ ProcXFixesFetchRegion (ClientPtr client) REQUEST(xXFixesFetchRegionReq); REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityReadAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess); - pExtent = REGION_EXTENTS (0, pRegion); - pBox = REGION_RECTS (pRegion); - nBox = REGION_NUM_RECTS (pRegion); + pExtent = RegionExtents(pRegion); + pBox = RegionRects (pRegion); + nBox = RegionNumRects (pRegion); - reply = xalloc (sizeof (xXFixesFetchRegionReply) + + reply = malloc (sizeof (xXFixesFetchRegionReply) + nBox * sizeof (xRectangle)); if (!reply) return BadAlloc; @@ -595,32 +583,29 @@ ProcXFixesFetchRegion (ClientPtr client) pRect[i].width = pBox[i].x2 - pBox[i].x1; pRect[i].height = pBox[i].y2 - pBox[i].y1; } - if (client->swapped) - { - int n; - swaps (&reply->sequenceNumber, n); - swapl (&reply->length, n); - swaps (&reply->x, n); - swaps (&reply->y, n); - swaps (&reply->width, n); - swaps (&reply->height, n); - SwapShorts ((INT16 *) pRect, nBox * 4); + if (client->swapped) { + swaps(&reply->sequenceNumber); + swapl(&reply->length); + swaps(&reply->x); + swaps(&reply->y); + swaps(&reply->width); + swaps(&reply->height); + SwapShorts((INT16 *) pRect, nBox * 4); } - (void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) + - nBox * sizeof (xRectangle), (char *) reply); - xfree (reply); + WriteToClient(client, sizeof (xXFixesFetchRegionReply) + + nBox * sizeof (xRectangle), reply); + free (reply); return (client->noClientException); } int SProcXFixesFetchRegion (ClientPtr client) { - int n; REQUEST(xXFixesFetchRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); - swapl (&stuff->region, n); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -633,8 +618,8 @@ ProcXFixesSetGCClipRegion (ClientPtr client) REQUEST(xXFixesSetGCClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); - VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, SecurityReadAccess); + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixWriteAccess); + VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, DixReadAccess); if (pRegion) { @@ -646,7 +631,7 @@ ProcXFixesSetGCClipRegion (ClientPtr client) vals[0] = stuff->xOrigin; vals[1] = stuff->yOrigin; DoChangeGC (pGC, GCClipXOrigin|GCClipYOrigin, vals, 0); - (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (pointer)pRegion, 0); + (*pGC->funcs->ChangeClip)(pGC, pRegion ? CT_REGION : CT_NONE, (void *)pRegion, 0); return (client->noClientException); } @@ -654,15 +639,14 @@ ProcXFixesSetGCClipRegion (ClientPtr client) int SProcXFixesSetGCClipRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetGCClipRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); - swapl (&stuff->gc, n); - swapl (&stuff->region, n); - swaps (&stuff->xOrigin, n); - swaps (&stuff->yOrigin, n); + swapl(&stuff->gc); + swapl(&stuff->region); + swaps(&stuff->xOrigin); + swaps(&stuff->yOrigin); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -685,7 +669,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) client->errorValue = stuff->dest; return BadWindow; } - VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess); pScreen = pWin->drawable.pScreen; switch (stuff->destKind) { case ShapeBounding: @@ -716,7 +700,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) break; } if (stuff->xOff || stuff->yOff) - REGION_TRANSLATE (0, pRegion, stuff->xOff, stuff->yOff); + RegionTranslate(pRegion, stuff->xOff, stuff->yOff); } else { @@ -739,7 +723,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) pDestRegion = &pRegion; /* a NULL region pointer */ } if (*pDestRegion) - REGION_DESTROY(pScreen, *pDestRegion); + RegionDestroy(*pDestRegion); *pDestRegion = pRegion; (*pScreen->SetShape) (pWin); SendShapeNotify (pWin, stuff->destKind); @@ -752,15 +736,14 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) int SProcXFixesSetWindowShapeRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetWindowShapeRegionReq); - swaps (&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq); - swapl (&stuff->dest, n); - swaps (&stuff->xOff, n); - swaps (&stuff->yOff, n); - swapl (&stuff->region, n); + swapl(&stuff->dest); + swaps(&stuff->xOff); + swaps(&stuff->yOff); + swapl(&stuff->region); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -770,16 +753,12 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) #ifdef RENDER PicturePtr pPicture; RegionPtr pRegion; - ScreenPtr pScreen; - PictureScreenPtr ps; REQUEST(xXFixesSetPictureClipRegionReq); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); - VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); - pScreen = pPicture->pDrawable->pScreen; - ps = GetPictureScreen (pScreen); - VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityReadAccess); + VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess); return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin, pRegion); @@ -791,15 +770,14 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) int SProcXFixesSetPictureClipRegion (ClientPtr client) { - int n; REQUEST(xXFixesSetPictureClipRegionReq); - - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); - swapl (&stuff->picture, n); - swapl (&stuff->region, n); - swaps (&stuff->xOrigin, n); - swaps (&stuff->yOrigin, n); + + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXFixesSetPictureClipRegionReq); + swapl(&stuff->picture); + swapl(&stuff->region); + swaps(&stuff->xOrigin); + swaps(&stuff->yOrigin); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } @@ -815,14 +793,14 @@ ProcXFixesExpandRegion (ClientPtr client) int i; REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); - nBoxes = REGION_NUM_RECTS(pSource); - pSrc = REGION_RECTS(pSource); + nBoxes = RegionNumRects(pSource); + pSrc = RegionRects(pSource); if (nBoxes) { - pTmp = xalloc (nBoxes * sizeof (BoxRec)); + pTmp = malloc (nBoxes * sizeof (BoxRec)); if (!pTmp) return BadAlloc; for (i = 0; i < nBoxes; i++) @@ -832,13 +810,14 @@ ProcXFixesExpandRegion (ClientPtr client) pTmp[i].y1 = pSrc[i].y1 - stuff->top; pTmp[i].y2 = pSrc[i].y2 + stuff->bottom; } - REGION_EMPTY (pScreen, pDestination); + RegionEmpty(pDestination); for (i = 0; i < nBoxes; i++) { RegionRec r; - REGION_INIT (pScreen, &r, &pTmp[i], 0); - REGION_UNION (pScreen, pDestination, pDestination, &r); + RegionInit(&r, &pTmp[i], 0); + RegionUnion(pDestination, pDestination, &r); } + free(pTmp); } if (ret == Success) ret = client->noClientException; @@ -848,17 +827,15 @@ ProcXFixesExpandRegion (ClientPtr client) int SProcXFixesExpandRegion (ClientPtr client) { - int n; - REQUEST (xXFixesExpandRegionReq); + REQUEST(xXFixesExpandRegionReq); - swaps (&stuff->length, n); - REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); - swapl (&stuff->source, n); - swapl (&stuff->destination, n); - swaps (&stuff->left, n); - swaps (&stuff->right, n); - swaps (&stuff->top, n); - swaps (&stuff->bottom, n); + swaps(&stuff->length); + REQUEST_SIZE_MATCH(xXFixesExpandRegionReq); + swapl(&stuff->source); + swapl(&stuff->destination); + swaps(&stuff->left); + swaps(&stuff->right); + swaps(&stuff->top); + swaps(&stuff->bottom); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } - |