diff options
author | Eric Anholt <anholt@freebsd.org> | 2004-07-31 07:26:50 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2004-07-31 07:26:50 +0000 |
commit | 8763cca7f9927bd6c9caf804bf09dcfea929eed0 (patch) | |
tree | 84330b1981992c44f2ec6851092418a10a2c1a1f /xfixes/region.c | |
parent | 25bd6ff4a622d09fb0c247b7c40281744c61431e (diff) |
Update xfixes server code to major version 3 from xserver CVS, and perform
minor diff-reduction versus xserver CVS.
Diffstat (limited to 'xfixes/region.c')
-rwxr-xr-x | xfixes/region.c | 66 |
1 files changed, 60 insertions, 6 deletions
diff --git a/xfixes/region.c b/xfixes/region.c index 6deef4b95..d80776d8c 100755 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -34,11 +34,6 @@ extern int RenderErrBase; #include <regionstr.h> #include <gcstruct.h> #include <window.h> -#ifdef SKK -#ifdef SHAPE -#include <shapeint.h> -#endif -#endif RESTYPE RegionResType; @@ -155,7 +150,6 @@ SProcXFixesCreateRegionFromBitmap (ClientPtr client) return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } - int ProcXFixesCreateRegionFromWindow (ClientPtr client) { @@ -794,3 +788,63 @@ SProcXFixesSetPictureClipRegion (ClientPtr client) swaps (&stuff->yOrigin, n); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); } + +int +ProcXFixesExpandRegion (ClientPtr client) +{ + RegionPtr pSource, pDestination; + int ret = Success; + REQUEST (xXFixesExpandRegionReq); + BoxPtr pTmp; + BoxPtr pSrc; + int nBoxes; + int i; + + REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); + VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + + nBoxes = REGION_NUM_RECTS(pSource); + pSrc = REGION_RECTS(pSource); + if (nBoxes) + { + pTmp = xalloc (nBoxes * sizeof (BoxRec)); + if (!pTmp) + return BadAlloc; + for (i = 0; i < nBoxes; i++) + { + pTmp[i].x1 = pSrc[i].x1 - stuff->left; + pTmp[i].x2 = pSrc[i].x2 + stuff->right; + pTmp[i].y1 = pSrc[i].y1 - stuff->top; + pTmp[i].y2 = pSrc[i].y2 + stuff->bottom; + } + REGION_EMPTY (pScreen, pDestination); + for (i = 0; i < nBoxes; i++) + { + RegionRec r; + REGION_INIT (pScreen, &r, &pTmp[i], 0); + REGION_UNION (pScreen, pDestination, pDestination, &r); + } + } + if (ret == Success) + ret = client->noClientException; + return ret; +} + +int +SProcXFixesExpandRegion (ClientPtr client) +{ + int n; + 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); + return (*ProcXFixesVector[stuff->xfixesReqType]) (client); +} + |