diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-16 11:11:43 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-05-02 14:53:06 +0200 |
commit | 63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4 (patch) | |
tree | 3d67994a85c5d8c3a929ab315fbcb617baa6423d /nx-X11/programs/Xserver/mi | |
parent | 28ba877803d8383eac282b873b8e0bb50c8db46b (diff) | |
download | nx-libs-63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4.tar.gz nx-libs-63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4.tar.bz2 nx-libs-63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4.zip |
Rename region macros to eliminate screen argument
This is a huge mechanical patch and a few small fixups required to finish
the job. They were reviewed separately, but because the server does not
build without both pieces, I've merged them together at this time.
The mechanical changes were performed by running the included
'fix-region' script over the whole nx-X11/programs/Xserver tree:
$ cd nx-X11/programs/Xserver && ( git ls-files | grep -v '^fix-' | xargs ./fix-region; )
And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.
$ sh ./fix-patch-whitespace
Thanks to Jamey Sharp for the mighty fine sed-generating sed script.
v1: Keith Packard <keithp@keithp.com> (X.Org xserver commit: 2dc138922b7588515d5f2447e4b9dcdc0bef15e0)
v2: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> (apply fix-region script to nx-libs)
Diffstat (limited to 'nx-X11/programs/Xserver/mi')
-rw-r--r-- | nx-X11/programs/Xserver/mi/mibank.c | 92 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mibitblt.c | 32 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mibstore.c | 288 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/miexpose.c | 112 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/migc.c | 44 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mioverlay.c | 424 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/miregion.c | 154 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/misprite.c | 6 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mivaltree.c | 140 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/miwindow.c | 154 |
10 files changed, 723 insertions, 723 deletions
diff --git a/nx-X11/programs/Xserver/mi/mibank.c b/nx-X11/programs/Xserver/mi/mibank.c index b5da2267f..24e202094 100644 --- a/nx-X11/programs/Xserver/mi/mibank.c +++ b/nx-X11/programs/Xserver/mi/mibank.c @@ -607,8 +607,8 @@ miBankCopy( if (!pScreenPriv->pBanks[ns]) continue; - nBox = REGION_NUM_RECTS(pScreenPriv->pBanks[ns]); - pBox = REGION_RECTS(pScreenPriv->pBanks[ns]); + nBox = RegionNumRects(pScreenPriv->pBanks[ns]); + pBox = RegionRects(pScreenPriv->pBanks[ns]); for (; nBox--; pBox++) { @@ -668,8 +668,8 @@ miBankCopy( * It's faster to let the lower-level CopyArea do the clipping * within each bank. */ - nBox = REGION_NUM_RECTS(pScreenPriv->pBanks[nd]); - pBox = REGION_RECTS(pScreenPriv->pBanks[nd]); + nBox = RegionNumRects(pScreenPriv->pBanks[nd]); + pBox = RegionRects(pScreenPriv->pBanks[nd]); for (; nBox--; pBox++) { @@ -775,10 +775,10 @@ miBankCopy( } else { - REGION_INIT(pScreen, &rgnDst, &fastBox, 1); - REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrcClip); - pBox = REGION_RECTS(&rgnDst); - nBox = REGION_NUM_RECTS(&rgnDst); + RegionInit(&rgnDst, &fastBox, 1); + RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip); + pBox = RegionRects(&rgnDst); + nBox = RegionNumRects(&rgnDst); } /* @@ -804,8 +804,8 @@ miBankCopy( if (!pScreenPriv->pBanks[ns]) continue; - nBoxClipSrc = REGION_NUM_RECTS(pScreenPriv->pBanks[ns]); - pBoxClipSrc = REGION_RECTS(pScreenPriv->pBanks[ns]); + nBoxClipSrc = RegionNumRects(pScreenPriv->pBanks[ns]); + pBoxClipSrc = RegionRects(pScreenPriv->pBanks[ns]); for (; nBoxClipSrc--; pBoxClipSrc++) { @@ -836,9 +836,9 @@ miBankCopy( * so use the bank clips here instead. */ nBoxClipDst = - REGION_NUM_RECTS(pScreenPriv->pBanks[nd]); + RegionNumRects(pScreenPriv->pBanks[nd]); pBoxClipDst = - REGION_RECTS(pScreenPriv->pBanks[nd]); + RegionRects(pScreenPriv->pBanks[nd]); for (; nBoxClipDst--; pBoxClipDst++) { @@ -878,7 +878,7 @@ miBankCopy( pScreenPriv->nPixelsPerScanlinePadUnit) || (ccBox.x2 % pScreenPriv->nPixelsPerScanlinePadUnit) || - (RECT_IN_REGION(pScreen, + (RegionContainsRect( pGCPriv->pBankedClips[nd], &ccBox) != rgnIN))) pQueue->fastBlit = FALSE; @@ -892,9 +892,9 @@ miBankCopy( if (!fastClip) { - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); if (freeSrcClip) - REGION_DESTROY(pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); } pQueueNew = pQueue; @@ -1405,16 +1405,16 @@ miBankValidateGC( continue; if (!(prgnClip = pGCPriv->pBankedClips[i])) - prgnClip = REGION_CREATE(pScreen, NULL, 1); + prgnClip = RegionCreate(NULL, 1); - REGION_INTERSECT(pScreen, prgnClip, + RegionIntersect(prgnClip, pScreenPriv->pBanks[i], pGC->pCompositeClip); - if ((REGION_NUM_RECTS(prgnClip) <= 1) && + if ((RegionNumRects(prgnClip) <= 1) && ((prgnClip->extents.x1 == prgnClip->extents.x2) || (prgnClip->extents.y1 == prgnClip->extents.y2))) { - REGION_DESTROY(pScreen, prgnClip); + RegionDestroy(prgnClip); pGCPriv->pBankedClips[i] = NULL; } else @@ -1469,7 +1469,7 @@ miBankValidateGC( if (!pGCPriv->pBankedClips[i]) continue; - REGION_DESTROY(pScreen, pGCPriv->pBankedClips[i]); + RegionDestroy(pGCPriv->pBankedClips[i]); pGCPriv->pBankedClips[i] = NULL; } } @@ -1528,7 +1528,7 @@ miBankDestroyGC( if (!pGCPriv->pBankedClips[i]) continue; - REGION_DESTROY(pScreen, pGCPriv->pBankedClips[i]); + RegionDestroy(pGCPriv->pBankedClips[i]); pGCPriv->pBankedClips[i] = NULL; } @@ -1707,7 +1707,7 @@ miBankCloseScreen( /* Delete bank clips */ for (i = 0; i < pScreenPriv->nBanks; i++) if (pScreenPriv->pBanks[i]) - REGION_DESTROY(pScreen, pScreenPriv->pBanks[i]); + RegionDestroy(pScreenPriv->pBanks[i]); Xfree(pScreenPriv->pBanks); @@ -1915,17 +1915,17 @@ miBankPaintWindow( } else { - REGION_NULL(pScreen, &tmpReg); + RegionNull(&tmpReg); for (i = 0; i < pScreenPriv->nBanks; i++) { if (!pScreenPriv->pBanks[i]) continue; - REGION_INTERSECT(pScreen, &tmpReg, pRegion, + RegionIntersect(&tmpReg, pRegion, pScreenPriv->pBanks[i]); - if (REGION_NIL(&tmpReg)) + if (RegionNil(&tmpReg)) continue; SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i); @@ -1933,7 +1933,7 @@ miBankPaintWindow( (*PaintWindow)(pWin, &tmpReg, what); } - REGION_UNINIT(pScreen, &tmpReg); + RegionUninit(&tmpReg); } if (what == PW_BORDER) @@ -1968,15 +1968,15 @@ miBankCopyWindow( ChangeGC(pGC, GCSubwindowMode, &subWindowMode); ValidateGC(pDrawable, pGC); - pRgnDst = REGION_CREATE(pScreen, NULL, 1); + pRgnDst = RegionCreate(NULL, 1); dx = ptOldOrg.x - pWindow->drawable.x; dy = ptOldOrg.y - pWindow->drawable.y; - REGION_TRANSLATE(pScreen, pRgnSrc, -dx, -dy); - REGION_INTERSECT(pScreen, pRgnDst, &pWindow->borderClip, pRgnSrc); + RegionTranslate(pRgnSrc, -dx, -dy); + RegionIntersect(pRgnDst, &pWindow->borderClip, pRgnSrc); - pBox = REGION_RECTS(pRgnDst); - nBox = REGION_NUM_RECTS(pRgnDst); + pBox = RegionRects(pRgnDst); + nBox = RegionNumRects(pRgnDst); pBoxNew1 = NULL; pBoxNew2 = NULL; @@ -2052,7 +2052,7 @@ miBankCopyWindow( FreeScratchGC(pGC); - REGION_DESTROY(pScreen, pRgnDst); + RegionDestroy(pRgnDst); DEALLOCATE_LOCAL(pBoxNew2); DEALLOCATE_LOCAL(pBoxNew1); @@ -2086,30 +2086,30 @@ miBankSaveAreas( } else { - REGION_NULL(pScreen, &rgnClipped); - REGION_TRANSLATE(pScreen, prgnSave, xorg, yorg); + RegionNull(&rgnClipped); + RegionTranslate(prgnSave, xorg, yorg); for (i = 0; i < pScreenPriv->nBanks; i++) { if (!pScreenPriv->pBanks[i]) continue; - REGION_INTERSECT(pScreen, &rgnClipped, + RegionIntersect(&rgnClipped, prgnSave, pScreenPriv->pBanks[i]); - if (REGION_NIL(&rgnClipped)) + if (RegionNil(&rgnClipped)) continue; SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i); - REGION_TRANSLATE(pScreen, &rgnClipped, -xorg, -yorg); + RegionTranslate(&rgnClipped, -xorg, -yorg); (*pScreen->BackingStoreFuncs.SaveAreas)(pPixmap, &rgnClipped, xorg, yorg, pWin); } - REGION_TRANSLATE(pScreen, prgnSave, -xorg, -yorg); - REGION_UNINIT(pScreen, &rgnClipped); + RegionTranslate(prgnSave, -xorg, -yorg); + RegionUninit(&rgnClipped); } SCREEN_WRAP(BackingStoreFuncs.SaveAreas, miBankSaveAreas); @@ -2140,17 +2140,17 @@ miBankRestoreAreas( } else { - REGION_NULL(pScreen, &rgnClipped); + RegionNull(&rgnClipped); for (i = 0; i < pScreenPriv->nBanks; i++) { if (!pScreenPriv->pBanks[i]) continue; - REGION_INTERSECT(pScreen, &rgnClipped, + RegionIntersect(&rgnClipped, prgnRestore, pScreenPriv->pBanks[i]); - if (REGION_NIL(&rgnClipped)) + if (RegionNil(&rgnClipped)) continue; SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i); @@ -2159,7 +2159,7 @@ miBankRestoreAreas( xorg, yorg, pWin); } - REGION_UNINIT(pScreen, &rgnClipped); + RegionUninit(&rgnClipped); } SCREEN_WRAP(BackingStoreFuncs.RestoreAreas, miBankRestoreAreas); @@ -2345,9 +2345,9 @@ miInitializeBanking( } pScreenPriv->pBanks[iBank] = - RECTS_TO_REGION(pScreen, pRect - pRects, pRects, 0); + RegionFromRects(pRect - pRects, pRects, 0); if (!pScreenPriv->pBanks[iBank] || - REGION_NAR(pScreenPriv->pBanks[iBank])) + RegionNar(pScreenPriv->pBanks[iBank])) { we = 1; break; @@ -2358,7 +2358,7 @@ miInitializeBanking( { for (i = iBank; i >= 0; i--) if (pScreenPriv->pBanks[i]) - REGION_DESTROY(pScreen, pScreenPriv->pBanks[i]); + RegionDestroy(pScreenPriv->pBanks[i]); Xfree(pScreenPriv->pBanks); Xfree(pScreenPriv); diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c index 60318a046..b19a15900 100644 --- a/nx-X11/programs/Xserver/mi/mibitblt.c +++ b/nx-X11/programs/Xserver/mi/mibitblt.c @@ -117,7 +117,7 @@ miCopyArea(pSrcDrawable, pDstDrawable, box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; - prgnSrcClip = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrcClip = RegionCreate(&box, 1); realSrcClip = 1; } else @@ -148,8 +148,8 @@ miCopyArea(pSrcDrawable, pDstDrawable, ALLOCATE_LOCAL(heightSrc * sizeof(DDXPointRec)); pwidthFirst = pwidth = (unsigned int *) ALLOCATE_LOCAL(heightSrc * sizeof(unsigned int)); - numRects = REGION_NUM_RECTS(prgnSrcClip); - boxes = REGION_RECTS(prgnSrcClip); + numRects = RegionNumRects(prgnSrcClip); + boxes = RegionRects(prgnSrcClip); ordering = (unsigned int *) ALLOCATE_LOCAL(numRects * sizeof(unsigned int)); if(!pptFirst || !pwidthFirst || !ordering) @@ -264,7 +264,7 @@ miCopyArea(pSrcDrawable, pDstDrawable, prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, (unsigned long)0); if(realSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); DEALLOCATE_LOCAL(ordering); DEALLOCATE_LOCAL(pwidthFirst); @@ -452,9 +452,9 @@ miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty) to destroy what it's sent. note that this means we don't have to free prgnSrcClip ourselves. */ - prgnSrcClip = REGION_CREATE(pGCT->pScreen, NULL, 0); - REGION_COPY(pGCT->pScreen, prgnSrcClip, prgnSrc); - REGION_TRANSLATE(pGCT->pScreen, prgnSrcClip, srcx, 0); + prgnSrcClip = RegionCreate(NULL, 0); + RegionCopy(prgnSrcClip, prgnSrc); + RegionTranslate(prgnSrcClip, srcx, 0); (*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0); ValidateGC((DrawablePtr)pPixmap, pGCT); @@ -587,7 +587,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable, box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrc = RegionCreate(&box, 1); if (pSrcDrawable->type != DRAWABLE_PIXMAP) { /* clip to visible drawable */ @@ -595,15 +595,15 @@ miCopyPlane(pSrcDrawable, pDstDrawable, if (pGC->subWindowMode == IncludeInferiors) { RegionPtr clipList = NotClippedByChildren ((WindowPtr) pSrcDrawable); - REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc, clipList); - REGION_DESTROY(pGC->pScreen, clipList); + RegionIntersect(prgnSrc, prgnSrc, clipList); + RegionDestroy(clipList); } else - REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc, + RegionIntersect(prgnSrc, prgnSrc, &((WindowPtr)pSrcDrawable)->clipList); } - box = *REGION_EXTENTS(pGC->pScreen, prgnSrc); - REGION_TRANSLATE(pGC->pScreen, prgnSrc, -box.x1, -box.y1); + box = *RegionExtents(prgnSrc); + RegionTranslate(prgnSrc, -box.x1, -box.y1); if ((box.x2 > box.x1) && (box.y2 > box.y1)) { @@ -627,7 +627,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable, } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - REGION_DESTROY(pGC->pScreen, prgnSrc); + RegionDestroy(prgnSrc); return prgnExposed; } @@ -776,11 +776,11 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) box.y1 = 0; box.x2 = w; box.y2 = h; - prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrc = RegionCreate(&box, 1); miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage, leftPad, w, h, x, y); - REGION_DESTROY(pGC->pScreen, prgnSrc); + RegionDestroy(prgnSrc); break; case XYPixmap: diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index 875ec87f3..a24e2cbcd 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -477,7 +477,7 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) bounds.y1 = sy + pDrawable->y; bounds.x2 = bounds.x1 + w; bounds.y2 = bounds.y1 + h; - REGION_INIT(pScreen, &Remaining, &bounds, 0); + RegionInit(&Remaining, &bounds, 0); for (;;) { bounds.x1 = sx + pDrawable->x - pWin->drawable.x; @@ -486,11 +486,11 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) bounds.y2 = bounds.y1 + h; if (pWin->viewable && pWin->backStorage && pWin->drawable.depth == depth && - (RECT_IN_REGION(pScreen, &(pWindowPriv = + (RegionContainsRect(&(pWindowPriv = (miBSWindowPtr) pWin->backStorage)->SavedRegion, &bounds) != rgnOUT || - RECT_IN_REGION(pScreen, &Remaining, - REGION_EXTENTS(pScreen, &pWin->borderSize)) != rgnOUT)) + RegionContainsRect(&Remaining, + RegionExtents(&pWin->borderSize)) != rgnOUT)) { if (!pPixmap) { @@ -508,8 +508,8 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) } ChangeGC (pGC, GCSubwindowMode, &subWindowMode); ValidateGC ((DrawablePtr)pPixmap, pGC); - REGION_NULL(pScreen, &Border); - REGION_NULL(pScreen, &Inside); + RegionNull(&Border); + RegionNull(&Inside); pSrcWin = (WindowPtr) pDrawable; x = sx; y = sy; @@ -523,28 +523,28 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) (DrawablePtr)pPixmap, pGC, x, y, w, h, 0, 0); - REGION_SUBTRACT(pScreen, &Remaining, &Remaining, + RegionSubtract(&Remaining, &Remaining, &((WindowPtr) pDrawable)->borderClip); } - REGION_INTERSECT(pScreen, &Inside, &Remaining, &pWin->winSize); - REGION_TRANSLATE(pScreen, &Inside, + RegionIntersect(&Inside, &Remaining, &pWin->winSize); + RegionTranslate(&Inside, -pWin->drawable.x, -pWin->drawable.y); - REGION_INTERSECT(pScreen, &Inside, &Inside, + RegionIntersect(&Inside, &Inside, &pWindowPriv->SavedRegion); /* offset of sub-window in GetImage pixmap */ xoff = pWin->drawable.x - pDrawable->x - sx; yoff = pWin->drawable.y - pDrawable->y - sy; - if (REGION_NUM_RECTS(&Inside) > 0) + if (RegionNumRects(&Inside) > 0) { switch (pWindowPriv->status) { case StatusContents: - pBox = REGION_RECTS(&Inside); - for (n = REGION_NUM_RECTS(&Inside); --n >= 0;) + pBox = RegionRects(&Inside); + for (n = RegionNumRects(&Inside); --n >= 0;) { (*pGC->ops->CopyArea) ( (DrawablePtr)pWindowPriv->pBackingPixmap, @@ -569,12 +569,12 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) break; } } - REGION_SUBTRACT(pScreen, &Border, &pWin->borderSize, + RegionSubtract(&Border, &pWin->borderSize, &pWin->winSize); - REGION_INTERSECT(pScreen, &Border, &Border, &Remaining); - if (REGION_NUM_RECTS(&Border) > 0) + RegionIntersect(&Border, &Border, &Remaining); + if (RegionNumRects(&Border) > 0) { - REGION_TRANSLATE(pScreen, &Border, -pWin->drawable.x, + RegionTranslate(&Border, -pWin->drawable.x, -pWin->drawable.y); miBSFillVirtualBits ((DrawablePtr) pPixmap, pGC, &Border, xoff, yoff, @@ -595,12 +595,12 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) } } - REGION_UNINIT(pScreen, &Remaining); + RegionUninit(&Remaining); if (pPixmap) { - REGION_UNINIT(pScreen, &Border); - REGION_UNINIT(pScreen, &Inside); + RegionUninit(&Border); + RegionUninit(&Inside); (*pScreen->GetImage) ((DrawablePtr) pPixmap, 0, 0, w, h, format, planemask, pdstLine); (*pScreen->DestroyPixmap) (pPixmap); @@ -664,7 +664,7 @@ miBSGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart) bounds.y2 = ppt[i].y; } - switch (RECT_IN_REGION(pScreen, &pWindowPriv->SavedRegion, &bounds)) + switch (RegionContainsRect(&pWindowPriv->SavedRegion, &bounds)) { case rgnPART: if (!pPixmap) @@ -1177,39 +1177,39 @@ miBSDoCopy( box.y1 = srcy + pWin->drawable.y; box.y2 = box.y1 + h; - pRgnExp = REGION_CREATE(pGC->pScreen, &box, 1); - REGION_INTERSECT(pGC->pScreen, pRgnExp, pRgnExp, &pWin->clipList); - pRgnObs = REGION_CREATE(pGC->pScreen, NULL, 1); - REGION_INVERSE( pGC->pScreen, pRgnObs, pRgnExp, &box); + pRgnExp = RegionCreate(&box, 1); + RegionIntersect(pRgnExp, pRgnExp, &pWin->clipList); + pRgnObs = RegionCreate(NULL, 1); + RegionInverse(pRgnObs, pRgnExp, &box); /* * Translate regions into window coordinates for proper calls * to the copyProc, then make sure none of the obscured region sticks * into invalid areas of the backing pixmap. */ - REGION_TRANSLATE(pGC->pScreen, pRgnExp, + RegionTranslate(pRgnExp, -pWin->drawable.x, -pWin->drawable.y); - REGION_TRANSLATE(pGC->pScreen, pRgnObs, + RegionTranslate(pRgnObs, -pWin->drawable.x, -pWin->drawable.y); - REGION_INTERSECT(pGC->pScreen, pRgnObs, pRgnObs, &pBackingStore->SavedRegion); + RegionIntersect(pRgnObs, pRgnObs, &pBackingStore->SavedRegion); /* * If the obscured region is empty, there's no point being fancy. */ - if (!REGION_NOTEMPTY(pGC->pScreen, pRgnObs)) + if (!RegionNotEmpty(pRgnObs)) { - REGION_DESTROY(pGC->pScreen, pRgnExp); - REGION_DESTROY(pGC->pScreen, pRgnObs); + RegionDestroy(pRgnExp); + RegionDestroy(pRgnObs); return (FALSE); } - numRectsExp = REGION_NUM_RECTS(pRgnExp); - pBoxExp = REGION_RECTS(pRgnExp); - pBoxObs = REGION_RECTS(pRgnObs); - numRectsObs = REGION_NUM_RECTS(pRgnObs); + numRectsExp = RegionNumRects(pRgnExp); + pBoxExp = RegionRects(pRgnExp); + pBoxObs = RegionRects(pRgnObs); + numRectsObs = RegionNumRects(pRgnObs); nrects = numRectsExp + numRectsObs; boxes = (struct BoxDraw *)ALLOCATE_LOCAL(nrects * sizeof(struct BoxDraw)); @@ -1220,8 +1220,8 @@ miBSDoCopy( { if (sequence) DEALLOCATE_LOCAL(sequence); if (boxes) DEALLOCATE_LOCAL(boxes); - REGION_DESTROY(pGC->pScreen, pRgnExp); - REGION_DESTROY(pGC->pScreen, pRgnObs); + RegionDestroy(pRgnExp); + RegionDestroy(pRgnObs); return(TRUE); } @@ -1437,25 +1437,25 @@ miBSDoCopy( * to return to dispatch which will send the appropriate expose * events. */ - REGION_UNION(pGC->pScreen, pRgnExp, pRgnExp, pRgnObs); + RegionUnion(pRgnExp, pRgnExp, pRgnObs); box.x1 = srcx; box.x2 = srcx + w; box.y1 = srcy; box.y2 = srcy + h; - if (RECT_IN_REGION(pGC->pScreen, pRgnExp, &box) == rgnIN) + if (RegionContainsRect(pRgnExp, &box) == rgnIN) { - REGION_EMPTY(pGC->pScreen, pRgnExp); + RegionEmpty(pRgnExp); } else { - REGION_INVERSE( pGC->pScreen, pRgnExp, pRgnExp, &box); - REGION_TRANSLATE( pGC->pScreen, pRgnExp, + RegionInverse(pRgnExp, pRgnExp, &box); + RegionTranslate(pRgnExp, dx + pWin->drawable.x, dy + pWin->drawable.y); - REGION_INTERSECT( pGC->pScreen, pRgnObs, pRgnExp, &pWin->clipList); + RegionIntersect(pRgnObs, pRgnExp, &pWin->clipList); (*pWin->drawable.pScreen->PaintWindowBackground) (pWin, pRgnObs, PW_BACKGROUND); - REGION_TRANSLATE( pGC->pScreen, pRgnExp, + RegionTranslate(pRgnExp, -pWin->drawable.x, -pWin->drawable.y); miBSClearBackingRegion (pWin, pRgnExp); @@ -1463,8 +1463,8 @@ miBSDoCopy( if (graphicsExposures) *ppRgn = pRgnExp; else - REGION_DESTROY(pGC->pScreen, pRgnExp); - REGION_DESTROY(pGC->pScreen, pRgnObs); + RegionDestroy(pRgnExp); + RegionDestroy(pRgnObs); return (TRUE); } @@ -1524,7 +1524,7 @@ miBSCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty) * the backing store. An unnecessary optimisation, * but a useful one when GetSpans is slow. */ - pExtents = REGION_EXTENTS(pDst->pScreen, + pExtents = RegionExtents( (RegionPtr)pBackingGC->clientClip); bsrcx = srcx; bsrcy = srcy; @@ -1573,8 +1573,8 @@ miBSCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty) if (winExposed) { if (pixExposed){ - REGION_UNION(pDst->pScreen, winExposed, winExposed, pixExposed); - REGION_DESTROY(pDst->pScreen, pixExposed); + RegionUnion(winExposed, winExposed, pixExposed); + RegionDestroy(pixExposed); } } else winExposed = pixExposed; @@ -1633,7 +1633,7 @@ miBSCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane) * the backing store. An unnecessary optimisation, * but a useful one when GetSpans is slow. */ - pExtents = REGION_EXTENTS(pDst->pScreen, + pExtents = RegionExtents( (RegionPtr)pBackingGC->clientClip); bsrcx = srcx; bsrcy = srcy; @@ -1687,8 +1687,8 @@ miBSCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane) { if (pixExposed) { - REGION_UNION(pDst->pScreen, winExposed, winExposed, pixExposed); - REGION_DESTROY(pDst->pScreen, pixExposed); + RegionUnion(winExposed, winExposed, pixExposed); + RegionDestroy(pixExposed); } } else winExposed = pixExposed; @@ -2312,12 +2312,12 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) box.y1 = y; box.x2 = x + w; box.y2 = y + h; - pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); + pRgn = RegionCreate(&box, 1); if (!pRgn) return NullRegion; - REGION_INTERSECT( pScreen, pRgn, pRgn, &pBackingStore->SavedRegion); + RegionIntersect(pRgn, pRgn, &pBackingStore->SavedRegion); - if (REGION_NOTEMPTY( pScreen, pRgn)) + if (RegionNotEmpty(pRgn)) { /* * if clearing entire window, simply make new virtual @@ -2393,12 +2393,12 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) * Figure out the array of rectangles to fill and fill them with * PolyFillRect in the proper mode, as set in the GC above. */ - numRects = REGION_NUM_RECTS(pRgn); + numRects = RegionNumRects(pRgn); rects = (xRectangle *)ALLOCATE_LOCAL(numRects*sizeof(xRectangle)); if (rects) { - for (i = 0, pBox = REGION_RECTS(pRgn); + for (i = 0, pBox = RegionRects(pRgn); i < numRects; i++, pBox++) { @@ -2418,7 +2418,7 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) if (!generateExposures) { - REGION_DESTROY(pScreen, pRgn); + RegionDestroy(pRgn); pRgn = NULL; } else @@ -2427,13 +2427,13 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) * result must be screen relative, but is currently * drawable relative. */ - REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, + RegionTranslate(pRgn, pWin->drawable.x, pWin->drawable.y); } } else { - REGION_DESTROY( pScreen, pRgn); + RegionDestroy(pRgn); pRgn = NULL; } return pRgn; @@ -2447,8 +2447,8 @@ miBSClearBackingRegion (pWin, pRgn) BoxPtr pBox; int i; - i = REGION_NUM_RECTS(pRgn); - pBox = REGION_RECTS(pRgn); + i = RegionNumRects(pRgn); + pBox = RegionRects(pRgn); while (i--) { (void) miBSClearBackingStore(pWin, pBox->x1, pBox->y1, @@ -2485,7 +2485,7 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) if (state == None) return; - numRects = REGION_NUM_RECTS(pRgn); + numRects = RegionNumRects(pRgn); pRect = (xRectangle *)ALLOCATE_LOCAL(numRects * sizeof(xRectangle)); if (!pRect) return; @@ -2545,7 +2545,7 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) if (pDrawable->serialNumber != pGC->serialNumber) ValidateGC (pDrawable, pGC); - pBox = REGION_RECTS(pRgn); + pBox = RegionRects(pRgn); for (i = numRects; --i >= 0; pBox++, pRect++) { pRect->x = pBox->x1 + x; @@ -2588,7 +2588,7 @@ miBSAllocate(pWin) pBackingStore->pBackingPixmap = NullPixmap; pBackingStore->x = 0; pBackingStore->y = 0; - REGION_NULL( pScreen, &pBackingStore->SavedRegion); + RegionNull(&pBackingStore->SavedRegion); pBackingStore->viewable = (char)pWin->viewable; pBackingStore->status = StatusNoPixmap; pBackingStore->backgroundState = None; @@ -2617,16 +2617,16 @@ miBSAllocate(pWin) box.y1 = pWin->drawable.y; box.y2 = pWin->drawable.y + (int) pWin->drawable.height; - REGION_INVERSE( pScreen, pSavedRegion, &pWin->clipList, &box); - REGION_TRANSLATE( pScreen, pSavedRegion, + RegionInverse(pSavedRegion, &pWin->clipList, &box); + RegionTranslate(pSavedRegion, -pWin->drawable.x, -pWin->drawable.y); #ifdef SHAPE if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, pSavedRegion, pSavedRegion, + RegionIntersect(pSavedRegion, pSavedRegion, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, pSavedRegion, pSavedRegion, + RegionIntersect(pSavedRegion, pSavedRegion, wClipShape (pWin)); #endif /* if window is already on-screen, assume it has been drawn to */ @@ -2649,7 +2649,7 @@ miBSAllocate(pWin) */ if (pBackingStore->status != StatusNoPixmap) { - REGION_EMPTY( pScreen, &pBackingStore->SavedRegion); + RegionEmpty(&pBackingStore->SavedRegion); miDestroyBSPixmap (pWin); } } @@ -2683,7 +2683,7 @@ miBSFree(pWin) { miDestroyBSPixmap (pWin); - REGION_UNINIT( pScreen, &pBackingStore->SavedRegion); + RegionUninit(&pBackingStore->SavedRegion); xfree(pBackingStore); pWin->backStorage = NULL; @@ -2726,7 +2726,7 @@ miResizeBackingStore( if (!pBackingPixmap) return; pScreen = pWin->drawable.pScreen; - extents = REGION_EXTENTS(pScreen, &pBackingStore->SavedRegion); + extents = RegionExtents(&pBackingStore->SavedRegion); pNewPixmap = pBackingPixmap; nw = extents->x2 - extents->x1; @@ -2838,7 +2838,7 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) pBackingStore->viewable = (char)pWin->viewable; if (pWin->backingStore != Always) { - REGION_EMPTY( pScreen, &pBackingStore->SavedRegion); + RegionEmpty(&pBackingStore->SavedRegion); miDestroyBSPixmap (pWin); return; } @@ -2851,14 +2851,14 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) (pBackingStore->backgroundState == None)) return; - if (REGION_NOTEMPTY(pScreen, pObscured)) + if (RegionNotEmpty(pObscured)) { BoxRec oldExtents; x = pWin->drawable.x; y = pWin->drawable.y; - REGION_TRANSLATE(pScreen, pObscured, -x, -y); - oldExtents = *REGION_EXTENTS(pScreen, &pBackingStore->SavedRegion); - REGION_UNION( pScreen, &pBackingStore->SavedRegion, + RegionTranslate(pObscured, -x, -y); + oldExtents = *RegionExtents(&pBackingStore->SavedRegion); + RegionUnion(&pBackingStore->SavedRegion, &pBackingStore->SavedRegion, pObscured); /* @@ -2875,7 +2875,7 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) if (pBackingStore->pBackingPixmap) { if (pBackingStore->x | pBackingStore->y) { - REGION_TRANSLATE( pScreen, pObscured, + RegionTranslate(pObscured, -pBackingStore->x, -pBackingStore->y); x += pBackingStore->x; @@ -2886,13 +2886,13 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) x - dx, y - dy, pWin); } } - REGION_TRANSLATE(pScreen, pObscured, x, y); + RegionTranslate(pObscured, x, y); } else { - if (REGION_BROKEN (pScreen, pObscured)) + if (RegionBroken(pObscured)) { - REGION_EMPTY( pScreen, &pBackingStore->SavedRegion); + RegionEmpty(&pBackingStore->SavedRegion); miDestroyBSPixmap (pWin); return; } @@ -2943,11 +2943,11 @@ miBSRestoreAreas(pWin, prgnExposed) if (pBackingStore->status == StatusContents) { - REGION_TRANSLATE(pScreen, prgnSaved, pWin->drawable.x, + RegionTranslate(prgnSaved, pWin->drawable.x, pWin->drawable.y); - prgnRestored = REGION_CREATE( pScreen, (BoxPtr)NULL, 1); - REGION_INTERSECT( pScreen, prgnRestored, prgnExposed, prgnSaved); + prgnRestored = RegionCreate((BoxPtr)NULL, 1); + RegionIntersect(prgnRestored, prgnExposed, prgnSaved); /* * Since prgnExposed is no longer obscured, we no longer @@ -2956,10 +2956,10 @@ miBSRestoreAreas(pWin, prgnExposed) * from the area to be exposed. */ - if (REGION_NOTEMPTY( pScreen, prgnRestored)) + if (RegionNotEmpty(prgnRestored)) { - REGION_SUBTRACT( pScreen, prgnSaved, prgnSaved, prgnExposed); - REGION_SUBTRACT( pScreen, prgnExposed, prgnExposed, prgnRestored); + RegionSubtract(prgnSaved, prgnSaved, prgnExposed); + RegionSubtract(prgnExposed, prgnExposed, prgnRestored); /* * Do the actual restoration @@ -2975,9 +2975,9 @@ miBSRestoreAreas(pWin, prgnExposed) * region to window relative */ - if (REGION_NOTEMPTY(pScreen, prgnSaved)) + if (RegionNotEmpty(prgnSaved)) { - REGION_TRANSLATE(pScreen, prgnSaved, + RegionTranslate(prgnSaved, -pWin->drawable.x, -pWin->drawable.y); miResizeBackingStore(pWin, 0, 0, TRUE); @@ -2986,33 +2986,33 @@ miBSRestoreAreas(pWin, prgnExposed) miDestroyBSPixmap (pWin); } else - REGION_TRANSLATE(pScreen, prgnSaved, + RegionTranslate(prgnSaved, -pWin->drawable.x, -pWin->drawable.y); - REGION_DESTROY( pScreen, prgnRestored); + RegionDestroy(prgnRestored); } else if ((pBackingStore->status == StatusVirtual) || (pBackingStore->status == StatusVDirty)) { - REGION_TRANSLATE(pScreen, prgnSaved, + RegionTranslate(prgnSaved, pWin->drawable.x, pWin->drawable.y); - exposures = REGION_CREATE( pScreen, NullBox, 1); + exposures = RegionCreate(NullBox, 1); if (SameBackground (pBackingStore->backgroundState, pBackingStore->background, pWin->backgroundState, pWin->background)) { - REGION_SUBTRACT( pScreen, exposures, prgnExposed, prgnSaved); + RegionSubtract(exposures, prgnExposed, prgnSaved); } else { miTileVirtualBS(pWin); /* we need to expose all we have (virtually) retiled */ - REGION_UNION( pScreen, exposures, prgnExposed, prgnSaved); + RegionUnion(exposures, prgnExposed, prgnSaved); } - REGION_SUBTRACT( pScreen, prgnSaved, prgnSaved, prgnExposed); - REGION_TRANSLATE(pScreen, prgnSaved, + RegionSubtract(prgnSaved, prgnSaved, prgnExposed); + RegionTranslate(prgnSaved, -pWin->drawable.x, -pWin->drawable.y); } else if (pWin->viewable && !pBackingStore->viewable && @@ -3034,21 +3034,21 @@ miBSRestoreAreas(pWin, prgnExposed) box.y1 = pWin->drawable.y; box.y2 = box.y1 + (int) pWin->drawable.height; - REGION_INVERSE( pScreen, prgnSaved, &pWin->clipList, &box); - REGION_TRANSLATE( pScreen, prgnSaved, + RegionInverse(prgnSaved, &pWin->clipList, &box); + RegionTranslate(prgnSaved, -pWin->drawable.x, -pWin->drawable.y); #ifdef SHAPE if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, prgnSaved, prgnSaved, + RegionIntersect(prgnSaved, prgnSaved, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, prgnSaved, prgnSaved, + RegionIntersect(prgnSaved, prgnSaved, wClipShape (pWin)); #endif miTileVirtualBS(pWin); - exposures = REGION_CREATE( pScreen, &box, 1); + exposures = RegionCreate(&box, 1); } pBackingStore->viewable = (char)pWin->viewable; return exposures; @@ -3143,22 +3143,22 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) * Compute the new saved region */ - newSaved = REGION_CREATE( pScreen, NullBox, 1); + newSaved = RegionCreate(NullBox, 1); extents.x1 = pWin->drawable.x; extents.x2 = pWin->drawable.x + (int) pWin->drawable.width; extents.y1 = pWin->drawable.y; extents.y2 = pWin->drawable.y + (int) pWin->drawable.height; - REGION_INVERSE( pScreen, newSaved, &pWin->clipList, &extents); + RegionInverse(newSaved, &pWin->clipList, &extents); - REGION_TRANSLATE( pScreen, newSaved, + RegionTranslate(newSaved, -pWin->drawable.x, -pWin->drawable.y); #ifdef SHAPE if (wBoundingShape (pWin) || wClipShape (pWin)) { if (wBoundingShape (pWin)) - REGION_INTERSECT( pScreen, newSaved, newSaved, + RegionIntersect(newSaved, newSaved, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT( pScreen, newSaved, newSaved, wClipShape (pWin)); + RegionIntersect(newSaved, newSaved, wClipShape (pWin)); } #endif @@ -3191,23 +3191,23 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) * bits on the screen which can be put into the * new backing store */ - REGION_TRANSLATE( pScreen, oldClip, windx - oldx, windy - oldy); - doomed = REGION_CREATE( pScreen, NullBox, 1); - REGION_INTERSECT( pScreen, doomed, oldClip, newSaved); - REGION_TRANSLATE( pScreen, oldClip, oldx - windx, oldy - windy); + RegionTranslate(oldClip, windx - oldx, windy - oldy); + doomed = RegionCreate(NullBox, 1); + RegionIntersect(doomed, oldClip, newSaved); + RegionTranslate(oldClip, oldx - windx, oldy - windy); /* * Translate the old saved region to the position in the * window where it will appear to be */ - REGION_TRANSLATE( pScreen, pSavedRegion, windx, windy); + RegionTranslate(pSavedRegion, windx, windy); /* * Add the old saved region to the new saved region, so * that calls to RestoreAreas will be able to fetch those * bits back */ - REGION_UNION( pScreen, newSaved, newSaved, pSavedRegion); + RegionUnion(newSaved, newSaved, pSavedRegion); /* * Swap the new saved region into the window @@ -3227,47 +3227,47 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) * set to background in the backing pixmap and * sent as exposure events to the client. */ - REGION_SUBTRACT( pScreen, newSaved, pSavedRegion, newSaved); + RegionSubtract(newSaved, pSavedRegion, newSaved); /* * Fetch bits which will be obscured from * the screen */ - if (REGION_NOTEMPTY( pScreen, doomed)) + if (RegionNotEmpty(doomed)) { /* * Don't clear regions which have bits on the * screen */ - REGION_SUBTRACT( pScreen, newSaved, newSaved, doomed); + RegionSubtract(newSaved, newSaved, doomed); /* * Make the region to SaveDoomedAreas absolute, instead * of window relative. */ - REGION_TRANSLATE( pScreen, doomed, + RegionTranslate(doomed, pWin->drawable.x, pWin->drawable.y); (* pScreen->SaveDoomedAreas) (pWin, doomed, scrdx, scrdy); } - REGION_DESTROY(pScreen, doomed); + RegionDestroy(doomed); /* * and clear whatever there is that's new */ - if (REGION_NOTEMPTY( pScreen, newSaved)) + if (RegionNotEmpty(newSaved)) { miBSClearBackingRegion (pWin, newSaved); /* * Make the exposed region absolute */ - REGION_TRANSLATE(pScreen, newSaved, + RegionTranslate(newSaved, pWin->drawable.x, pWin->drawable.y); } else { - REGION_DESTROY(pScreen, newSaved); + RegionDestroy(newSaved); newSaved = NullRegion; } } @@ -3277,8 +3277,8 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) * ForgetGravity: just reset backing store and * expose the whole mess */ - REGION_COPY( pScreen, pSavedRegion, newSaved); - REGION_TRANSLATE( pScreen, newSaved, + RegionCopy(pSavedRegion, newSaved); + RegionTranslate(newSaved, pWin->drawable.x, pWin->drawable.y); miResizeBackingStore (pWin, 0, 0, FALSE); @@ -3409,13 +3409,13 @@ miBSValidateGC (pGC, stateChanges, pDrawable) ((pDrawable->serialNumber != pPriv->serialNumber) || (stateChanges&(GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)))) { - if (REGION_NOTEMPTY(pGC->pScreen, &pWindowPriv->SavedRegion)) + if (RegionNotEmpty(&pWindowPriv->SavedRegion)) { - backingCompositeClip = REGION_CREATE(pGC->pScreen, NULL, 1); + backingCompositeClip = RegionCreate(NULL, 1); if ((pGC->clientClipType == CT_NONE) || (pGC->clientClipType == CT_PIXMAP)) { - REGION_COPY(pGC->pScreen, backingCompositeClip, + RegionCopy(backingCompositeClip, &pWindowPriv->SavedRegion); } else @@ -3425,12 +3425,12 @@ miBSValidateGC (pGC, stateChanges, pDrawable) * its proper origin. */ - REGION_COPY(pGC->pScreen, backingCompositeClip, + RegionCopy(backingCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pGC->pScreen, backingCompositeClip, + RegionTranslate(backingCompositeClip, pGC->clipOrg.x, pGC->clipOrg.y); - REGION_INTERSECT(pGC->pScreen, backingCompositeClip, + RegionIntersect(backingCompositeClip, backingCompositeClip, &pWindowPriv->SavedRegion); } @@ -3444,14 +3444,14 @@ miBSValidateGC (pGC, stateChanges, pDrawable) * can be fixed only at great cost to the shadow routines. */ translatedClip = NotClippedByChildren (pWin); - REGION_TRANSLATE(pGC->pScreen, translatedClip, + RegionTranslate(translatedClip, -pDrawable->x, -pDrawable->y); - REGION_SUBTRACT(pGC->pScreen, backingCompositeClip, + RegionSubtract(backingCompositeClip, backingCompositeClip, translatedClip); - REGION_DESTROY(pGC->pScreen, translatedClip); + RegionDestroy(translatedClip); } - if (!REGION_NOTEMPTY(pGC->pScreen, backingCompositeClip)) + if (!RegionNotEmpty(backingCompositeClip)) lift_functions = TRUE; } else @@ -3508,7 +3508,7 @@ miBSValidateGC (pGC, stateChanges, pDrawable) if (lift_functions) { if (backingCompositeClip) - REGION_DESTROY( pGC->pScreen, backingCompositeClip); + RegionDestroy(backingCompositeClip); /* unwrap the GC again */ miBSDestroyGCPrivate (pGC); @@ -3541,14 +3541,14 @@ miBSValidateGC (pGC, stateChanges, pDrawable) if (pGC->clientClipType == CT_PIXMAP) { (*pBackingGC->funcs->CopyClip)(pBackingGC, pGC); - REGION_TRANSLATE(pGC->pScreen, backingCompositeClip, + RegionTranslate(backingCompositeClip, -pGC->clipOrg.x, -pGC->clipOrg.y); vals[0] = pGC->clipOrg.x - pWindowPriv->x; vals[1] = pGC->clipOrg.y - pWindowPriv->y; DoChangeGC(pBackingGC, GCClipXOrigin|GCClipYOrigin, vals, 0); (* pGC->pScreen->BackingStoreFuncs.SetClipmaskRgn) (pBackingGC, backingCompositeClip); - REGION_DESTROY( pGC->pScreen, backingCompositeClip); + RegionDestroy(backingCompositeClip); } else { @@ -3732,7 +3732,7 @@ miCreateBSPixmap (pWin, pExtents) backSet = ((pBackingStore->status == StatusVirtual) || (pBackingStore->status == StatusVDirty)); - extents = REGION_EXTENTS( pScreen, &pBackingStore->SavedRegion); + extents = RegionExtents(&pBackingStore->SavedRegion); if (!pBackingStore->pBackingPixmap && extents->x2 != extents->x1 && @@ -3797,7 +3797,7 @@ miCreateBSPixmap (pWin, pExtents) if (exposed) { miSendExposures(pWin, exposed, pWin->drawable.x, pWin->drawable.y); - REGION_DESTROY( pScreen, exposed); + RegionDestroy(exposed); } } @@ -3846,7 +3846,7 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) register int dx, dy; BITS32 gcMask; - if (!REGION_NOTEMPTY(pGC->pScreen, prgnExposed)) + if (!RegionNotEmpty(prgnExposed)) return; pBackingStore = (miBSWindowPtr)pSrc->backStorage; @@ -3854,10 +3854,10 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) (pBackingStore->status == StatusBadAlloc)) return; - REGION_NULL( pGC->pScreen, &tempRgn); - REGION_INTERSECT( pGC->pScreen, &tempRgn, prgnExposed, + RegionNull(&tempRgn); + RegionIntersect(&tempRgn, prgnExposed, &pBackingStore->SavedRegion); - REGION_SUBTRACT( pGC->pScreen, prgnExposed, prgnExposed, &tempRgn); + RegionSubtract(prgnExposed, prgnExposed, &tempRgn); if (plane != 0) { copyProc = pGC->ops->CopyPlane; @@ -3889,7 +3889,7 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) } break; case StatusContents: - for (i = REGION_NUM_RECTS(&tempRgn), pBox = REGION_RECTS(&tempRgn); + for (i = RegionNumRects(&tempRgn), pBox = RegionRects(&tempRgn); --i >= 0; pBox++) { @@ -3901,5 +3901,5 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) } break; } - REGION_UNINIT( pGC->pScreen, &tempRgn); + RegionUninit(&tempRgn); } diff --git a/nx-X11/programs/Xserver/mi/miexpose.c b/nx-X11/programs/Xserver/mi/miexpose.c index 782ddad49..379dd380f 100644 --- a/nx-X11/programs/Xserver/mi/miexpose.c +++ b/nx-X11/programs/Xserver/mi/miexpose.c @@ -185,21 +185,21 @@ miHandleExposures(pSrcDrawable, pDstDrawable, if (pGC->subWindowMode == IncludeInferiors) { prgnSrcClip = NotClippedByChildren (pSrcWin); - if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN) + if ((RegionContainsRect(prgnSrcClip, &TsrcBox)) == rgnIN) { - REGION_DESTROY(pscr, prgnSrcClip); + RegionDestroy(prgnSrcClip); return NULL; } } else { - if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN) + if ((RegionContainsRect(&pSrcWin->clipList, &TsrcBox)) == rgnIN) return NULL; prgnSrcClip = &rgnSrcRec; - REGION_NULL(pscr, prgnSrcClip); - REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList); + RegionNull(prgnSrcClip); + RegionCopy(prgnSrcClip, &pSrcWin->clipList); } - REGION_TRANSLATE(pscr, prgnSrcClip, + RegionTranslate(prgnSrcClip, -pSrcDrawable->x, -pSrcDrawable->y); } else @@ -216,7 +216,7 @@ miHandleExposures(pSrcDrawable, pDstDrawable, box.x2 = pSrcDrawable->width; box.y2 = pSrcDrawable->height; prgnSrcClip = &rgnSrcRec; - REGION_INIT(pscr, prgnSrcClip, &box, 1); + RegionInit(prgnSrcClip, &box, 1); pSrcWin = (WindowPtr)NULL; } @@ -233,11 +233,11 @@ miHandleExposures(pSrcDrawable, pDstDrawable, else { prgnDstClip = &rgnDstRec; - REGION_NULL(pscr, prgnDstClip); - REGION_COPY(pscr, prgnDstClip, + RegionNull(prgnDstClip); + RegionCopy(prgnDstClip, &((WindowPtr)pDstDrawable)->clipList); } - REGION_TRANSLATE(pscr, prgnDstClip, + RegionTranslate(prgnDstClip, -pDstDrawable->x, -pDstDrawable->y); } else @@ -249,14 +249,14 @@ miHandleExposures(pSrcDrawable, pDstDrawable, box.x2 = pDstDrawable->width; box.y2 = pDstDrawable->height; prgnDstClip = &rgnDstRec; - REGION_INIT(pscr, prgnDstClip, &box, 1); + RegionInit(prgnDstClip, &box, 1); } /* drawable-relative source region */ - REGION_INIT(pscr, &rgnExposed, &srcBox, 1); + RegionInit(&rgnExposed, &srcBox, 1); /* now get the hidden parts of the source box*/ - REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip); + RegionSubtract(&rgnExposed, &rgnExposed, prgnSrcClip); if (pSrcWin && pSrcWin->backStorage) { @@ -274,10 +274,10 @@ miHandleExposures(pSrcDrawable, pDstDrawable, } /* move them over the destination */ - REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy); + RegionTranslate(&rgnExposed, dstx-srcx, dsty-srcy); /* intersect with visible areas of dest */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip); + RegionIntersect(&rgnExposed, &rgnExposed, prgnDstClip); /* * If we have LOTS of rectangles, we decide to take the extents @@ -287,7 +287,7 @@ miHandleExposures(pSrcDrawable, pDstDrawable, * for windows. */ extents = pGC->graphicsExposures && - (REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) && + (RegionNumRects(&rgnExposed) > RECTLIMIT) && (pDstDrawable->type != DRAWABLE_PIXMAP); #ifdef SHAPE if (pSrcWin) @@ -300,7 +300,7 @@ miHandleExposures(pSrcDrawable, pDstDrawable, * exposed region will undo all our work! */ if (extents && pSrcWin && region && - (RECT_IN_REGION(pscr, region, &srcBox) != rgnIN)) + (RegionContainsRect(region, &srcBox) != rgnIN)) extents = FALSE; } #endif @@ -308,8 +308,8 @@ miHandleExposures(pSrcDrawable, pDstDrawable, { WindowPtr pWin = (WindowPtr)pDstDrawable; - expBox = *REGION_EXTENTS(pscr, &rgnExposed); - REGION_RESET(pscr, &rgnExposed, &expBox); + expBox = *RegionExtents(&rgnExposed); + RegionReset(&rgnExposed, &expBox); /* need to clear out new areas of backing store */ if (pWin->backStorage) (void) (* pWin->drawable.pScreen->ClearBackingStore)( @@ -326,53 +326,53 @@ miHandleExposures(pSrcDrawable, pDstDrawable, WindowPtr pWin = (WindowPtr)pDstDrawable; /* make the exposed area screen-relative */ - REGION_TRANSLATE(pscr, &rgnExposed, + RegionTranslate(&rgnExposed, pDstDrawable->x, pDstDrawable->y); if (extents) { /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList); + RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList); } (*pWin->drawable.pScreen->PaintWindowBackground)( (WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); if (extents) { - REGION_RESET(pscr, &rgnExposed, &expBox); + RegionReset(&rgnExposed, &expBox); } else - REGION_TRANSLATE(pscr, &rgnExposed, + RegionTranslate(&rgnExposed, -pDstDrawable->x, -pDstDrawable->y); } if (prgnDstClip == &rgnDstRec) { - REGION_UNINIT(pscr, prgnDstClip); + RegionUninit(prgnDstClip); } else if (prgnDstClip != prgnSrcClip) { - REGION_DESTROY(pscr, prgnDstClip); + RegionDestroy(prgnDstClip); } if (prgnSrcClip == &rgnSrcRec) { - REGION_UNINIT(pscr, prgnSrcClip); + RegionUninit(prgnSrcClip); } else { - REGION_DESTROY(pscr, prgnSrcClip); + RegionDestroy(prgnSrcClip); } if (pGC->graphicsExposures) { /* don't look */ - RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0); + RegionPtr exposed = RegionCreate(NullBox, 0); *exposed = rgnExposed; return exposed; } else { - REGION_UNINIT(pscr, &rgnExposed); + RegionUninit(&rgnExposed); return NULL; } } @@ -387,7 +387,7 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) int major; int minor; { - if (pRgn && !REGION_NIL(pRgn)) + if (pRgn && !RegionNil(pRgn)) { xEvent *pEvent; register xEvent *pe; @@ -395,8 +395,8 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) register int i; int numRects; - numRects = REGION_NUM_RECTS(pRgn); - pBox = REGION_RECTS(pRgn); + numRects = RegionNumRects(pRgn); + pBox = RegionRects(pRgn); if(!(pEvent = (xEvent *)ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) return; pe = pEvent; @@ -442,8 +442,8 @@ miSendExposures(pWin, pRgn, dx, dy) register xEvent *pEvent, *pe; register int i; - pBox = REGION_RECTS(pRgn); - numRects = REGION_NUM_RECTS(pRgn); + pBox = RegionRects(pRgn); + numRects = RegionNumRects(pRgn); if(!(pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)))) return; memset(pEvent, 0, numRects * sizeof(xEvent)); @@ -513,8 +513,8 @@ miWindowExposures(pWin, prgn, other_exposed) * no areas will be repainted. */ exposures = (*pWin->drawable.pScreen->RestoreAreas)(pWin, prgn); - if ((prgn && !REGION_NIL(prgn)) || - (exposures && !REGION_NIL(exposures)) || other_exposed) + if ((prgn && !RegionNil(prgn)) || + (exposures && !RegionNil(exposures)) || other_exposed) { RegionRec expRec; int clientInterested; @@ -527,15 +527,15 @@ miWindowExposures(pWin, prgn, other_exposed) { if (exposures) { - REGION_UNION(pWin->drawable.pScreen, other_exposed, + RegionUnion(other_exposed, exposures, other_exposed); if (exposures != prgn) - REGION_DESTROY(pWin->drawable.pScreen, exposures); + RegionDestroy(exposures); } exposures = other_exposed; } - if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT)) + if (clientInterested && exposures && (RegionNumRects(exposures) > RECTLIMIT)) { /* * If we have LOTS of rectangles, we decide to take the extents @@ -545,17 +545,17 @@ miWindowExposures(pWin, prgn, other_exposed) */ BoxRec box; - box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures); + box = *RegionExtents(exposures); if (exposures == prgn) { exposures = &expRec; - REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1); - REGION_RESET( pWin->drawable.pScreen, prgn, &box); + RegionInit(exposures, &box, 1); + RegionReset(prgn, &box); } else { - REGION_RESET( pWin->drawable.pScreen, exposures, &box); - REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures); + RegionReset(exposures, &box); + RegionUnion(prgn, prgn, exposures); } /* PaintWindowBackground doesn't clip, so we have to */ - REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList); + RegionIntersect(prgn, prgn, &pWin->clipList); /* need to clear out new areas of backing store, too */ if (pWin->backStorage) (void) (* pWin->drawable.pScreen->ClearBackingStore)( @@ -566,22 +566,22 @@ miWindowExposures(pWin, prgn, other_exposed) box.y2 - box.y1, FALSE); } - if (prgn && !REGION_NIL(prgn)) + if (prgn && !RegionNil(prgn)) (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !REGION_NIL(exposures)) + if (clientInterested && exposures && !RegionNil(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); if (exposures == &expRec) { - REGION_UNINIT( pWin->drawable.pScreen, exposures); + RegionUninit(exposures); } else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY( pWin->drawable.pScreen, exposures); + RegionDestroy(exposures); if (prgn) - REGION_EMPTY( pWin->drawable.pScreen, prgn); + RegionEmpty(prgn); } else if (exposures && exposures != prgn) - REGION_DESTROY( pWin->drawable.pScreen, exposures); + RegionDestroy(exposures); } @@ -706,7 +706,7 @@ int what; } } - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * + prect = (xRectangle *)ALLOCATE_LOCAL(RegionNumRects(prgn) * sizeof(xRectangle)); if (!prect) return; @@ -749,7 +749,7 @@ int what; box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); + RegionInit(&pWin->clipList, &box, 1); pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; newValues[ABSX].val = pBgWin->drawable.x; newValues[ABSY].val = pBgWin->drawable.y; @@ -852,8 +852,8 @@ int what; if (pWin->drawable.serialNumber != pGC->serialNumber) ValidateGC((DrawablePtr)pWin, pGC); - numRects = REGION_NUM_RECTS(prgn); - pbox = REGION_RECTS(prgn); + numRects = RegionNumRects(prgn); + pbox = RegionRects(prgn); for (i= numRects; --i >= 0; pbox++, prect++) { prect->x = pbox->x1 - pWin->drawable.x; @@ -872,7 +872,7 @@ int what; { if (what == PW_BORDER) { - REGION_UNINIT(pScreen, &pWin->clipList); + RegionUninit(&pWin->clipList); pWin->clipList = prgnWin; pWin->drawable.x = oldCorner.x; pWin->drawable.y = oldCorner.y; diff --git a/nx-X11/programs/Xserver/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c index 2b38b257d..167e63d0a 100644 --- a/nx-X11/programs/Xserver/mi/migc.c +++ b/nx-X11/programs/Xserver/mi/migc.c @@ -55,7 +55,7 @@ miDestroyGC(pGC) if (pGC->pRotatedPixmap) (*pGC->pScreen->DestroyPixmap) (pGC->pRotatedPixmap); if (pGC->freeCompClip) - REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); miDestroyGCOps(pGC->ops); } @@ -104,7 +104,7 @@ miDestroyClip(pGC) * we know we'll never have a list of rectangles, since ChangeClip * immediately turns them into a region */ - REGION_DESTROY(pGC->pScreen, pGC->clientClip); + RegionDestroy(pGC->clientClip); } pGC->clientClip = NULL; pGC->clientClipType = CT_NONE; @@ -121,7 +121,7 @@ miChangeClip(pGC, type, pvalue, nrects) if (type == CT_PIXMAP) { /* convert the pixmap to a region */ - pGC->clientClip = (void *) BITMAP_TO_REGION(pGC->pScreen, + pGC->clientClip = (void *) BitmapToRegion(pGC->pScreen, (PixmapPtr) pvalue); (*pGC->pScreen->DestroyPixmap) (pvalue); } @@ -132,7 +132,7 @@ miChangeClip(pGC, type, pvalue, nrects) } else if (type != CT_NONE) { - pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nrects, + pGC->clientClip = (void *) RegionFromRects(nrects, (xRectangle *) pvalue, type); xfree(pvalue); @@ -157,8 +157,8 @@ miCopyClip(pgcDst, pgcSrc) pgcSrc->clientClip, 0); break; case CT_REGION: - prgnNew = REGION_CREATE(pgcSrc->pScreen, NULL, 1); - REGION_COPY(pgcDst->pScreen, prgnNew, + prgnNew = RegionCreate(NULL, 1); + RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip)); (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (void *) prgnNew, 0); break; @@ -213,7 +213,7 @@ miComputeCompositeClip(pGC, pDrawable) if (pGC->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; pGC->freeCompClip = freeTmpClip; } @@ -228,30 +228,30 @@ miComputeCompositeClip(pGC, pDrawable) * clip. if neither is real, create a new region. */ - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); if (freeCompClip) { - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip); + RegionIntersect(pregWin, pregWin, pGC->clientClip); pGC->pCompositeClip = pregWin; } else { - pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + pGC->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); } pGC->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pDrawable->x + pGC->clipOrg.x), -(pDrawable->y + pGC->clipOrg.y)); } @@ -269,31 +269,31 @@ miComputeCompositeClip(pGC, pDrawable) if (pGC->freeCompClip) { - REGION_RESET(pScreen, pGC->pCompositeClip, &pixbounds); + RegionReset(pGC->pCompositeClip, &pixbounds); } else { pGC->freeCompClip = TRUE; - pGC->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1); + pGC->pCompositeClip = RegionCreate(&pixbounds, 1); } if (pGC->clientClipType == CT_REGION) { if(pDrawable->x || pDrawable->y) { - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pGC->pCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pDrawable->x + pGC->clipOrg.x), -(pDrawable->y + pGC->clipOrg.y)); } else { - REGION_TRANSLATE(pScreen, pGC->pCompositeClip, + RegionTranslate(pGC->pCompositeClip, -pGC->clipOrg.x, -pGC->clipOrg.y); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pGC->pCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pScreen, pGC->pCompositeClip, + RegionTranslate(pGC->pCompositeClip, pGC->clipOrg.x, pGC->clipOrg.y); } } diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c index f67704e11..96d5cc4f0 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.c +++ b/nx-X11/programs/Xserver/mi/mioverlay.c @@ -212,8 +212,8 @@ miOverlayCreateWindow(WindowPtr pWin) pTree->visibility = VisibilityNotViewable; pWinPriv->tree = pTree; if(pWin->parent) { - REGION_NULL(pScreen, &(pTree->borderClip)); - REGION_NULL(pScreen, &(pTree->clipList)); + RegionNull(&(pTree->borderClip)); + RegionNull(&(pTree->clipList)); RebuildTree(pWin); } else { BoxRec fullBox; @@ -221,8 +221,8 @@ miOverlayCreateWindow(WindowPtr pWin) fullBox.y1 = 0; fullBox.x2 = pScreen->width; fullBox.y2 = pScreen->height; - REGION_INIT(pScreen, &(pTree->borderClip), &fullBox, 1); - REGION_INIT(pScreen, &(pTree->clipList), &fullBox, 1); + RegionInit(&(pTree->borderClip), &fullBox, 1); + RegionInit(&(pTree->clipList), &fullBox, 1); } } else xfree(pTree); } @@ -250,8 +250,8 @@ miOverlayDestroyWindow(WindowPtr pWin) else if(pTree->parent) pTree->parent->lastChild = pTree->prevSib; - REGION_UNINIT(pScreen, &(pTree->borderClip)); - REGION_UNINIT(pScreen, &(pTree->clipList)); + RegionUninit(&(pTree->borderClip)); + RegionUninit(&(pTree->clipList)); xfree(pTree); } @@ -349,7 +349,7 @@ miOverlayMarkOverlappedWindows( doUnderlay = (IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)); - box = REGION_EXTENTS(pScreen, &pWin->borderSize); + box = RegionExtents(&pWin->borderSize); if((pChild = pFirst)) { pLast = pChild->parent->lastChild; @@ -360,13 +360,13 @@ miOverlayMarkOverlappedWindows( pTree = MIOVERLAY_GET_WINDOW_TREE(pChild); if(pChild->viewable) { - if (REGION_BROKEN (pScreen, &pChild->winSize)) + if (RegionBroken(&pChild->winSize)) SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) + if (RegionBroken(&pChild->borderSize)) SetBorderSize (pChild); if (markAll || - RECT_IN_REGION(pScreen, &pChild->borderSize, box)) + RegionContainsRect(&pChild->borderSize, box)) { MARK_OVERLAY(pChild); overMarked = TRUE; @@ -421,12 +421,12 @@ miOverlayMarkOverlappedWindows( while(1) { if(tChild->pWin->viewable) { - if (REGION_BROKEN (pScreen, &tChild->pWin->winSize)) + if (RegionBroken(&tChild->pWin->winSize)) SetWinSize (tChild->pWin); - if (REGION_BROKEN (pScreen, &tChild->pWin->borderSize)) + if (RegionBroken(&tChild->pWin->borderSize)) SetBorderSize (tChild->pWin); - if(RECT_IN_REGION(pScreen, &(tChild->pWin->borderSize), box)) + if(RegionContainsRect(&(tChild->pWin->borderSize), box)) { MARK_UNDERLAY(tChild->pWin); underMarked = TRUE; @@ -484,7 +484,7 @@ miOverlayComputeClips( borderSize.y2 = dy; oldVis = tParent->visibility; - switch (RECT_IN_REGION( pScreen, universe, &borderSize)) { + switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; break; @@ -534,8 +534,8 @@ miOverlayComputeClips( while (1) { if (tChild->pWin->viewable) { if (tChild->visibility != VisibilityFullyObscured) { - REGION_TRANSLATE( pScreen, &tChild->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &tChild->clipList, dx, dy); + RegionTranslate(&tChild->borderClip, dx, dy); + RegionTranslate(&tChild->clipList, dx, dy); tChild->pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -543,14 +543,14 @@ miOverlayComputeClips( (* pScreen->ClipNotify) (tChild->pWin, dx, dy); } if (tChild->valdata) { - REGION_NULL(pScreen, &tChild->valdata->borderExposed); + RegionNull(&tChild->valdata->borderExposed); if (HasParentRelativeBorder(tChild->pWin)){ - REGION_SUBTRACT(pScreen, + RegionSubtract( &tChild->valdata->borderExposed, &tChild->borderClip, &tChild->pWin->winSize); } - REGION_NULL(pScreen, &tChild->valdata->exposed); + RegionNull(&tChild->valdata->exposed); } if (tChild->firstChild) { tChild = tChild->firstChild; @@ -568,50 +568,50 @@ miOverlayComputeClips( /* fall through */ default: if (dx || dy) { - REGION_TRANSLATE( pScreen, &tParent->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &tParent->clipList, dx, dy); + RegionTranslate(&tParent->borderClip, dx, dy); + RegionTranslate(&tParent->clipList, dx, dy); } break; case VTBroken: - REGION_EMPTY (pScreen, &tParent->borderClip); - REGION_EMPTY (pScreen, &tParent->clipList); + RegionEmpty(&tParent->borderClip); + RegionEmpty(&tParent->clipList); break; } borderVisible = tParent->valdata->borderVisible; - REGION_NULL(pScreen, &tParent->valdata->borderExposed); - REGION_NULL(pScreen, &tParent->valdata->exposed); + RegionNull(&tParent->valdata->borderExposed); + RegionNull(&tParent->valdata->exposed); if (HasBorder (pParent)) { if (borderVisible) { - REGION_SUBTRACT( pScreen, exposed, universe, borderVisible); - REGION_DESTROY( pScreen, borderVisible); + RegionSubtract(exposed, universe, borderVisible); + RegionDestroy(borderVisible); } else - REGION_SUBTRACT( pScreen, exposed, universe, &tParent->borderClip); + RegionSubtract(exposed, universe, &tParent->borderClip); if (HasParentRelativeBorder(pParent) && (dx || dy)) - REGION_SUBTRACT( pScreen, &tParent->valdata->borderExposed, + RegionSubtract(&tParent->valdata->borderExposed, universe, &pParent->winSize); else - REGION_SUBTRACT( pScreen, &tParent->valdata->borderExposed, + RegionSubtract(&tParent->valdata->borderExposed, exposed, &pParent->winSize); - REGION_COPY( pScreen, &tParent->borderClip, universe); - REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize); + RegionCopy(&tParent->borderClip, universe); + RegionIntersect(universe, universe, &pParent->winSize); } else - REGION_COPY( pScreen, &tParent->borderClip, universe); + RegionCopy(&tParent->borderClip, universe); if ((tChild = tParent->firstChild) && pParent->mapped) { - REGION_NULL(pScreen, &childUniverse); - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUniverse); + RegionNull(&childUnion); for (; tChild; tChild = tChild->nextSib) { if (tChild->pWin->viewable) - REGION_APPEND( pScreen, &childUnion, &tChild->pWin->borderSize); + RegionAppend(&childUnion, &tChild->pWin->borderSize); } - REGION_VALIDATE( pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); for (tChild = tParent->firstChild; tChild; @@ -619,31 +619,31 @@ miOverlayComputeClips( { if (tChild->pWin->viewable) { if (tChild->valdata) { - REGION_INTERSECT( pScreen, &childUniverse, universe, + RegionIntersect(&childUniverse, universe, &tChild->pWin->borderSize); miOverlayComputeClips (tChild->pWin, &childUniverse, kind, exposed); } if (overlap) - REGION_SUBTRACT( pScreen, universe, universe, + RegionSubtract(universe, universe, &tChild->pWin->borderSize); } } if (!overlap) - REGION_SUBTRACT( pScreen, universe, universe, &childUnion); - REGION_UNINIT( pScreen, &childUnion); - REGION_UNINIT( pScreen, &childUniverse); + RegionSubtract(universe, universe, &childUnion); + RegionUninit(&childUnion); + RegionUninit(&childUniverse); } if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { - REGION_COPY( pScreen, &tParent->valdata->exposed, universe); + RegionCopy(&tParent->valdata->exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { - REGION_SUBTRACT( pScreen, &tParent->valdata->exposed, + RegionSubtract(&tParent->valdata->exposed, universe, &tParent->clipList); } @@ -721,14 +721,14 @@ miOverlayMarkUnrealizedWindow( if ((pChild != pWin) || fromConfigure) { miOverlayTreePtr pTree; - REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList); + RegionEmpty(&pChild->clipList); if (pChild->drawable.pScreen->ClipNotify) (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0); - REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip); + RegionEmpty(&pChild->borderClip); if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) { if(pTree->valdata != (miOverlayValDataPtr)UnmapValData) { - REGION_EMPTY(pChild->drawable.pScreen, &pTree->clipList); - REGION_EMPTY(pChild->drawable.pScreen, &pTree->borderClip); + RegionEmpty(&pTree->clipList); + RegionEmpty(&pTree->borderClip); } } } @@ -753,9 +753,9 @@ miOverlayValidateTree( if (!pChild) pChild = pParent->firstChild; - REGION_NULL(pScreen, &totalClip); - REGION_NULL(pScreen, &childClip); - REGION_NULL(pScreen, &exposed); + RegionNull(&totalClip); + RegionNull(&childClip); + RegionNull(&exposed); newParent = pParent; @@ -769,52 +769,52 @@ miOverlayValidateTree( else tChild = tParent->firstChild; - if (REGION_BROKEN (pScreen, &tParent->clipList) && - !REGION_BROKEN (pScreen, &tParent->borderClip)) + if (RegionBroken(&tParent->clipList) && + !RegionBroken(&tParent->borderClip)) { kind = VTBroken; - REGION_COPY (pScreen, &totalClip, &tParent->borderClip); - REGION_INTERSECT (pScreen, &totalClip, &totalClip, + RegionCopy(&totalClip, &tParent->borderClip); + RegionIntersect(&totalClip, &totalClip, &tParent->pWin->winSize); for (tWin = tParent->firstChild; tWin != tChild; tWin = tWin->nextSib) { if (tWin->pWin->viewable) - REGION_SUBTRACT (pScreen, &totalClip, &totalClip, + RegionSubtract(&totalClip, &totalClip, &tWin->pWin->borderSize); } - REGION_EMPTY (pScreen, &tParent->clipList); + RegionEmpty(&tParent->clipList); } else { for(tWin = tChild; tWin; tWin = tWin->nextSib) { if(tWin->valdata) - REGION_APPEND(pScreen, &totalClip, &tWin->borderClip); + RegionAppend(&totalClip, &tWin->borderClip); } - REGION_VALIDATE(pScreen, &totalClip, &overlap); + RegionValidate(&totalClip, &overlap); } if(kind != VTStack) - REGION_UNION(pScreen, &totalClip, &totalClip, &tParent->clipList); + RegionUnion(&totalClip, &totalClip, &tParent->clipList); for(tWin = tChild; tWin; tWin = tWin->nextSib) { if(tWin->valdata) { if(tWin->pWin->viewable) { - REGION_INTERSECT(pScreen, &childClip, &totalClip, + RegionIntersect(&childClip, &totalClip, &tWin->pWin->borderSize); miOverlayComputeClips(tWin->pWin, &childClip, kind, &exposed); - REGION_SUBTRACT(pScreen, &totalClip, &totalClip, + RegionSubtract(&totalClip, &totalClip, &tWin->pWin->borderSize); } else { /* Means we are unmapping */ - REGION_EMPTY(pScreen, &tWin->clipList); - REGION_EMPTY( pScreen, &tWin->borderClip); + RegionEmpty(&tWin->clipList); + RegionEmpty(&tWin->borderClip); tWin->valdata = NULL; } } } - REGION_UNINIT(pScreen, &childClip); + RegionUninit(&childClip); if(!((*pPriv->InOverlay)(newParent))) { - REGION_NULL(pScreen, &tParent->valdata->exposed); - REGION_NULL(pScreen, &tParent->valdata->borderExposed); + RegionNull(&tParent->valdata->exposed); + RegionNull(&tParent->valdata->borderExposed); } switch (kind) { @@ -822,18 +822,18 @@ miOverlayValidateTree( break; default: if(!((*pPriv->InOverlay)(newParent))) - REGION_SUBTRACT(pScreen, &tParent->valdata->exposed, &totalClip, + RegionSubtract(&tParent->valdata->exposed, &totalClip, &tParent->clipList); /* fall through */ case VTMap: - REGION_COPY( pScreen, &tParent->clipList, &totalClip); + RegionCopy(&tParent->clipList, &totalClip); if(!((*pPriv->InOverlay)(newParent))) newParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; break; } - REGION_UNINIT( pScreen, &totalClip); - REGION_UNINIT( pScreen, &exposed); + RegionUninit(&totalClip); + RegionUninit(&exposed); SKIP_UNDERLAY: @@ -866,13 +866,13 @@ miOverlayHandleExposures(WindowPtr pWin) while (1) { if((mival = pTree->valdata)) { if(!((*pPriv->InOverlay)(pTree->pWin))) { - if (REGION_NOTEMPTY(pScreen, &mival->borderExposed)) + if (RegionNotEmpty(&mival->borderExposed)) (*pWin->drawable.pScreen->PaintWindowBorder)( pTree->pWin, &mival->borderExposed, PW_BORDER); - REGION_UNINIT(pScreen, &mival->borderExposed); + RegionUninit(&mival->borderExposed); (*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion); - REGION_UNINIT(pScreen, &mival->exposed); + RegionUninit(&mival->exposed); } xfree(mival); pTree->valdata = NULL; @@ -894,24 +894,24 @@ miOverlayHandleExposures(WindowPtr pWin) while (1) { if ( (val = pChild->valdata) ) { if(!((*pPriv->InOverlay)(pChild))) { - REGION_UNION(pScreen, &val->after.exposed, &val->after.exposed, + RegionUnion(&val->after.exposed, &val->after.exposed, &val->after.borderExposed); - if (REGION_NOTEMPTY(pScreen, &val->after.exposed)) { + if (RegionNotEmpty(&val->after.exposed)) { (*(MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->MakeTransparent))( pScreen, - REGION_NUM_RECTS(&val->after.exposed), - REGION_RECTS(&val->after.exposed)); + RegionNumRects(&val->after.exposed), + RegionRects(&val->after.exposed)); } } else { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) + if (RegionNotEmpty(&val->after.borderExposed)) (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, &val->after.borderExposed, PW_BORDER); (*WindowExposures)(pChild, &val->after.exposed, NullRegion); } - REGION_UNINIT(pScreen, &val->after.borderExposed); - REGION_UNINIT(pScreen, &val->after.exposed); + RegionUninit(&val->after.borderExposed); + RegionUninit(&val->after.exposed); xfree(val); pChild->valdata = (ValidatePtr)NULL; if (pChild->firstChild) @@ -955,13 +955,13 @@ miOverlayMoveWindow( oldpt.x = pWin->drawable.x; oldpt.y = pWin->drawable.y; if (WasViewable) { - REGION_NULL(pScreen, &overReg); - REGION_NULL(pScreen, &underReg); + RegionNull(&overReg); + RegionNull(&underReg); if(pTree) { - REGION_COPY(pScreen, &overReg, &pWin->borderClip); - REGION_COPY(pScreen, &underReg, &pTree->borderClip); + RegionCopy(&overReg, &pWin->borderClip); + RegionCopy(&underReg, &pTree->borderClip); } else { - REGION_COPY(pScreen, &overReg, &pWin->borderClip); + RegionCopy(&overReg, &pWin->borderClip); CollectUnderlayChildrenRegions(pWin, &underReg); } (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); @@ -990,16 +990,16 @@ miOverlayMoveWindow( #endif /* DO_SAVE_UNDERS */ (*pScreen->ValidateTree)(pWin->parent, NullWindow, kind); - if(REGION_NOTEMPTY(pScreen, &underReg)) { + if(RegionNotEmpty(&underReg)) { pPriv->copyUnderlay = TRUE; (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, &underReg); } - REGION_UNINIT(pScreen, &underReg); - if(REGION_NOTEMPTY(pScreen, &overReg)) { + RegionUninit(&underReg); + if(RegionNotEmpty(&overReg)) { pPriv->copyUnderlay = FALSE; (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, &overReg); } - REGION_UNINIT(pScreen, &overReg); + RegionUninit(&overReg); (*pScreen->HandleExposures)(pWin->parent); #ifdef DO_SAVE_UNDERS @@ -1028,8 +1028,8 @@ miOverlayWindowExposures( if (pWin->backStorage && prgn) exposures = (*pScreen->RestoreAreas)(pWin, prgn); - if ((prgn && !REGION_NIL(prgn)) || - (exposures && !REGION_NIL(exposures)) || other_exposed) + if ((prgn && !RegionNil(prgn)) || + (exposures && !RegionNil(exposures)) || other_exposed) { RegionRec expRec; int clientInterested; @@ -1038,35 +1038,35 @@ miOverlayWindowExposures( ExposureMask; if (other_exposed) { if (exposures) { - REGION_UNION(pScreen, other_exposed, exposures, other_exposed); + RegionUnion(other_exposed, exposures, other_exposed); if (exposures != prgn) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); } exposures = other_exposed; } if (clientInterested && exposures && - (REGION_NUM_RECTS(exposures) > RECTLIMIT)) + (RegionNumRects(exposures) > RECTLIMIT)) { miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); BoxRec box; - box = *REGION_EXTENTS(pScreen, exposures); + box = *RegionExtents(exposures); if (exposures == prgn) { exposures = &expRec; - REGION_INIT(pScreen, exposures, &box, 1); - REGION_RESET(pScreen, prgn, &box); + RegionInit(exposures, &box, 1); + RegionReset(prgn, &box); } else { - REGION_RESET(pScreen, exposures, &box); - REGION_UNION(pScreen, prgn, prgn, exposures); + RegionReset(exposures, &box); + RegionUnion(prgn, prgn, exposures); } /* This is the only reason why we are replacing mi's version of this file */ if(!((*pPriv->InOverlay)(pWin))) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); - REGION_INTERSECT(pScreen, prgn, prgn, &pTree->clipList); + RegionIntersect(prgn, prgn, &pTree->clipList); } else - REGION_INTERSECT(pScreen, prgn, prgn, &pWin->clipList); + RegionIntersect(prgn, prgn, &pWin->clipList); /* need to clear out new areas of backing store, too */ if (pWin->backStorage) @@ -1078,22 +1078,22 @@ miOverlayWindowExposures( box.y2 - box.y1, FALSE); } - if (prgn && !REGION_NIL(prgn)) + if (prgn && !RegionNil(prgn)) (*pScreen->PaintWindowBackground)( pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !REGION_NIL(exposures)) + if (clientInterested && exposures && !RegionNil(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); if (exposures == &expRec) { - REGION_UNINIT(pScreen, exposures); + RegionUninit(exposures); } else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); if (prgn) - REGION_EMPTY(pScreen, prgn); + RegionEmpty(prgn); } else if (exposures && exposures != prgn) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); } @@ -1118,23 +1118,23 @@ miOverlayRecomputeExposures ( /* * compute exposed regions of this window */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->clipList, pValid->over); /* * compute exposed regions of the border */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, + RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, + RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->valdata->after.borderExposed, pValid->over); } if(pTree && pTree->valdata) { - REGION_SUBTRACT(pScreen, &pTree->valdata->exposed, + RegionSubtract(&pTree->valdata->exposed, &pTree->clipList, pValid->under); - REGION_SUBTRACT(pScreen, &pTree->valdata->borderExposed, + RegionSubtract(&pTree->valdata->borderExposed, &pTree->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pTree->valdata->borderExposed, + RegionSubtract(&pTree->valdata->borderExposed, &pTree->valdata->borderExposed, pValid->under); } else if (!pWin->valdata) return WT_NOMATCH; @@ -1194,11 +1194,11 @@ miOverlayResizeWindow( /* * save the visible region of the window */ - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->winSize); + oldRegion = RegionCreate(NullBox, 1); + RegionCopy(oldRegion, &pWin->winSize); if(doUnderlay) { - oldRegion2 = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion2, &pWin->winSize); + oldRegion2 = RegionCreate(NullBox, 1); + RegionCopy(oldRegion2, &pWin->winSize); } /* @@ -1210,16 +1210,16 @@ miOverlayResizeWindow( g = pChild->winGravity; if (g != UnmapGravity) { if (!gravitate[g]) - gravitate[g] = REGION_CREATE(pScreen, NullBox, 1); - REGION_UNION(pScreen, gravitate[g], + gravitate[g] = RegionCreate(NullBox, 1); + RegionUnion(gravitate[g], gravitate[g], &pChild->borderClip); if(doUnderlay) { if (!gravitate2[g]) - gravitate2[g] = REGION_CREATE(pScreen, NullBox, 0); + gravitate2[g] = RegionCreate(NullBox, 0); if((tChild = MIOVERLAY_GET_WINDOW_TREE(pChild))) { - REGION_UNION(pScreen, gravitate2[g], + RegionUnion(gravitate2[g], gravitate2[g], &tChild->borderClip); } else CollectUnderlayChildrenRegions(pChild, gravitate2[g]); @@ -1233,11 +1233,11 @@ miOverlayResizeWindow( oldWinClip = oldWinClip2 = NULL; if (pWin->bitGravity != ForgetGravity) { - oldWinClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip, &pWin->clipList); + oldWinClip = RegionCreate(NullBox, 1); + RegionCopy(oldWinClip, &pWin->clipList); if(pTree) { - oldWinClip2 = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip2, &pTree->clipList); + oldWinClip2 = RegionCreate(NullBox, 1); + RegionCopy(oldWinClip2, &pTree->clipList); } } /* @@ -1253,26 +1253,26 @@ miOverlayResizeWindow( if ((pWin->drawable.height != h || pWin->drawable.width != w) && HasBorder (pWin)) { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); + borderVisible = RegionCreate(NullBox, 1); if(pTree) - borderVisible2 = REGION_CREATE(pScreen, NullBox, 1); + borderVisible2 = RegionCreate(NullBox, 1); /* for tiled borders, we punt and draw the whole thing */ if (pWin->borderIsPixel || !moved) { if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); else - REGION_COPY(pScreen, borderVisible, + RegionCopy(borderVisible, &pWin->borderClip); if(pTree) { if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, + RegionSubtract(borderVisible, &pTree->borderClip, &pWin->winSize); else - REGION_COPY(pScreen, borderVisible, + RegionCopy(borderVisible, &pTree->borderClip); } } @@ -1299,9 +1299,9 @@ miOverlayResizeWindow( pFirstChange = MoveWindowInStack(pWin, pSib); if (WasViewable) { - pRegion = REGION_CREATE(pScreen, NullBox, 1); + pRegion = RegionCreate(NullBox, 1); if (pWin->backStorage) - REGION_COPY(pScreen, pRegion, &pWin->clipList); + RegionCopy(pRegion, &pWin->clipList); (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, NULL); @@ -1320,9 +1320,9 @@ miOverlayResizeWindow( * the entire window is trashed unless bitGravity * recovers portions of it */ - REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList); + RegionCopy(&pWin->valdata->after.exposed, &pWin->clipList); if(pTree) - REGION_COPY(pScreen, &pTree->valdata->exposed, &pTree->clipList); + RegionCopy(&pTree->valdata->exposed, &pTree->clipList); } GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); @@ -1361,20 +1361,20 @@ miOverlayResizeWindow( dx = (oldx - nx) - offx; dy = (oldy - ny) - offy; if (dx || dy) { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); + RegionTranslate(&pWin->winSize, dx, dy); offx += dx; offy += dy; } if(gravitate[g]) - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], + RegionIntersect(gravitate[g], gravitate[g], &pWin->winSize); if(gravitate2[g]) - REGION_INTERSECT(pScreen, gravitate2[g], gravitate2[g], + RegionIntersect(gravitate2[g], gravitate2[g], &pWin->winSize); } /* get winSize back where it belongs */ if (offx || offy) - REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy); + RegionTranslate(&pWin->winSize, -offx, -offy); } /* * add screen bits to the appropriate bucket @@ -1382,22 +1382,22 @@ miOverlayResizeWindow( if (oldWinClip2) { - REGION_COPY(pScreen, pRegion, oldWinClip2); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip2, pRegion, &pTree->clipList); + RegionCopy(pRegion, oldWinClip2); + RegionTranslate(pRegion, nx - oldx, ny - oldy); + RegionIntersect(oldWinClip2, pRegion, &pTree->clipList); for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate2[g]) - REGION_SUBTRACT(pScreen, oldWinClip2, oldWinClip2, + RegionSubtract(oldWinClip2, oldWinClip2, gravitate2[g]); } - REGION_TRANSLATE(pScreen, oldWinClip2, oldx - nx, oldy - ny); + RegionTranslate(oldWinClip2, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate2[g]) gravitate2[g] = oldWinClip2; else { - REGION_UNION(pScreen,gravitate2[g],gravitate2[g],oldWinClip2); - REGION_DESTROY(pScreen, oldWinClip2); + RegionUnion(gravitate2[g],gravitate2[g],oldWinClip2); + RegionDestroy(oldWinClip2); } } @@ -1406,9 +1406,9 @@ miOverlayResizeWindow( /* * clip to new clipList */ - REGION_COPY(pScreen, pRegion, oldWinClip); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList); + RegionCopy(pRegion, oldWinClip); + RegionTranslate(pRegion, nx - oldx, ny - oldy); + RegionIntersect(oldWinClip, pRegion, &pWin->clipList); /* * don't step on any gravity bits which will be copied after this * region. Note -- this assumes that the regions will be copied @@ -1416,16 +1416,16 @@ miOverlayResizeWindow( */ for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate[g]) - REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip, + RegionSubtract(oldWinClip, oldWinClip, gravitate[g]); } - REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny); + RegionTranslate(oldWinClip, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate[g]) gravitate[g] = oldWinClip; else { - REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip); - REGION_DESTROY(pScreen, oldWinClip); + RegionUnion(gravitate[g], gravitate[g], oldWinClip); + RegionDestroy(oldWinClip); } } @@ -1449,23 +1449,23 @@ miOverlayResizeWindow( /* only copy the remaining useful bits */ if(gravitate[g]) - REGION_INTERSECT(pScreen, gravitate[g], + RegionIntersect(gravitate[g], gravitate[g], oldRegion); if(gravitate2[g]) - REGION_INTERSECT(pScreen, gravitate2[g], + RegionIntersect(gravitate2[g], gravitate2[g], oldRegion2); /* clip to not overwrite already copied areas */ if (destClip && gravitate[g]) { - REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip); - REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y); + RegionTranslate(destClip, oldpt.x - x, oldpt.y - y); + RegionSubtract(gravitate[g], gravitate[g], destClip); + RegionTranslate(destClip, x - oldpt.x, y - oldpt.y); } if (destClip2 && gravitate2[g]) { - REGION_TRANSLATE(pScreen, destClip2, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen,gravitate2[g],gravitate2[g],destClip2); - REGION_TRANSLATE(pScreen, destClip2, x - oldpt.x, y - oldpt.y); + RegionTranslate(destClip2, oldpt.x - x, oldpt.y - y); + RegionSubtract(gravitate2[g],gravitate2[g],destClip2); + RegionTranslate(destClip2, x - oldpt.x, y - oldpt.y); } /* and move those bits */ @@ -1486,9 +1486,9 @@ miOverlayResizeWindow( /* remove any overwritten bits from the remaining useful bits */ if(gravitate[g]) - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); + RegionSubtract(oldRegion, oldRegion, gravitate[g]); if(gravitate2[g]) - REGION_SUBTRACT(pScreen, oldRegion2, oldRegion2, gravitate2[g]); + RegionSubtract(oldRegion2, oldRegion2, gravitate2[g]); /* * recompute exposed regions of child windows @@ -1513,38 +1513,38 @@ miOverlayResizeWindow( if (g == pWin->bitGravity) { if(gravitate[g]) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->valdata->after.exposed, gravitate[g]); if(gravitate2[g] && pTree) - REGION_SUBTRACT(pScreen, &pTree->valdata->exposed, + RegionSubtract(&pTree->valdata->exposed, &pTree->valdata->exposed, gravitate2[g]); } if(gravitate[g]) { if (!destClip) destClip = gravitate[g]; else { - REGION_UNION(pScreen, destClip, destClip, gravitate[g]); - REGION_DESTROY(pScreen, gravitate[g]); + RegionUnion(destClip, destClip, gravitate[g]); + RegionDestroy(gravitate[g]); } } if(gravitate2[g]) { if (!destClip2) destClip2 = gravitate2[g]; else { - REGION_UNION(pScreen, destClip2, destClip2, gravitate2[g]); - REGION_DESTROY(pScreen, gravitate2[g]); + RegionUnion(destClip2, destClip2, gravitate2[g]); + RegionDestroy(gravitate2[g]); } } } - REGION_DESTROY(pScreen, pRegion); - REGION_DESTROY(pScreen, oldRegion); + RegionDestroy(pRegion); + RegionDestroy(oldRegion); if(doUnderlay) - REGION_DESTROY(pScreen, oldRegion2); + RegionDestroy(oldRegion2); if (destClip) - REGION_DESTROY(pScreen, destClip); + RegionDestroy(destClip); if (destClip2) - REGION_DESTROY(pScreen, destClip2); + RegionDestroy(destClip2); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -1552,8 +1552,8 @@ miOverlayResizeWindow( valExposed = &pWin->valdata->after.exposed; (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionEmpty(valExposed); + RegionDestroy(bsExposed); } (*pScreen->HandleExposures)(pWin->parent); #ifdef DO_SAVE_UNDERS @@ -1565,7 +1565,7 @@ miOverlayResizeWindow( } else if (bsExposed) { (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionDestroy(bsExposed); } if (pWin->realized) WindowsRestructured (); @@ -1589,8 +1589,8 @@ miOverlaySetShape(WindowPtr pWin) if (HasBorder (pWin)) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NullBox, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; pWin->valdata->before.resized = TRUE; @@ -1598,8 +1598,8 @@ miOverlaySetShape(WindowPtr pWin) miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr borderVisible2; - borderVisible2 = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible2, + borderVisible2 = RegionCreate(NULL, 1); + RegionSubtract(borderVisible2, &pTree->borderClip, &pWin->winSize); pTree->valdata->borderVisible = borderVisible2; } @@ -1613,8 +1613,8 @@ miOverlaySetShape(WindowPtr pWin) if (WasViewable) { if (pWin->backStorage) { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); + pOldClip = RegionCreate(NullBox, 1); + RegionCopy(pOldClip, &pWin->clipList); } (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); @@ -1634,7 +1634,7 @@ miOverlaySetShape(WindowPtr pWin) (pWin, 0, 0, pOldClip, pWin->drawable.x, pWin->drawable.y); if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); + RegionDestroy(pOldClip); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -1643,8 +1643,8 @@ miOverlaySetShape(WindowPtr pWin) valExposed = &pWin->valdata->after.exposed; (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionEmpty(valExposed); + RegionDestroy(bsExposed); } } if (WasViewable) { @@ -1694,16 +1694,16 @@ miOverlayChangeBorderWidth( if (HadBorder) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NULL, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; if(IN_UNDERLAY(pWin)) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr borderVisible2; - borderVisible2 = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible2, + borderVisible2 = RegionCreate(NULL, 1); + RegionSubtract(borderVisible2, &pTree->borderClip, &pWin->winSize); pTree->valdata->borderVisible = borderVisible2; } @@ -1746,11 +1746,11 @@ miOverlaySetRootClip(ScreenPtr pScreen, Bool enable) box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_RESET(pScreen, &pTree->borderClip, &box); + RegionReset(&pTree->borderClip, &box); } else - REGION_EMPTY(pScreen, &pTree->borderClip); + RegionEmpty(&pTree->borderClip); - REGION_BREAK(pScreen, &pTree->clipList); + RegionBreak(&pTree->clipList); } static void @@ -1785,7 +1785,7 @@ miOverlayClearToBackground( clipList = ((*pScreenPriv->InOverlay)(pWin)) ? &pWin->clipList : &pTree->clipList; - extents = REGION_EXTENTS(pScreen, clipList); + extents = RegionExtents(clipList); if (x1 < extents->x1) x1 = extents->x1; if (x2 > extents->x2) x2 = extents->x2; @@ -1798,20 +1798,20 @@ miOverlayClearToBackground( box.x1 = x1; box.x2 = x2; box.y1 = y1; box.y2 = y2; - REGION_INIT(pScreen, ®, &box, 1); + RegionInit(®, &box, 1); if (pWin->backStorage) { pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h, generateExposures); } - REGION_INTERSECT(pScreen, ®, ®, clipList); + RegionIntersect(®, ®, clipList); if (generateExposures) (*pScreen->WindowExposures)(pWin, ®, pBSReg); else if (pWin->backgroundState != None) (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); - REGION_UNINIT(pScreen, ®); + RegionUninit(®); if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); + RegionDestroy(pBSReg); } @@ -1865,12 +1865,12 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) } if (pGC->subWindowMode == IncludeInferiors) { - pregWin = REGION_CREATE(pScreen, NullBox, 1); + pregWin = RegionCreate(NullBox, 1); freeTmpClip = TRUE; if (pWin->parent || (screenIsSaved != SCREEN_SAVER_ON) || !HasSaverWindow (pScreen->myNum)) { - REGION_INTERSECT(pScreen,pregWin,&pTree->borderClip,&pWin->winSize); + RegionIntersect(pregWin,&pTree->borderClip,&pWin->winSize); } } else { pregWin = &pTree->clipList; @@ -1879,29 +1879,29 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) freeCompClip = pGC->freeCompClip; if (pGC->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; pGC->freeCompClip = freeTmpClip; } else { - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pWin->drawable.x + pGC->clipOrg.x, pWin->drawable.y + pGC->clipOrg.y); if (freeCompClip) { - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip); + RegionIntersect(pregWin, pregWin, pGC->clientClip); pGC->pCompositeClip = pregWin; } else { - pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + pGC->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); } pGC->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pWin->drawable.x + pGC->clipOrg.x), -(pWin->drawable.y + pGC->clipOrg.y)); } @@ -1919,7 +1919,7 @@ miOverlayCollectUnderlayRegions( return FALSE; } - *region = REGION_CREATE(pWin->drawable.pScreen, NullBox, 0); + *region = RegionCreate(NullBox, 0); CollectUnderlayChildrenRegions(pWin, *region); @@ -2041,7 +2041,7 @@ CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg) while(1) { if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) { - REGION_APPEND(pScreen, pReg, &pTree->borderClip); + RegionAppend(pReg, &pTree->borderClip); hasUnderlay = TRUE; } else if(pChild->firstChild) { @@ -2059,7 +2059,7 @@ CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg) if(hasUnderlay) { Bool overlap; - REGION_VALIDATE(pScreen, pReg, &overlap); + RegionValidate(pReg, &overlap); } return hasUnderlay; diff --git a/nx-X11/programs/Xserver/mi/miregion.c b/nx-X11/programs/Xserver/mi/miregion.c index 1df0dcc46..b8216e1bb 100644 --- a/nx-X11/programs/Xserver/mi/miregion.c +++ b/nx-X11/programs/Xserver/mi/miregion.c @@ -197,7 +197,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ { \ if (!miRectAlloc(pReg, 1)) \ return FALSE; \ - pNextRect = REGION_TOP(pReg); \ + pNextRect = RegionTop(pReg); \ } \ ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \ pReg->data->numRects++; \ @@ -208,7 +208,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ #define DOWNSIZE(reg,numRects) \ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ { \ - size_t NewSize = REGION_SZOF(numRects); \ + size_t NewSize = RegionSizeof(numRects); \ RegDataPtr NewData = \ (NewSize > 0) ? (RegDataPtr)xrealloc((reg)->data, NewSize) : NULL; \ if (NewData) \ @@ -234,9 +234,9 @@ miPrintRegion(rgn) register int i; BoxPtr rects; - num = REGION_NUM_RECTS(rgn); - size = REGION_SIZE(rgn); - rects = REGION_RECTS(rgn); + num = RegionNumRects(rgn); + size = RegionSize(rgn); + rects = RegionRects(rgn); ErrorF("num: %d size: %d\n", num, size); ErrorF("extents: %d %d %d %d\n", rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2); @@ -261,11 +261,11 @@ miRegionEqual(reg1, reg2) if (reg1->extents.y1 != reg2->extents.y1) return FALSE; if (reg1->extents.y2 != reg2->extents.y2) return FALSE; - num = REGION_NUM_RECTS(reg1); - if (num != REGION_NUM_RECTS(reg2)) return FALSE; + num = RegionNumRects(reg1); + if (num != RegionNumRects(reg2)) return FALSE; - rects1 = REGION_RECTS(reg1); - rects2 = REGION_RECTS(reg2); + rects1 = RegionRects(reg1); + rects2 = RegionRects(reg2); for (i = 0; i != num; i++) { if (rects1[i].x1 != rects2[i].x1) return FALSE; if (rects1[i].x2 != rects2[i].x2) return FALSE; @@ -285,7 +285,7 @@ miValidRegion(reg) if ((reg->extents.x1 > reg->extents.x2) || (reg->extents.y1 > reg->extents.y2)) return FALSE; - numRects = REGION_NUM_RECTS(reg); + numRects = RegionNumRects(reg); if (!numRects) return ((reg->extents.x1 == reg->extents.x2) && (reg->extents.y1 == reg->extents.y2) && @@ -297,7 +297,7 @@ miValidRegion(reg) register BoxPtr pboxP, pboxN; BoxRec box; - pboxP = REGION_RECTS(reg); + pboxP = RegionRects(reg); box = *pboxP; box.y2 = pboxP[numRects-1].y2; pboxN = pboxP + 1; @@ -349,7 +349,7 @@ miRegionCreate(rect, size) else { pReg->extents = miEmptyBox; - newSize = REGION_SZOF(size); + newSize = RegionSizeof(size); if ((size > 1) && (newSize > 0) && (pReg->data = xalloc(newSize))) { @@ -383,7 +383,7 @@ miRegionInit(pReg, rect, size) else { pReg->extents = miEmptyBox; - newSize = REGION_SZOF(size); + newSize = RegionSizeof(size); if ((size > 1) && (newSize > 0) && (pReg->data = xalloc(newSize))) { @@ -434,16 +434,16 @@ miRectAlloc( if (!pRgn->data) { n++; - rgnSize = REGION_SZOF(n); + rgnSize = RegionSizeof(n); pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL; if (!pRgn->data) return miRegionBreak (pRgn); pRgn->data->numRects = 1; - *REGION_BOXPTR(pRgn) = pRgn->extents; + *RegionBoxptr(pRgn) = pRgn->extents; } else if (!pRgn->data->size) { - rgnSize = REGION_SZOF(n); + rgnSize = RegionSizeof(n); pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL; if (!pRgn->data) return miRegionBreak (pRgn); @@ -458,7 +458,7 @@ miRectAlloc( n = 250; } n += pRgn->data->numRects; - rgnSize = REGION_SZOF(n); + rgnSize = RegionSizeof(n); data = (rgnSize > 0) ? xrealloc(pRgn->data, rgnSize) : NULL; if (!data) return miRegionBreak (pRgn); @@ -486,7 +486,7 @@ miRegionCopy(dst, src) } if (!dst->data || (dst->data->size < src->data->numRects)) { - size_t newSize = REGION_SZOF(src->data->numRects); + size_t newSize = RegionSizeof(src->data->numRects); xfreeData(dst); dst->data = newSize > 0 ? xalloc(newSize) : NULL; @@ -495,7 +495,7 @@ miRegionCopy(dst, src) dst->data->size = src->data->numRects; } dst->data->numRects = src->data->numRects; - memmove((char *)REGION_BOXPTR(dst),(char *)REGION_BOXPTR(src), + memmove((char *)RegionBoxptr(dst),(char *)RegionBoxptr(src), dst->data->numRects * sizeof(BoxRec)); return TRUE; } @@ -545,8 +545,8 @@ miCoalesce ( * The bands may only be coalesced if the bottom of the previous * matches the top scanline of the current. */ - pPrevBox = REGION_BOX(pReg, prevStart); - pCurBox = REGION_BOX(pReg, curStart); + pPrevBox = RegionBox(pReg, prevStart); + pCurBox = RegionBox(pReg, curStart); if (pPrevBox->y2 != pCurBox->y1) return curStart; /* @@ -625,7 +625,7 @@ miAppendNonO ( /* Make sure we have enough space for all rectangles to be added */ RECTALLOC(pReg, newRects); - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); pReg->data->numRects += newRects; do { assert(r->x1 < r->x2); @@ -650,7 +650,7 @@ miAppendNonO ( int newRects; \ if ((newRects = rEnd - r)) { \ RECTALLOC(newReg, newRects); \ - memmove((char *)REGION_TOP(newReg),(char *)r, \ + memmove((char *)RegionTop(newReg),(char *)r, \ newRects * sizeof(BoxRec)); \ newReg->data->numRects += newRects; \ } \ @@ -731,7 +731,7 @@ miRegionOp( /* * Break any region computed from a broken region */ - if (REGION_NAR (reg1) || REGION_NAR(reg2)) + if (RegionNar (reg1) || RegionNar(reg2)) return miRegionBreak (newReg); /* @@ -742,11 +742,11 @@ miRegionOp( * another array of rectangles for it to use. */ - r1 = REGION_RECTS(reg1); - newSize = REGION_NUM_RECTS(reg1); + r1 = RegionRects(reg1); + newSize = RegionNumRects(reg1); r1End = r1 + newSize; - numRects = REGION_NUM_RECTS(reg2); - r2 = REGION_RECTS(reg2); + numRects = RegionNumRects(reg2); + r2 = RegionRects(reg2); r2End = r2 + numRects; assert(r1 != r1End); assert(r2 != r2End); @@ -903,7 +903,7 @@ miRegionOp( } else if (numRects == 1) { - newReg->extents = *REGION_BOXPTR(newReg); + newReg->extents = *RegionBoxptr(newReg); xfreeData(newReg); newReg->data = (RegDataPtr)NULL; } @@ -945,8 +945,8 @@ miSetExtents (pReg) return; } - pBox = REGION_BOXPTR(pReg); - pBoxEnd = REGION_END(pReg); + pBox = RegionBoxptr(pReg); + pBoxEnd = RegionEnd(pReg); /* * Since pBox is the first rectangle in the region, it must have the @@ -1004,7 +1004,7 @@ miIntersectO ( register int x2; register BoxPtr pNextRect; - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); assert(y1 < y2); assert(r1 != r1End && r2 != r2End); @@ -1047,14 +1047,14 @@ miIntersect(newReg, reg1, reg2) good(reg2); good(newReg); /* check for trivial reject */ - if (REGION_NIL(reg1) || REGION_NIL(reg2) || + if (RegionNil(reg1) || RegionNil(reg2) || !EXTENTCHECK(®1->extents, ®2->extents)) { /* Covers about 20% of all cases */ xfreeData(newReg); newReg->extents.x2 = newReg->extents.x1; newReg->extents.y2 = newReg->extents.y1; - if (REGION_NAR(reg1) || REGION_NAR(reg2)) + if (RegionNar(reg1) || RegionNar(reg2)) { newReg->data = &miBrokenData; return FALSE; @@ -1150,7 +1150,7 @@ miUnionO ( assert (y1 < y2); assert(r1 != r1End && r2 != r2End); - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); /* Start off current rectangle */ if (r1->x1 < r2->x1) @@ -1217,9 +1217,9 @@ miUnion(newReg, reg1, reg2) /* * Region 1 is empty */ - if (REGION_NIL(reg1)) + if (RegionNil(reg1)) { - if (REGION_NAR(reg1)) + if (RegionNar(reg1)) return miRegionBreak (newReg); if (newReg != reg2) return miRegionCopy(newReg, reg2); @@ -1229,9 +1229,9 @@ miUnion(newReg, reg1, reg2) /* * Region 2 is empty */ - if (REGION_NIL(reg2)) + if (RegionNil(reg2)) { - if (REGION_NAR(reg2)) + if (RegionNar(reg2)) return miRegionBreak (newReg); if (newReg != reg1) return miRegionCopy(newReg, reg1); @@ -1300,7 +1300,7 @@ miRegionAppend(dstrgn, rgn) BoxPtr new, old; Bool prepend; - if (REGION_NAR(rgn)) + if (RegionNar(rgn)) return miRegionBreak (dstrgn); if (!rgn->data && (dstrgn->data == &miEmptyData)) @@ -1310,16 +1310,16 @@ miRegionAppend(dstrgn, rgn) return TRUE; } - numRects = REGION_NUM_RECTS(rgn); + numRects = RegionNumRects(rgn); if (!numRects) return TRUE; prepend = FALSE; size = numRects; - dnumRects = REGION_NUM_RECTS(dstrgn); + dnumRects = RegionNumRects(dstrgn); if (!dnumRects && (size < 200)) size = 200; /* XXX pick numbers out of a hat */ RECTALLOC(dstrgn, size); - old = REGION_RECTS(rgn); + old = RegionRects(rgn); if (!dnumRects) dstrgn->extents = rgn->extents; else if (dstrgn->extents.x2 > dstrgn->extents.x1) @@ -1327,7 +1327,7 @@ miRegionAppend(dstrgn, rgn) register BoxPtr first, last; first = old; - last = REGION_BOXPTR(dstrgn) + (dnumRects - 1); + last = RegionBoxptr(dstrgn) + (dnumRects - 1); if ((first->y1 > last->y2) || ((first->y1 == last->y1) && (first->y2 == last->y2) && (first->x1 > last->x2))) @@ -1340,7 +1340,7 @@ miRegionAppend(dstrgn, rgn) } else { - first = REGION_BOXPTR(dstrgn); + first = RegionBoxptr(dstrgn); last = old + (numRects - 1); if ((first->y1 > last->y2) || ((first->y1 == last->y1) && (first->y2 == last->y2) && @@ -1359,16 +1359,16 @@ miRegionAppend(dstrgn, rgn) } if (prepend) { - new = REGION_BOX(dstrgn, numRects); + new = RegionBox(dstrgn, numRects); if (dnumRects == 1) - *new = *REGION_BOXPTR(dstrgn); + *new = *RegionBoxptr(dstrgn); else - memmove((char *)new,(char *)REGION_BOXPTR(dstrgn), + memmove((char *)new,(char *)RegionBoxptr(dstrgn), dnumRects * sizeof(BoxRec)); - new = REGION_BOXPTR(dstrgn); + new = RegionBoxptr(dstrgn); } else - new = REGION_BOXPTR(dstrgn) + dnumRects; + new = RegionBoxptr(dstrgn) + dnumRects; if (numRects == 1) *new = *old; else @@ -1511,7 +1511,7 @@ miRegionValidate(badreg, pOverlap) numRects = badreg->data->numRects; if (!numRects) { - if (REGION_NAR(badreg)) + if (RegionNar(badreg)) return FALSE; good(badreg); return TRUE; @@ -1532,7 +1532,7 @@ miRegionValidate(badreg, pOverlap) } /* Step 1: Sort the rects array into ascending (y1, x1) order */ - QuickSortRects(REGION_BOXPTR(badreg), numRects); + QuickSortRects(RegionBoxptr(badreg), numRects); /* Step 2: Scatter the sorted array into the minimum number of regions */ @@ -1546,7 +1546,7 @@ miRegionValidate(badreg, pOverlap) ri[0].prevBand = 0; ri[0].curBand = 0; ri[0].reg = *badreg; - box = REGION_BOXPTR(&ri[0].reg); + box = RegionBoxptr(&ri[0].reg); ri[0].reg.extents = *box; ri[0].reg.data->numRects = 1; @@ -1563,7 +1563,7 @@ miRegionValidate(badreg, pOverlap) for (j = numRI, rit = ri; --j >= 0; rit++) { reg = &rit->reg; - riBox = REGION_END(reg); + riBox = RegionEnd(reg); if (box->y1 == riBox->y1 && box->y2 == riBox->y2) { @@ -1577,7 +1577,7 @@ miRegionValidate(badreg, pOverlap) else { RECTALLOC_BAIL(reg, 1, bail); - *REGION_TOP(reg) = *box; + *RegionTop(reg) = *box; reg->data->numRects++; } goto NextRect; /* So sue me */ @@ -1590,7 +1590,7 @@ miRegionValidate(badreg, pOverlap) Coalesce(reg, rit->prevBand, rit->curBand); rit->curBand = reg->data->numRects; RECTALLOC_BAIL(reg, 1, bail); - *REGION_TOP(reg) = *box; + *RegionTop(reg) = *box; reg->data->numRects++; goto NextRect; } @@ -1624,7 +1624,7 @@ NextRect: ; for (j = numRI, rit = ri; --j >= 0; rit++) { reg = &rit->reg; - riBox = REGION_END(reg); + riBox = RegionEnd(reg); reg->extents.y2 = riBox->y2; if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; Coalesce(reg, rit->prevBand, rit->curBand); @@ -1682,7 +1682,7 @@ miRectsToRegion(nrects, prect, ctype) size_t newSize; pRgn = miRegionCreate(NullBox, 0); - if (REGION_NAR (pRgn)) + if (RegionNar (pRgn)) return pRgn; if (!nrects) return pRgn; @@ -1704,7 +1704,7 @@ miRectsToRegion(nrects, prect, ctype) } return pRgn; } - newSize = REGION_SZOF(nrects); + newSize = RegionSizeof(nrects); pData = newSize > 0 ? xalloc(newSize) : NULL; if (!pData) { @@ -1790,7 +1790,7 @@ miSubtractO ( assert(y1<y2); assert(r1 != r1End && r2 != r2End); - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); do { @@ -1907,10 +1907,10 @@ miSubtract(regD, regM, regS) good(regS); good(regD); /* check for trivial rejects */ - if (REGION_NIL(regM) || REGION_NIL(regS) || + if (RegionNil(regM) || RegionNil(regS) || !EXTENTCHECK(®M->extents, ®S->extents)) { - if (REGION_NAR (regS)) + if (RegionNar (regS)) return miRegionBreak (regD); return miRegionCopy(regD, regM); } @@ -1973,9 +1973,9 @@ miInverse(newReg, reg1, invRect) good(reg1); good(newReg); /* check for trivial rejects */ - if (REGION_NIL(reg1) || !EXTENTCHECK(invRect, ®1->extents)) + if (RegionNil(reg1) || !EXTENTCHECK(invRect, ®1->extents)) { - if (REGION_NAR(reg1)) + if (RegionNar(reg1)) return miRegionBreak (newReg); newReg->extents = *invRect; xfreeData(newReg); @@ -2033,7 +2033,7 @@ miRectIn(region, prect) int numRects; good(region); - numRects = REGION_NUM_RECTS(region); + numRects = RegionNumRects(region); /* useful optimization */ if (!numRects || !EXTENTCHECK(®ion->extents, prect)) return(rgnOUT); @@ -2055,7 +2055,7 @@ miRectIn(region, prect) y = prect->y1; /* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */ - for (pbox = REGION_BOXPTR(region), pboxEnd = pbox + numRects; + for (pbox = RegionBoxptr(region), pboxEnd = pbox + numRects; pbox != pboxEnd; pbox++) { @@ -2135,7 +2135,7 @@ miTranslateRegion(pReg, x, y) { if (pReg->data && (nbox = pReg->data->numRects)) { - for (pbox = REGION_BOXPTR(pReg); nbox--; pbox++) + for (pbox = RegionBoxptr(pReg); nbox--; pbox++) { pbox->x1 += x; pbox->y1 += y; @@ -2165,7 +2165,7 @@ miTranslateRegion(pReg, x, y) { register BoxPtr pboxout; - for (pboxout = pbox = REGION_BOXPTR(pReg); nbox--; pbox++) + for (pboxout = pbox = RegionBoxptr(pReg); nbox--; pbox++) { pboxout->x1 = x1 = pbox->x1 + x; pboxout->y1 = y1 = pbox->y1 + y; @@ -2191,7 +2191,7 @@ miTranslateRegion(pReg, x, y) { if (pReg->data->numRects == 1) { - pReg->extents = *REGION_BOXPTR(pReg); + pReg->extents = *RegionBoxptr(pReg); xfreeData(pReg); pReg->data = (RegDataPtr)NULL; } @@ -2220,7 +2220,7 @@ miRegionDataCopy( } if (!dst->data || (dst->data->size < src->data->numRects)) { - size_t newSize = REGION_SZOF(src->data->numRects); + size_t newSize = RegionSizeof(src->data->numRects); xfreeData(dst); dst->data = newSize > 0 ? xalloc(newSize) : NULL; if (!dst->data) @@ -2254,7 +2254,7 @@ miPointInRegion(pReg, x, y, box) int numRects; good(pReg); - numRects = REGION_NUM_RECTS(pReg); + numRects = RegionNumRects(pReg); if (!numRects || !INBOX(&pReg->extents, x, y)) return(FALSE); if (numRects == 1) @@ -2262,7 +2262,7 @@ miPointInRegion(pReg, x, y, box) *box = pReg->extents; return(TRUE); } - for (pbox = REGION_BOXPTR(pReg), pboxEnd = pbox + numRects; + for (pbox = RegionBoxptr(pReg), pboxEnd = pbox + numRects; pbox != pboxEnd; pbox++) { @@ -2283,14 +2283,14 @@ miRegionNotEmpty(pReg) RegionPtr pReg; { good(pReg); - return(!REGION_NIL(pReg)); + return(!RegionNil(pReg)); } Bool miRegionBroken(RegionPtr pReg) { good(pReg); - return (REGION_NAR(pReg)); + return (RegionNar(pReg)); } void @@ -2497,7 +2497,7 @@ miClipSpans( if ((! fSorted) && (nspans > 1)) QuickSortSpans(ppt, pwidth, nspans); - pboxBandStart = REGION_BOXPTR(prgnDst); + pboxBandStart = RegionBoxptr(prgnDst); pboxLast = pboxBandStart + numRects; NextBand(); @@ -2558,8 +2558,8 @@ miFindMaxBand(prgn) short yThisBand; good(prgn); - nbox = REGION_NUM_RECTS(prgn); - pbox = REGION_RECTS(prgn); + nbox = RegionNumRects(prgn); + pbox = RegionRects(prgn); while(nbox > 0) { diff --git a/nx-X11/programs/Xserver/mi/misprite.c b/nx-X11/programs/Xserver/mi/misprite.c index a5e3f9ccf..c854984fc 100644 --- a/nx-X11/programs/Xserver/mi/misprite.c +++ b/nx-X11/programs/Xserver/mi/misprite.c @@ -136,7 +136,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; if (pScreenPriv->isUp && - RECT_IN_REGION (pScreen, pRegion, &pScreenPriv->saved) != rgnOUT) + RegionContainsRect(pRegion, &pScreenPriv->saved) != rgnOUT) { SPRITE_DEBUG(("Damage remove\n")); miSpriteRemoveCursor (pScreen); @@ -389,7 +389,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) * Damage will take care of destination check */ if (pScreenPriv->isUp && - RECT_IN_REGION (pScreen, prgnSrc, &pScreenPriv->saved) != rgnOUT) + RegionContainsRect(prgnSrc, &pScreenPriv->saved) != rgnOUT) { SPRITE_DEBUG (("CopyWindow remove\n")); miSpriteRemoveCursor (pScreen); @@ -589,7 +589,7 @@ miSpriteSaveDoomedAreas (pWin, pObscured, dx, dy) cursorBox.x2 += dx; cursorBox.y2 += dy; } - if (RECT_IN_REGION( pScreen, pObscured, &cursorBox) != rgnOUT) + if (RegionContainsRect(pObscured, &cursorBox) != rgnOUT) miSpriteRemoveCursor (pScreen); } diff --git a/nx-X11/programs/Xserver/mi/mivaltree.c b/nx-X11/programs/Xserver/mi/mivaltree.c index b9a42472f..73028a074 100644 --- a/nx-X11/programs/Xserver/mi/mivaltree.c +++ b/nx-X11/programs/Xserver/mi/mivaltree.c @@ -123,8 +123,8 @@ miShapedWindowIn (pScreen, universe, bounding, rect, x, y) Bool someIn, someOut; register int t, x1, y1, x2, y2; - nbox = REGION_NUM_RECTS (bounding); - boundBox = REGION_RECTS (bounding); + nbox = RegionNumRects (bounding); + boundBox = RegionRects (bounding); someIn = someOut = FALSE; x1 = rect->x1; y1 = rect->y1; @@ -148,7 +148,7 @@ miShapedWindowIn (pScreen, universe, bounding, rect, x, y) box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - switch (RECT_IN_REGION(pScreen, universe, &box)) + switch (RegionContainsRect(universe, &box)) { case rgnIN: if (someOut) @@ -241,7 +241,7 @@ miComputeClips ( borderSize.y2 = dy; oldVis = pParent->visibility; - switch (RECT_IN_REGION( pScreen, universe, &borderSize)) + switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; @@ -287,7 +287,7 @@ miComputeClips ( { if (miSetRedirectBorderClipProc) (*miSetRedirectBorderClipProc) (pParent, universe); - REGION_COPY(pScreen, universe, &pParent->borderSize); + RegionCopy(universe, &pParent->borderSize); } #endif @@ -315,9 +315,9 @@ miComputeClips ( { if (pChild->visibility != VisibilityFullyObscured) { - REGION_TRANSLATE( pScreen, &pChild->borderClip, + RegionTranslate(&pChild->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pChild->clipList, + RegionTranslate(&pChild->clipList, dx, dy); pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) @@ -326,16 +326,16 @@ miComputeClips ( } if (pChild->valdata) { - REGION_NULL(pScreen, + RegionNull( &pChild->valdata->after.borderExposed); if (HasParentRelativeBorder(pChild)) { - REGION_SUBTRACT(pScreen, + RegionSubtract( &pChild->valdata->after.borderExposed, &pChild->borderClip, &pChild->winSize); } - REGION_NULL(pScreen, &pChild->valdata->after.exposed); + RegionNull(&pChild->valdata->after.exposed); } if (pChild->firstChild) { @@ -364,20 +364,20 @@ miComputeClips ( * We translate the old clipList because that will be exposed or copied * if gravity is right. */ - REGION_TRANSLATE( pScreen, &pParent->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pParent->clipList, dx, dy); + RegionTranslate(&pParent->borderClip, dx, dy); + RegionTranslate(&pParent->clipList, dx, dy); } break; case VTBroken: - REGION_EMPTY (pScreen, &pParent->borderClip); - REGION_EMPTY (pScreen, &pParent->clipList); + RegionEmpty(&pParent->borderClip); + RegionEmpty(&pParent->clipList); break; } borderVisible = pParent->valdata->before.borderVisible; resized = pParent->valdata->before.resized; - REGION_NULL(pScreen, &pParent->valdata->after.borderExposed); - REGION_NULL(pScreen, &pParent->valdata->after.exposed); + RegionNull(&pParent->valdata->after.borderExposed); + RegionNull(&pParent->valdata->after.exposed); /* * Since the borderClip must not be clipped by the children, we do @@ -397,22 +397,22 @@ miComputeClips ( * of the border will be saved by DIX in borderVisible -- * use that region and destroy it */ - REGION_SUBTRACT( pScreen, exposed, universe, borderVisible); - REGION_DESTROY( pScreen, borderVisible); + RegionSubtract(exposed, universe, borderVisible); + RegionDestroy(borderVisible); } else { - REGION_SUBTRACT( pScreen, exposed, universe, &pParent->borderClip); + RegionSubtract(exposed, universe, &pParent->borderClip); } if (HasParentRelativeBorder(pParent) && (dx || dy)) - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, + RegionSubtract(&pParent->valdata->after.borderExposed, universe, &pParent->winSize); else - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, + RegionSubtract(&pParent->valdata->after.borderExposed, exposed, &pParent->winSize); - REGION_COPY( pScreen, &pParent->borderClip, universe); + RegionCopy(&pParent->borderClip, universe); /* * To get the right clipList for the parent, and to make doubly sure @@ -420,15 +420,15 @@ miComputeClips ( * border from the universe before proceeding. */ - REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize); + RegionIntersect(universe, universe, &pParent->winSize); } else - REGION_COPY( pScreen, &pParent->borderClip, universe); + RegionCopy(&pParent->borderClip, universe); if ((pChild = pParent->firstChild) && pParent->mapped) { - REGION_NULL(pScreen, &childUniverse); - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUniverse); + RegionNull(&childUnion); if ((pChild->drawable.y < pParent->lastChild->drawable.y) || ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) @@ -436,7 +436,7 @@ miComputeClips ( for (; pChild; pChild = pChild->nextSib) { if (pChild->viewable) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); + RegionAppend(&childUnion, &pChild->borderSize); } } else @@ -444,10 +444,10 @@ miComputeClips ( for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib) { if (pChild->viewable) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); + RegionAppend(&childUnion, &pChild->borderSize); } } - REGION_VALIDATE( pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); for (pChild = pParent->firstChild; pChild; @@ -464,7 +464,7 @@ miComputeClips ( * Figure out the new universe from the child's * perspective and recurse. */ - REGION_INTERSECT( pScreen, &childUniverse, + RegionIntersect(&childUniverse, universe, &pChild->borderSize); miComputeClips (pChild, pScreen, &childUniverse, kind, @@ -476,14 +476,14 @@ miComputeClips ( * other sibling. */ if (overlap) - REGION_SUBTRACT( pScreen, universe, universe, + RegionSubtract(universe, universe, &pChild->borderSize); } } if (!overlap) - REGION_SUBTRACT( pScreen, universe, universe, &childUnion); - REGION_UNINIT( pScreen, &childUnion); - REGION_UNINIT( pScreen, &childUniverse); + RegionSubtract(universe, universe, &childUnion); + RegionUninit(&childUnion); + RegionUninit(&childUniverse); } /* if any children */ /* @@ -496,12 +496,12 @@ miComputeClips ( if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { - REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe); + RegionCopy(&pParent->valdata->after.exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed, + RegionSubtract(&pParent->valdata->after.exposed, universe, &pParent->clipList); } @@ -513,7 +513,7 @@ miComputeClips ( */ if (pParent->backStorage && !resized) { - REGION_SUBTRACT( pScreen, exposed, &pParent->clipList, universe); + RegionSubtract(exposed, &pParent->clipList, universe); (* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy); } @@ -527,7 +527,7 @@ miComputeClips ( } #ifdef NOTDEF - REGION_COPY( pScreen, &pParent->clipList, universe); + RegionCopy(&pParent->clipList, universe); #endif pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -622,8 +622,8 @@ miValidateTree (pParent, pChild, kind) if (pChild == NullWindow) pChild = pParent->firstChild; - REGION_NULL(pScreen, &childClip); - REGION_NULL(pScreen, &exposed); + RegionNull(&childClip); + RegionNull(&exposed); /* * compute the area of the parent window occupied @@ -631,10 +631,10 @@ miValidateTree (pParent, pChild, kind) * is the area which can be divied up among the marked * children in their new configuration. */ - REGION_NULL(pScreen, &totalClip); + RegionNull(&totalClip); viewvals = 0; - if (REGION_BROKEN (pScreen, &pParent->clipList) && - !REGION_BROKEN (pScreen, &pParent->borderClip)) + if (RegionBroken(&pParent->clipList) && + !RegionBroken(&pParent->borderClip)) { kind = VTBroken; /* @@ -642,19 +642,19 @@ miValidateTree (pParent, pChild, kind) * assume everything is busted. */ forward = TRUE; - REGION_COPY (pScreen, &totalClip, &pParent->borderClip); - REGION_INTERSECT (pScreen, &totalClip, &totalClip, &pParent->winSize); + RegionCopy(&totalClip, &pParent->borderClip); + RegionIntersect(&totalClip, &totalClip, &pParent->winSize); for (pWin = pParent->firstChild; pWin != pChild; pWin = pWin->nextSib) { if (pWin->viewable) - REGION_SUBTRACT (pScreen, &totalClip, &totalClip, &pWin->borderSize); + RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } for (pWin = pChild; pWin; pWin = pWin->nextSib) if (pWin->valdata && pWin->viewable) viewvals++; - REGION_EMPTY (pScreen, &pParent->clipList); + RegionEmpty(&pParent->clipList); } else { @@ -672,7 +672,7 @@ miValidateTree (pParent, pChild, kind) if (pWin->redirectDraw && miGetRedirectBorderClipProc) pBorderClip = (*miGetRedirectBorderClipProc)(pWin); #endif - REGION_APPEND( pScreen, &totalClip, pBorderClip ); + RegionAppend(&totalClip, pBorderClip ); if (pWin->viewable) viewvals++; } @@ -691,7 +691,7 @@ miValidateTree (pParent, pChild, kind) if (pWin->redirectDraw && miGetRedirectBorderClipProc) pBorderClip = (*miGetRedirectBorderClipProc)(pWin); #endif - REGION_APPEND( pScreen, &totalClip, pBorderClip ); + RegionAppend(&totalClip, pBorderClip ); if (pWin->viewable) viewvals++; } @@ -700,7 +700,7 @@ miValidateTree (pParent, pChild, kind) pWin = pWin->prevSib; } } - REGION_VALIDATE( pScreen, &totalClip, &overlap); + RegionValidate(&totalClip, &overlap); } /* @@ -713,7 +713,7 @@ miValidateTree (pParent, pChild, kind) overlap = TRUE; if (kind != VTStack) { - REGION_UNION( pScreen, &totalClip, &totalClip, &pParent->clipList); + RegionUnion(&totalClip, &totalClip, &pParent->clipList); if (viewvals > 1) { /* @@ -723,12 +723,12 @@ miValidateTree (pParent, pChild, kind) * lower than the cost of multiple Subtracts in the * loop below. */ - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUnion); if (forward) { for (pWin = pChild; pWin; pWin = pWin->nextSib) if (pWin->valdata && pWin->viewable) - REGION_APPEND( pScreen, &childUnion, + RegionAppend(&childUnion, &pWin->borderSize); } else @@ -737,16 +737,16 @@ miValidateTree (pParent, pChild, kind) while (1) { if (pWin->valdata && pWin->viewable) - REGION_APPEND( pScreen, &childUnion, + RegionAppend(&childUnion, &pWin->borderSize); if (pWin == pChild) break; pWin = pWin->prevSib; } } - REGION_VALIDATE(pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); if (overlap) - REGION_UNINIT(pScreen, &childUnion); + RegionUninit(&childUnion); } } @@ -756,13 +756,13 @@ miValidateTree (pParent, pChild, kind) { if (pWin->viewable) { if (pWin->valdata) { - REGION_INTERSECT( pScreen, &childClip, + RegionIntersect(&childClip, &totalClip, &pWin->borderSize); miComputeClips (pWin, pScreen, &childClip, kind, &exposed); if (overlap) { - REGION_SUBTRACT( pScreen, &totalClip, + RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } @@ -771,24 +771,24 @@ miValidateTree (pParent, pChild, kind) } } else { if (pWin->valdata) { - REGION_EMPTY( pScreen, &pWin->clipList); + RegionEmpty(&pWin->clipList); if (pScreen->ClipNotify) (* pScreen->ClipNotify) (pWin, 0, 0); - REGION_EMPTY( pScreen, &pWin->borderClip); + RegionEmpty(&pWin->borderClip); pWin->valdata = (ValidatePtr)NULL; } } } - REGION_UNINIT( pScreen, &childClip); + RegionUninit(&childClip); if (!overlap) { - REGION_SUBTRACT(pScreen, &totalClip, &totalClip, &childUnion); - REGION_UNINIT(pScreen, &childUnion); + RegionSubtract(&totalClip, &totalClip, &childUnion); + RegionUninit(&childUnion); } - REGION_NULL(pScreen, &pParent->valdata->after.exposed); - REGION_NULL(pScreen, &pParent->valdata->after.borderExposed); + RegionNull(&pParent->valdata->after.exposed); + RegionNull(&pParent->valdata->after.borderExposed); /* * each case below is responsible for updating the @@ -804,22 +804,22 @@ miValidateTree (pParent, pChild, kind) * exposures and obscures as per miComputeClips and reset the parent's * clipList. */ - REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed, + RegionSubtract(&pParent->valdata->after.exposed, &totalClip, &pParent->clipList); /* fall through */ case VTMap: if (pParent->backStorage) { - REGION_SUBTRACT( pScreen, &exposed, &pParent->clipList, &totalClip); + RegionSubtract(&exposed, &pParent->clipList, &totalClip); (* pScreen->SaveDoomedAreas)(pParent, &exposed, 0, 0); } - REGION_COPY( pScreen, &pParent->clipList, &totalClip); + RegionCopy(&pParent->clipList, &totalClip); pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; break; } - REGION_UNINIT( pScreen, &totalClip); - REGION_UNINIT( pScreen, &exposed); + RegionUninit(&totalClip); + RegionUninit(&exposed); if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pParent, 0, 0); return (1); diff --git a/nx-X11/programs/Xserver/mi/miwindow.c b/nx-X11/programs/Xserver/mi/miwindow.c index 44b7ada60..198f765dd 100644 --- a/nx-X11/programs/Xserver/mi/miwindow.c +++ b/nx-X11/programs/Xserver/mi/miwindow.c @@ -114,7 +114,7 @@ miClearToBackground(pWin, x, y, w, h, generateExposures) box.y2 = y2; pScreen = pWin->drawable.pScreen; - REGION_INIT(pScreen, ®, &box, 1); + RegionInit(®, &box, 1); if (pWin->backStorage) { /* @@ -128,14 +128,14 @@ miClearToBackground(pWin, x, y, w, h, generateExposures) generateExposures); } - REGION_INTERSECT(pScreen, ®, ®, &pWin->clipList); + RegionIntersect(®, ®, &pWin->clipList); if (generateExposures) (*pScreen->WindowExposures)(pWin, ®, pBSReg); else if (pWin->backgroundState != None) (*pScreen->PaintWindowBackground)(pWin, ®, PW_BACKGROUND); - REGION_UNINIT(pScreen, ®); + RegionUninit(®); if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); + RegionDestroy(pBSReg); } /* @@ -181,7 +181,7 @@ miCheckSubSaveUnder( for (; pChild != pFirst; pChild = pChild->nextSib) if (pChild->viewable && pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); + RegionUnion(pRegion, pRegion, &pChild->borderSize); /* * check region below and including first changed window @@ -200,10 +200,10 @@ miCheckSubSaveUnder( { if (!subInited) { - REGION_NULL(pScreen, &SubRegion); + RegionNull(&SubRegion); subInited = TRUE; } - REGION_COPY(pScreen, &SubRegion, pRegion); + RegionCopy(&SubRegion, pRegion); res |= miCheckSubSaveUnder(pChild, pChild->firstChild, &SubRegion); } @@ -214,12 +214,12 @@ miCheckSubSaveUnder( } if (pChild->saveUnder) - REGION_UNION(pScreen, pRegion, pRegion, &pChild->borderSize); + RegionUnion(pRegion, pRegion, &pChild->borderSize); } } if (subInited) - REGION_UNINIT(pScreen, &SubRegion); + RegionUninit(&SubRegion); } /* @@ -230,8 +230,8 @@ miCheckSubSaveUnder( if (pParent->viewable && ((pParent->eventMask | wOtherEventMasks(pParent)) & ExposureMask) && - REGION_NOTEMPTY(pScreen, &pParent->borderSize) && - RECT_IN_REGION(pScreen, pRegion, REGION_EXTENTS(pScreen, + RegionNotEmpty(&pParent->borderSize) && + RegionContainsRect(pRegion, RegionExtents( &pParent->borderSize)) != rgnOUT) { if (!pParent->DIXsaveUnder) @@ -283,11 +283,11 @@ miChangeSaveUnder(pWin, first) numSaveUndersViewable += deltaSaveUndersViewable; deltaSaveUndersViewable = 0; pScreen = pWin->drawable.pScreen; - REGION_NULL(pScreen, &rgn); + RegionNull(&rgn); res = miCheckSubSaveUnder (pWin->parent, pWin->saveUnder ? first : pWin->nextSib, &rgn); - REGION_UNINIT(pScreen, &rgn); + RegionUninit(&rgn); return res; } @@ -386,9 +386,9 @@ miMarkOverlappedWindows(pWin, pFirst, ppLayerWin) { if (pChild->viewable) { - if (REGION_BROKEN (pScreen, &pChild->winSize)) + if (RegionBroken(&pChild->winSize)) SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) + if (RegionBroken(&pChild->borderSize)) SetBorderSize (pChild); (* MarkWindow)(pChild); if (pChild->firstChild) @@ -408,17 +408,17 @@ miMarkOverlappedWindows(pWin, pFirst, ppLayerWin) } if ( (pChild = pFirst) ) { - box = REGION_EXTENTS(pChild->drawable.pScreen, &pWin->borderSize); + box = RegionExtents(&pWin->borderSize); pLast = pChild->parent->lastChild; while (1) { if (pChild->viewable) { - if (REGION_BROKEN (pScreen, &pChild->winSize)) + if (RegionBroken(&pChild->winSize)) SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) + if (RegionBroken(&pChild->borderSize)) SetBorderSize (pChild); - if (RECT_IN_REGION(pScreen, &pChild->borderSize, box)) + if (RegionContainsRect(&pChild->borderSize, box)) { (* MarkWindow)(pChild); anyMarked = TRUE; @@ -464,13 +464,13 @@ miHandleValidateExposures(pWin) { if ( (val = pChild->valdata) ) { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) + if (RegionNotEmpty(&val->after.borderExposed)) (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, &val->after.borderExposed, PW_BORDER); - REGION_UNINIT(pScreen, &val->after.borderExposed); + RegionUninit(&val->after.borderExposed); (*WindowExposures)(pChild, &val->after.exposed, NullRegion); - REGION_UNINIT(pScreen, &val->after.exposed); + RegionUninit(&val->after.exposed); xfree(val); pChild->valdata = (ValidatePtr)NULL; if (pChild->firstChild) @@ -517,8 +517,8 @@ miMoveWindow(pWin, x, y, pNextSib, kind) oldpt.y = pWin->drawable.y; if (WasViewable) { - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->borderClip); + oldRegion = RegionCreate(NullBox, 1); + RegionCopy(oldRegion, &pWin->borderClip); anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); } pWin->origin.x = x + (int)bw; @@ -555,7 +555,7 @@ miMoveWindow(pWin, x, y, pNextSib, kind) { (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, kind); (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, oldRegion); - REGION_DESTROY(pScreen, oldRegion); + RegionDestroy(oldRegion); /* XXX need to retile border if ParentRelative origin */ (*pScreen->HandleExposures)(pLayerWin->parent); } @@ -590,14 +590,14 @@ miRecomputeExposures ( /* * compute exposed regions of this window */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->clipList, pValid); /* * compute exposed regions of the border */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, + RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, + RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->valdata->after.borderExposed, pValid); return WT_WALKCHILDREN; } @@ -654,8 +654,8 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) /* * save the visible region of the window */ - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->winSize); + oldRegion = RegionCreate(NullBox, 1); + RegionCopy(oldRegion, &pWin->winSize); /* * categorize child windows into regions to be moved @@ -668,8 +668,8 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) if (g != UnmapGravity) { if (!gravitate[g]) - gravitate[g] = REGION_CREATE(pScreen, NullBox, 1); - REGION_UNION(pScreen, gravitate[g], + gravitate[g] = RegionCreate(NullBox, 1); + RegionUnion(gravitate[g], gravitate[g], &pChild->borderClip); } else @@ -684,8 +684,8 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) oldWinClip = NULL; if (pWin->bitGravity != ForgetGravity) { - oldWinClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip, &pWin->clipList); + oldWinClip = RegionCreate(NullBox, 1); + RegionCopy(oldWinClip, &pWin->clipList); } /* * if the window is changing size, borderExposed @@ -700,16 +700,16 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) if ((pWin->drawable.height != h || pWin->drawable.width != w) && HasBorder (pWin)) { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); + borderVisible = RegionCreate(NullBox, 1); /* for tiled borders, we punt and draw the whole thing */ if (pWin->borderIsPixel || !moved) { if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); else - REGION_COPY(pScreen, borderVisible, + RegionCopy(borderVisible, &pWin->borderClip); } } @@ -736,9 +736,9 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) if (WasViewable) { - pRegion = REGION_CREATE(pScreen, NullBox, 1); + pRegion = RegionCreate(NullBox, 1); if (pWin->backStorage) - REGION_COPY(pScreen, pRegion, &pWin->clipList); + RegionCopy(pRegion, &pWin->clipList); if (pLayerWin == pWin) anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, @@ -766,7 +766,7 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) * the entire window is trashed unless bitGravity * recovers portions of it */ - REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList); + RegionCopy(&pWin->valdata->after.exposed, &pWin->clipList); } GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); @@ -810,16 +810,16 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) dy = (oldy - ny) - offy; if (dx || dy) { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); + RegionTranslate(&pWin->winSize, dx, dy); offx += dx; offy += dy; } - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], + RegionIntersect(gravitate[g], gravitate[g], &pWin->winSize); } /* get winSize back where it belongs */ if (offx || offy) - REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy); + RegionTranslate(&pWin->winSize, -offx, -offy); } /* * add screen bits to the appropriate bucket @@ -830,9 +830,9 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) /* * clip to new clipList */ - REGION_COPY(pScreen, pRegion, oldWinClip); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList); + RegionCopy(pRegion, oldWinClip); + RegionTranslate(pRegion, nx - oldx, ny - oldy); + RegionIntersect(oldWinClip, pRegion, &pWin->clipList); /* * don't step on any gravity bits which will be copied after this * region. Note -- this assumes that the regions will be copied @@ -841,17 +841,17 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate[g]) - REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip, + RegionSubtract(oldWinClip, oldWinClip, gravitate[g]); } - REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny); + RegionTranslate(oldWinClip, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate[g]) gravitate[g] = oldWinClip; else { - REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip); - REGION_DESTROY(pScreen, oldWinClip); + RegionUnion(gravitate[g], gravitate[g], oldWinClip); + RegionDestroy(oldWinClip); } } @@ -875,14 +875,14 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) /* only copy the remaining useful bits */ - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], oldRegion); + RegionIntersect(gravitate[g], gravitate[g], oldRegion); /* clip to not overwrite already copied areas */ if (destClip) { - REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip); - REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y); + RegionTranslate(destClip, oldpt.x - x, oldpt.y - y); + RegionSubtract(gravitate[g], gravitate[g], destClip); + RegionTranslate(destClip, x - oldpt.x, y - oldpt.y); } /* and move those bits */ @@ -898,7 +898,7 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) /* remove any overwritten bits from the remaining useful bits */ - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); + RegionSubtract(oldRegion, oldRegion, gravitate[g]); /* * recompute exposed regions of child windows @@ -908,7 +908,7 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) { if (pChild->winGravity != g) continue; - REGION_INTERSECT(pScreen, pRegion, + RegionIntersect(pRegion, &pChild->borderClip, gravitate[g]); TraverseTree (pChild, miRecomputeExposures, (void *)pRegion); } @@ -919,21 +919,21 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) */ if (g == pWin->bitGravity) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->valdata->after.exposed, gravitate[g]); if (!destClip) destClip = gravitate[g]; else { - REGION_UNION(pScreen, destClip, destClip, gravitate[g]); - REGION_DESTROY(pScreen, gravitate[g]); + RegionUnion(destClip, destClip, gravitate[g]); + RegionDestroy(gravitate[g]); } } - REGION_DESTROY(pScreen, oldRegion); - REGION_DESTROY(pScreen, pRegion); + RegionDestroy(oldRegion); + RegionDestroy(pRegion); if (destClip) - REGION_DESTROY(pScreen, destClip); + RegionDestroy(destClip); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -942,8 +942,8 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) valExposed = &pWin->valdata->after.exposed; (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionEmpty(valExposed); + RegionDestroy(bsExposed); } if (anyMarked) (*pScreen->HandleExposures)(pLayerWin->parent); @@ -960,7 +960,7 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) else if (bsExposed) { (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionDestroy(bsExposed); } if (pWin->realized) WindowsRestructured (); @@ -1004,8 +1004,8 @@ miSetShape(pWin) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NullBox, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } @@ -1022,8 +1022,8 @@ miSetShape(pWin) { if (pWin->backStorage) { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); + pOldClip = RegionCreate(NullBox, 1); + RegionCopy(pOldClip, &pWin->clipList); } anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, @@ -1049,7 +1049,7 @@ miSetShape(pWin) (pWin, 0, 0, pOldClip, pWin->drawable.x, pWin->drawable.y); if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); + RegionDestroy(pOldClip); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -1058,8 +1058,8 @@ miSetShape(pWin) valExposed = &pWin->valdata->after.exposed; (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionEmpty(valExposed); + RegionDestroy(bsExposed); } } if (WasViewable) @@ -1120,8 +1120,8 @@ miChangeBorderWidth(pWin, width) if (pWin->valdata && HadBorder) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NULL, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } @@ -1158,10 +1158,10 @@ miMarkUnrealizedWindow(pChild, pWin, fromConfigure) { if ((pChild != pWin) || fromConfigure) { - REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList); + RegionEmpty(&pChild->clipList); if (pChild->drawable.pScreen->ClipNotify) (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0); - REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip); + RegionEmpty(&pChild->borderClip); } } @@ -1176,7 +1176,7 @@ miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->drawable.depth == depth) - REGION_UNION(pScreen, pReg, pReg, &pChild->borderClip); + RegionUnion(pReg, pReg, &pChild->borderClip); if (pChild->firstChild) miSegregateChildren(pChild, pReg, depth); |