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/hw | |
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/hw')
18 files changed, 637 insertions, 637 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 34781e816..7fa984eee 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -47,7 +47,7 @@ /* * The list of rectangles composing a region * s returned by nxagentGetOptimizedRegion- - * Boxes() instead of REGION_RECTS(). + * Boxes() instead of RegionRects(). */ #define USE_OPTIMIZED_BOXES @@ -412,10 +412,10 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned clipRegion = NullRegion; #ifdef COLLECTED_UPDATES - REGION_INIT(pDrawable -> pScreen, &collectedUpdates, NullBox, 1); + RegionInit(&collectedUpdates, NullBox, 1); #endif - REGION_INIT(pDrawable -> pScreen, &exposeRegion, NullBox, 1); + RegionInit(&exposeRegion, NullBox, 1); if (nxagentDrawableBitmap(pDrawable) != NullPixmap && nxagentDrawableStatus((DrawablePtr) nxagentDrawableBitmap(pDrawable)) == Synchronized) @@ -447,7 +447,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2, - REGION_NUM_RECTS(nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)))); + RegionNumRects(nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)))); #endif clipRegion = nxagentCreateRegion(pDrawable, NULL, 0, 0, pDrawable -> width, pDrawable -> height); @@ -458,7 +458,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * a previous loop. */ - REGION_INTERSECT(pDrawable -> pScreen, clipRegion, clipRegion, + RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable))); /* @@ -470,14 +470,14 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * ronization will fix the error. */ - REGION_INTERSECT(pDrawable -> pScreen, clipRegion, clipRegion, + RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable)); /* * The bitmap to synchronize is clipped. */ - if (REGION_NIL(clipRegion) == 1) + if (RegionNil(clipRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: The bitmap region [%d,%d,%d,%d] is not viewable. " @@ -499,7 +499,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned } else { - if (pRegion != NullRegion && REGION_NIL(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", @@ -531,9 +531,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * can skip the synchronization. */ - REGION_INTERSECT(pDrawable -> pScreen, clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable)); + RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable)); - if (REGION_NIL(clipRegion) == 1) + if (RegionNil(clipRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: The corrupted region [%d,%d,%d,%d] is not viewable " @@ -554,9 +554,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (pRegion != NullRegion) { - REGION_INTERSECT(pDrawable -> pScreen, clipRegion, clipRegion, pRegion); + RegionIntersect(clipRegion, clipRegion, pRegion); - if (REGION_NIL(clipRegion) == 1) + if (RegionNil(clipRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Region requested [%d,%d,%d,%d] already " @@ -604,7 +604,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Going to synchronize [%ld] rects of [%s] at [%p].\n", - REGION_NUM_RECTS(clipRegion), nxagentDrawableType(pDrawable), (void *) pDrawable); + RegionNumRects(clipRegion), nxagentDrawableType(pDrawable), (void *) pDrawable); fprintf(stderr, "nxagentSynchronizeRegion: Extents geometry [%d,%d,%d,%d].\n", clipRegion -> extents.x1, clipRegion -> extents.y1, clipRegion -> extents.x2, clipRegion -> extents.y2); @@ -648,7 +648,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (length == 0) { fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] with region geometry [%ld][%d,%d,%d,%d].\n", - nxagentDrawableType(pDrawable), (void *) pDrawable, REGION_NUM_RECTS(clipRegion), + nxagentDrawableType(pDrawable), (void *) pDrawable, RegionNumRects(clipRegion), clipRegion -> extents.x1, clipRegion -> extents.y1, clipRegion -> extents.x2, clipRegion -> extents.y2); } @@ -660,7 +660,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned #ifndef USE_OPTIMIZED_BOXES - pBox = REGION_RECTS(clipRegion); + pBox = RegionRects(clipRegion); #else @@ -668,7 +668,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned #endif /* USE_OPTIMIZED_BOXES */ - nBox = REGION_NUM_RECTS(clipRegion); + nBox = RegionNumRects(clipRegion); now = GetTimeInMillis(); @@ -794,12 +794,12 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * region. */ - REGION_INIT(pDrawable -> pScreen, &tileRegion, &tileBox, 1); + RegionInit(&tileRegion, &tileBox, 1); - REGION_UNION(pDrawable -> pScreen, &exposeRegion, &exposeRegion, &tileRegion); + RegionUnion(&exposeRegion, &exposeRegion, &tileRegion); #ifdef COLLECTED_UPDATES - REGION_APPEND(pDrawable -> pScreen, &collectedUpdates, &tileRegion); + RegionAppend(&collectedUpdates, &tileRegion); #endif if (useStoredBitmap != 0) @@ -812,7 +812,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * associated to this pixmap. */ - REGION_SUBTRACT(pDrawable -> pScreen, nxagentPixmapCorruptedRegion(nxagentDrawableBitmap(pDrawable)), + RegionSubtract(nxagentPixmapCorruptedRegion(nxagentDrawableBitmap(pDrawable)), nxagentPixmapCorruptedRegion(nxagentDrawableBitmap(pDrawable)), &tileRegion); /* @@ -875,7 +875,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned (void *) nxagentDrawableBitmap(pDrawable)); #endif - REGION_SUBTRACT(pDrawable -> pScreen, nxagentPixmapCorruptedRegion(nxagentDrawableBitmap(pDrawable)), + RegionSubtract(nxagentPixmapCorruptedRegion(nxagentDrawableBitmap(pDrawable)), nxagentPixmapCorruptedRegion(nxagentDrawableBitmap(pDrawable)), &tileRegion); } } @@ -888,7 +888,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentRealizeImage(pDrawable, pGC, pDrawable -> depth, x, y, w, h, leftPad, format, data); - REGION_UNINIT(pDrawable -> pScreen, &tileRegion); + RegionUninit(&tileRegion); #if !defined(COLLECTED_UPDATES) @@ -990,7 +990,7 @@ nxagentSynchronizeRegionStop: if (pDrawable -> type == DRAWABLE_PIXMAP && nxagentIsCorruptedBackground((PixmapPtr) pDrawable) == 1 && - REGION_NIL(&exposeRegion) == 0) + RegionNil(&exposeRegion) == 0) { struct nxagentExposeBackground eb; @@ -1016,14 +1016,14 @@ nxagentSynchronizeRegionStop: { int overlap = 0; - REGION_VALIDATE(pDrawable -> pScreen, &collectedUpdates, &overlap); + RegionValidate(&collectedUpdates, &overlap); - for (i = 0; i < REGION_NUM_RECTS(&collectedUpdates); i++) + for (i = 0; i < RegionNumRects(&collectedUpdates); i++) { - x = REGION_RECTS(&collectedUpdates)[i].x1; - y = REGION_RECTS(&collectedUpdates)[i].y1; - w = REGION_RECTS(&collectedUpdates)[i].x2 - REGION_RECTS(&collectedUpdates)[i].x1; - h = REGION_RECTS(&collectedUpdates)[i].y2 - REGION_RECTS(&collectedUpdates)[i].y1; + x = RegionRects(&collectedUpdates)[i].x1; + y = RegionRects(&collectedUpdates)[i].y1; + w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1; + h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1; if (nxagentOption(Shadow) == 1 && (nxagentOption(XRatio) != DONT_SCALE || @@ -1063,11 +1063,11 @@ nxagentSynchronizeRegionFree: xfree(data); } - REGION_UNINIT(pDrawable -> pScreen, &exposeRegion); + RegionUninit(&exposeRegion); #ifdef COLLECTED_UPDATES - REGION_UNINIT(pDrawable -> pScreen, &collectedUpdates); + RegionUninit(&collectedUpdates); #endif /* #ifdef COLLECTED_UPDATES */ @@ -1108,7 +1108,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea pBox -> x2 - pBox -> x1, pBox -> y2 - pBox -> y1); - if (REGION_NIL(pRegion) == 1) + if (RegionNil(pRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeBox: Resulting region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", @@ -1273,7 +1273,7 @@ FIXME: This condition sounds only as a "with [%ld] rects.\n", nxagentCorruptedRegion(pDrawable) -> extents.x1, nxagentCorruptedRegion(pDrawable) -> extents.y1, nxagentCorruptedRegion(pDrawable) -> extents.x2, nxagentCorruptedRegion(pDrawable) -> extents.y2, - REGION_NUM_RECTS(nxagentCorruptedRegion(pDrawable))); + RegionNumRects(nxagentCorruptedRegion(pDrawable))); #endif /* @@ -1518,7 +1518,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, box.x2 = x + width; box.y2 = y + height; - pRegion = REGION_CREATE(pDrawable -> pScreen, &box, 1); + pRegion = RegionCreate(&box, 1); /* * Clipping the region. @@ -1543,11 +1543,11 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, tmpBox.x2 = pDrawable -> width; tmpBox.y2 = pDrawable -> height; - REGION_INIT(pDrawable -> pScreen, &tmpRegion, &tmpBox, 1); + RegionInit(&tmpRegion, &tmpBox, 1); - REGION_INTERSECT(pDrawable -> pScreen, pRegion, &tmpRegion, pRegion); + RegionIntersect(pRegion, &tmpRegion, pRegion); - REGION_UNINIT(pDrawable -> pScreen, &tmpRegion); + RegionUninit(&tmpRegion); } } else @@ -1558,19 +1558,19 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, * by its children. */ - REGION_TRANSLATE(pDrawable -> pScreen, pRegion, + RegionTranslate(pRegion, pDrawable -> x, pDrawable -> y); if (nxagentWindowPriv((WindowPtr) pDrawable) -> hasTransparentChildren == 1) { - REGION_INTERSECT(pDrawable -> pScreen, pRegion, pRegion, &((WindowPtr) pDrawable) -> borderClip); + RegionIntersect(pRegion, pRegion, &((WindowPtr) pDrawable) -> borderClip); } else { - REGION_INTERSECT(pDrawable -> pScreen, pRegion, pRegion, &((WindowPtr) pDrawable) -> clipList); + RegionIntersect(pRegion, pRegion, &((WindowPtr) pDrawable) -> clipList); } - REGION_TRANSLATE(pDrawable -> pScreen, pRegion, + RegionTranslate(pRegion, -pDrawable -> x, -pDrawable -> y); } @@ -1585,15 +1585,15 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, * to intersect it with the GC's clipmask. */ - if (REGION_NIL(pRegion) == 0 && + if (RegionNil(pRegion) == 0 && pGC != NULL && pGC -> clientClip != NULL && pGC -> clientClipType == CT_REGION) { RegionRec clipRegion; - REGION_INIT(pDrawable -> pScreen, &clipRegion, NullBox, 1); + RegionInit(&clipRegion, NullBox, 1); - REGION_COPY(pDrawable -> pScreen, &clipRegion, (RegionPtr) pGC -> clientClip); + RegionCopy(&clipRegion, (RegionPtr) pGC -> clientClip); /* * The clip origin is relative to the origin of @@ -1603,7 +1603,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, if (pGC -> clipOrg.x != 0 || pGC -> clipOrg.y != 0) { - REGION_TRANSLATE(pDrawable -> pScreen, &clipRegion, pGC -> clipOrg.x, pGC -> clipOrg.y); + RegionTranslate(&clipRegion, pGC -> clipOrg.x, pGC -> clipOrg.y); } #ifdef TEST @@ -1612,9 +1612,9 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, clipRegion.extents.x2, clipRegion.extents.y2); #endif - REGION_INTERSECT(pDrawable -> pScreen, pRegion, pRegion, &clipRegion); + RegionIntersect(pRegion, pRegion, &clipRegion); - REGION_UNINIT(pDrawable -> pScreen, &clipRegion); + RegionUninit(&clipRegion); } return pRegion; @@ -1627,7 +1627,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) int width; int height; - if (pRegion != NullRegion && REGION_NIL(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentMarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", @@ -1672,7 +1672,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) nxagentValidateSplit(pDrawable, pRegion); - REGION_UNION(pDrawable -> pScreen, nxagentCorruptedRegion(pDrawable), + RegionUnion(nxagentCorruptedRegion(pDrawable), nxagentCorruptedRegion(pDrawable), pRegion); nxagentFreeRegion(pDrawable, pRegion); @@ -1695,7 +1695,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) nxagentValidateSplit(pDrawable, pRegion); - REGION_UNION(pDrawable -> pScreen, nxagentCorruptedRegion(pDrawable), + RegionUnion(nxagentCorruptedRegion(pDrawable), nxagentCorruptedRegion(pDrawable), pRegion); } } @@ -1704,7 +1704,7 @@ void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) { int oldStatus; - if (pRegion != NullRegion && REGION_NIL(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentUnmarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", @@ -1735,7 +1735,7 @@ void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) nxagentValidateSplit(pDrawable, NULL); - REGION_EMPTY(pDrawable -> pScreen, nxagentCorruptedRegion(pDrawable)); + RegionEmpty(nxagentCorruptedRegion(pDrawable)); } else { @@ -1749,7 +1749,7 @@ void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) nxagentValidateSplit(pDrawable, pRegion); - REGION_SUBTRACT(pDrawable -> pScreen, nxagentCorruptedRegion(pDrawable), + RegionSubtract(nxagentCorruptedRegion(pDrawable), nxagentCorruptedRegion(pDrawable), pRegion); } @@ -1817,7 +1817,7 @@ void nxagentMoveCorruptedRegion(WindowPtr pWin, unsigned int mask) nx, ny, (void *) pWin); #endif - REGION_TRANSLATE(pWin -> pScreen, nxagentCorruptedRegion((DrawablePtr) pWin), + RegionTranslate(nxagentCorruptedRegion((DrawablePtr) pWin), nx, ny); /* @@ -1886,9 +1886,9 @@ BoxPtr nxagentGetOptimizedRegionBoxes(RegionPtr pRegion) int nBoxOptim; #endif - pBox = REGION_RECTS(pRegion); + pBox = RegionRects(pRegion); - nBox = REGION_NUM_RECTS(pRegion); + nBox = RegionNumRects(pRegion); #ifdef TEST fprintf(stderr, "nxagentGetOptimizedRegionBoxes: Going to optimize region at [%p] with [%d] rects.\n", @@ -2183,7 +2183,7 @@ unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion) { int xPicker, yPicker; - if (REGION_NIL(pRegion) == 1) + if (RegionNil(pRegion) == 1) { return nxagentGetDrawableColor(pDrawable); } @@ -2251,7 +2251,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) return; } - if (pRegion == NullRegion || REGION_NIL(pRegion) == 1) + if (pRegion == NullRegion || RegionNil(pRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentClearRegion: The region is empty. Exiting.\n"); @@ -2306,7 +2306,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) pBox = nxagentGetOptimizedRegionBoxes(pRegion); - nBox = REGION_NUM_RECTS(pRegion); + nBox = RegionNumRects(pRegion); for (i = 0; i < nBox; i++) { @@ -2348,14 +2348,14 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) int nrects; int i; - if (REGION_NIL(pRegion) == 1) + if (RegionNil(pRegion) == 1) { return; } pGC = nxagentGetGraphicContext(pDrawable); - nrects = REGION_NUM_RECTS(pRegion); + nrects = RegionNumRects(pRegion); #ifdef TEST fprintf(stderr, "nxagentFillRemoteRegion: Going to fill remote region [%d,%d,%d,%d] rects [%d] with color [%lu].\n", @@ -2372,7 +2372,7 @@ void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) } else { - pBox = REGION_RECTS(pRegion); + pBox = RegionRects(pRegion); pRects = xalloc(nrects * sizeof(XRectangle)); @@ -2440,7 +2440,7 @@ void nxagentPointsToDirtyRegion(DrawablePtr pDrawable, int mode, np = nPoints; xp = pPoints; - pRegion = REGION_CREATE(pDrawable -> pScreen, NullBox, 1); + pRegion = RegionCreate(NullBox, 1); while (np--) { @@ -2465,28 +2465,28 @@ void nxagentPointsToDirtyRegion(DrawablePtr pDrawable, int mode, * this loop could become less expensive. */ - REGION_INIT(pDrawable -> pScreen, &tmpRegion, &box, 1); + RegionInit(&tmpRegion, &box, 1); - REGION_UNION(pDrawable -> pScreen, pRegion, pRegion, &tmpRegion); + RegionUnion(pRegion, pRegion, &tmpRegion); - REGION_UNINIT(pDrawable -> pScreen, &tmpRegion); + RegionUninit(&tmpRegion); xp++; } - extents = *REGION_EXTENTS(pDrawable -> pScreen, pRegion); + extents = *RegionExtents(pRegion); - REGION_RESET(pDrawable -> pScreen, pRegion, &extents); + RegionReset(pRegion, &extents); #ifdef TEST fprintf(stderr, "nxagentPointsToDirtyRegion: The resulting dirty region has [%ld] rects and" - " extents (%d,%d,%d,%d).\n", REGION_NUM_RECTS(pRegion), extents.x1, + " extents (%d,%d,%d,%d).\n", RegionNumRects(pRegion), extents.x1, extents.y1, extents.x2, extents.y2); #endif nxagentMarkCorruptedRegion(pDrawable, pRegion); - REGION_DESTROY(pDrawable -> pScreen, pRegion); + RegionDestroy(pRegion); } #ifdef DUMP @@ -2533,20 +2533,20 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) clipRegion = nxagentCreateRegion((DrawablePtr) pWin, NULL, 0, 0, pWin -> drawable.width, pWin -> drawable.height); - REGION_INIT(pWin -> drawable.pScreen, &visRegion, NullBox, 1); + RegionInit(&visRegion, NullBox, 1); - REGION_INTERSECT(pWin -> drawable.pScreen, &visRegion, clipRegion, nxagentCorruptedRegion((DrawablePtr) pWin)); + RegionIntersect(&visRegion, clipRegion, nxagentCorruptedRegion((DrawablePtr) pWin)); nxagentFreeRegion(pWin -> drawable.pScreen, clipRegion); - if (REGION_NIL(&visRegion) == 1) + if (RegionNil(&visRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentCorruptedRegionOnWindow: The corrupted region of window at [%p] is hidden.\n", (void *) pWin); #endif - REGION_UNINIT(pWin -> drawable.pScreen, &visRegion); + RegionUninit(&visRegion); return; } @@ -2569,7 +2569,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) gc = XCreateGC(nxagentDisplay, nxagentWindow(pWin), GCForeground | GCSubwindowMode, &value); - nrectangles = REGION_NUM_RECTS(&visRegion); + nrectangles = RegionNumRects(&visRegion); #ifdef TEST fprintf(stderr, "nxagentCorruptedRegionOnWindow: Going to draw the region with extents [%d,%d,%d,%d] and [%d] rects.\n", @@ -2594,7 +2594,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) XFreeGC(nxagentDisplay, gc); - REGION_UNINIT(pWin -> drawable.pScreen, &visRegion); + RegionUninit(&visRegion); } void nxagentRegionsOnScreen() @@ -2673,9 +2673,9 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) pClipRegion = nxagentCreateRegion(pDrawable, NULL, 0, 0, pDrawable -> width, pDrawable -> height); - REGION_INTERSECT(pDrawable -> pScreen, pClipRegion, pClipRegion, nxagentCorruptedRegion(pDrawable)); + RegionIntersect(pClipRegion, pClipRegion, nxagentCorruptedRegion(pDrawable)); - if (REGION_NIL(pClipRegion) == 1) + if (RegionNil(pClipRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentCreateDrawableBitmap: The corrupted region is not visible. Skipping bitmap creation.\n"); @@ -2716,7 +2716,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) nxagentCopyArea(pDrawable, (DrawablePtr) pBitmap, pGC, x, y, w, h, x, y); - REGION_UNION(pDrawable -> pScreen, nxagentCorruptedRegion((DrawablePtr) pBitmap), + RegionUnion(nxagentCorruptedRegion((DrawablePtr) pBitmap), nxagentCorruptedRegion((DrawablePtr) pBitmap), pClipRegion); if (pDrawable -> type == DRAWABLE_PIXMAP) @@ -3002,19 +3002,19 @@ void nxagentUnmarkExposedRegion(WindowPtr pWin, RegionPtr pRegion, RegionPtr pOt { RegionRec clipRegion; - if (pRegion != NullRegion && REGION_NIL(pRegion) == 0 && + if (pRegion != NullRegion && RegionNil(pRegion) == 0 && nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized) { - REGION_INIT(pWin -> drawable.pScreen, &clipRegion, NullBox, 1); + RegionInit(&clipRegion, NullBox, 1); - REGION_COPY(pWin -> drawable.pScreen, &clipRegion, pRegion); + RegionCopy(&clipRegion, pRegion); - if (pOther != NullRegion && REGION_NIL(pOther) == 0) + if (pOther != NullRegion && RegionNil(pOther) == 0) { - REGION_UNION(pWin -> drawable.pScreen, &clipRegion, &clipRegion, pOther); + RegionUnion(&clipRegion, &clipRegion, pOther); } - REGION_TRANSLATE(pWin -> drawable.pScreen, &clipRegion, -pWin -> drawable.x, -pWin -> drawable.y); + RegionTranslate(&clipRegion, -pWin -> drawable.x, -pWin -> drawable.y); #ifdef TEST fprintf(stderr, "nxagentUnmarkExposedRegion: Validating expose region [%d,%d,%d,%d] " @@ -3024,7 +3024,7 @@ void nxagentUnmarkExposedRegion(WindowPtr pWin, RegionPtr pRegion, RegionPtr pOt nxagentUnmarkCorruptedRegion((DrawablePtr) pWin, &clipRegion); - REGION_UNINIT(pWin -> drawable.pScreen, &clipRegion); + RegionUninit(&clipRegion); } } @@ -3061,7 +3061,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt RegionRec expose; miBSWindowPtr pBackingStore; - REGION_INIT(pWin -> pScreen, &expose, NullBox, 1); + RegionInit(&expose, NullBox, 1); #ifdef DEBUG fprintf(stderr, "nxagentSendBackgroundExpose: Original expose region is [%d,%d,%d,%d].\n", @@ -3084,25 +3084,25 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt pWin -> drawable.width, pWin -> drawable.height); #endif - REGION_COPY(pWin -> pScreen, &expose, &pWin -> winSize); + RegionCopy(&expose, &pWin -> winSize); } else { - REGION_COPY(pWin -> pScreen, &expose, pExpose); + RegionCopy(&expose, pExpose); - REGION_TRANSLATE(pWin -> pScreen, &expose, pWin -> drawable.x, pWin -> drawable.y); + RegionTranslate(&expose, pWin -> drawable.x, pWin -> drawable.y); } - REGION_SUBTRACT(pWin -> pScreen, &expose, &expose, nxagentCorruptedRegion((DrawablePtr) pWin)); + RegionSubtract(&expose, &expose, nxagentCorruptedRegion((DrawablePtr) pWin)); - if (REGION_NIL(&pWin -> clipList) != 0) + if (RegionNil(&pWin -> clipList) != 0) { #ifdef TEST fprintf(stderr, "nxagentSendBackgroundExpose: Exposures deferred because the window " "is hidden.\n"); #endif - REGION_UNION(pWin -> pScreen, nxagentDeferredBackgroundExposures, + RegionUnion(nxagentDeferredBackgroundExposures, nxagentDeferredBackgroundExposures, &expose); nxagentWindowPriv(pWin) -> deferredBackgroundExpose = 1; @@ -3121,32 +3121,32 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt pBackingStore = (miBSWindowPtr)pWin->backStorage; - if ((pBackingStore != NULL) && (REGION_NIL(&pBackingStore->SavedRegion) == 0)) + if ((pBackingStore != NULL) && (RegionNil(&pBackingStore->SavedRegion) == 0)) { - REGION_TRANSLATE(pWin -> pScreen, &expose, -pWin -> drawable.x, -pWin -> drawable.y); + RegionTranslate(&expose, -pWin -> drawable.x, -pWin -> drawable.y); - REGION_SUBTRACT(pWin -> pScreen, &expose, &expose, &pBackingStore -> SavedRegion); + RegionSubtract(&expose, &expose, &pBackingStore -> SavedRegion); - REGION_TRANSLATE(pWin -> pScreen, &expose, pWin -> drawable.x, pWin -> drawable.y); + RegionTranslate(&expose, pWin -> drawable.x, pWin -> drawable.y); } - REGION_INTERSECT(pWin -> pScreen, &expose, &expose, &pWin -> clipList); + RegionIntersect(&expose, &expose, &pWin -> clipList); /* * Reduce the overall region to expose. */ - REGION_TRANSLATE(pWin -> pScreen, &expose, -pWin -> drawable.x, -pWin -> drawable.y); + RegionTranslate(&expose, -pWin -> drawable.x, -pWin -> drawable.y); - REGION_SUBTRACT(pWin -> pScreen, pExpose, pExpose, &expose); + RegionSubtract(pExpose, pExpose, &expose); - REGION_TRANSLATE(pWin -> pScreen, &expose, pWin -> drawable.x, pWin -> drawable.y); + RegionTranslate(&expose, pWin -> drawable.x, pWin -> drawable.y); miWindowExposures(pWin, &expose, &expose); nxagentSendBackgroundExposeEnd: - REGION_UNINIT(pWin -> pScreen, &expose); + RegionUninit(&expose); } void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2) @@ -3156,7 +3156,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2) struct nxagentExposeBackground *pPair = p2; - if (REGION_NIL(pPair -> pExpose) != 0) + if (RegionNil(pPair -> pExpose) != 0) { return; } @@ -3217,21 +3217,21 @@ int nxagentClipAndSendClearExpose(WindowPtr pWin, void * ptr) if (nxagentWindowPriv(pWin) -> deferredBackgroundExpose == 1) { - exposeRgn = REGION_CREATE(pWin -> drawable.pScreen, NULL, 1); + exposeRgn = RegionCreate(NULL, 1); #ifdef DEBUG - box = *REGION_EXTENTS(pWin->drawable.pScreen, remoteExposeRgn); + box = *RegionExtents(remoteExposeRgn); fprintf(stderr, "nxagentClipAndSendClearExpose: Background expose extents: [%d,%d,%d,%d].\n", box.x1, box.y1, box.x2, box.y2); - box = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin -> clipList); + box = *RegionExtents(&pWin -> clipList); fprintf(stderr, "nxagentClipAndSendClearExpose: Clip list extents for window at [%p]: [%d,%d,%d,%d].\n", (void *) pWin, box.x1, box.y1, box.x2, box.y2); #endif - REGION_INTERSECT(pWin -> drawable.pScreen, exposeRgn, remoteExposeRgn, &pWin -> clipList); + RegionIntersect(exposeRgn, remoteExposeRgn, &pWin -> clipList); /* * If the region will be synchronized, @@ -3239,28 +3239,28 @@ int nxagentClipAndSendClearExpose(WindowPtr pWin, void * ptr) * be ignored. */ - REGION_SUBTRACT(pWin -> drawable.pScreen, exposeRgn, exposeRgn, nxagentCorruptedRegion((DrawablePtr) pWin)); + RegionSubtract(exposeRgn, exposeRgn, nxagentCorruptedRegion((DrawablePtr) pWin)); - if (REGION_NOTEMPTY(pWin -> drawable.pScreen, exposeRgn)) + if (RegionNotEmpty(exposeRgn)) { #ifdef DEBUG - box = *REGION_EXTENTS(pWin->drawable.pScreen, exposeRgn); + box = *RegionExtents(exposeRgn); fprintf(stderr, "nxagentClipAndSendClearExpose: Forwarding expose [%d,%d,%d,%d] to window at [%p] pWin.\n", box.x1, box.y1, box.x2, box.y2, (void *) pWin); #endif - REGION_SUBTRACT(pWin -> drawable.pScreen, remoteExposeRgn, remoteExposeRgn, exposeRgn); + RegionSubtract(remoteExposeRgn, remoteExposeRgn, exposeRgn); miWindowExposures(pWin, exposeRgn, exposeRgn); } - REGION_DESTROY(pWin -> drawable.pScreen, exposeRgn); + RegionDestroy(exposeRgn); nxagentWindowPriv(pWin) -> deferredBackgroundExpose = 0; } - if (REGION_NOTEMPTY(pWin -> drawable.pScreen, remoteExposeRgn)) + if (RegionNotEmpty(remoteExposeRgn)) { #ifdef DEBUG fprintf(stderr, "nxagentClipAndSendClearExpose: Region not empty. Walk children.\n"); @@ -3283,10 +3283,10 @@ void nxagentSendDeferredBackgroundExposures(void) { if (nxagentDeferredBackgroundExposures == NullRegion) { - nxagentDeferredBackgroundExposures = REGION_CREATE(WindowTable[0] -> drawable.pScreen, NullBox, 1); + nxagentDeferredBackgroundExposures = RegionCreate(NullBox, 1); } - if (REGION_NOTEMPTY(WindowTable[0] -> drawable.pScreen, nxagentDeferredBackgroundExposures) != 0) + if (RegionNotEmpty(nxagentDeferredBackgroundExposures) != 0) { #ifdef TEST fprintf(stderr, "nxagentSendDeferredBackgroundExposures: Going to send deferred exposures to the root window.\n"); @@ -3294,7 +3294,7 @@ void nxagentSendDeferredBackgroundExposures(void) TraverseTree(WindowTable[0], nxagentClipAndSendClearExpose, (void *) nxagentDeferredBackgroundExposures); - REGION_EMPTY(WindowTable[0] -> drawable.pScreen, nxagentDeferredBackgroundExposures); + RegionEmpty(nxagentDeferredBackgroundExposures); } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index 4ebbc928e..d05eebf19 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -107,7 +107,7 @@ enum SynchronizationPredicate nxagentWindowCorruptedRegion((WindowPtr) pDrawable)) #define nxagentDrawableStatus(pDrawable) \ - (REGION_NIL(nxagentCorruptedRegion(pDrawable)) ? \ + (RegionNil(nxagentCorruptedRegion(pDrawable)) ? \ Synchronized : NotSynchronized) #define nxagentDrawableContainGlyphs(pDrawable) \ @@ -155,7 +155,7 @@ extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, in int width, int height); #define nxagentFreeRegion(pDrawable, pRegion) \ - REGION_DESTROY((pDrawable) -> pScreen, pRegion); + RegionDestroy(pRegion); extern void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion); extern void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion); @@ -204,8 +204,8 @@ do \ break; \ } \ \ - numRects = REGION_NUM_RECTS(pRegion); \ - pBox = REGION_RECTS(pRegion); \ + numRects = RegionNumRects(pRegion); \ + pBox = RegionRects(pRegion); \ \ fprintf(stderr, "printRegionBoxes:: Region " strRegion " at [%p] has [%d] boxes:\n", \ (void *) (pRegion), numRects); \ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index c04481c92..d1d1a5f59 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2414,7 +2414,7 @@ int nxagentHandleExposeEvent(XEvent *X) if (pWin != NULL) { - REGION_INIT(pWin -> drawable.pScreen, &sum, (BoxRec *) NULL, 1); + RegionInit(&sum, (BoxRec *) NULL, 1); /* FIXME: This can be maybe optimized by consuming the events that do not match the predicate. @@ -2445,11 +2445,11 @@ FIXME: This can be maybe optimized by consuming the box.x2 = box.x1 + X -> xexpose.width; box.y2 = box.y1 + X -> xexpose.height; - REGION_INIT(pWin -> drawable.pScreen, &add, &box, 1); + RegionInit(&add, &box, 1); - REGION_APPEND(pWin -> drawable.pScreen, &sum, &add); + RegionAppend(&sum, &add); - REGION_UNINIT(pWin -> drawable.pScreen, &add); + RegionUninit(&add); if (X -> xexpose.count == 0) { @@ -2459,9 +2459,9 @@ FIXME: This can be maybe optimized by consuming the while (nxagentCheckEvents(nxagentDisplay, X, nxagentExposurePredicate, (XPointer) &window) == 1); - REGION_VALIDATE(pWin -> drawable.pScreen, &sum, &overlap); + RegionValidate(&sum, &overlap); - REGION_INTERSECT(pWin->drawable.pScreen, &sum, &sum, + RegionIntersect(&sum, &sum, &WindowTable[pWin->drawable.pScreen->myNum]->winSize); #ifdef DEBUG @@ -2482,14 +2482,14 @@ FIXME: This can be maybe optimized by consuming the } else { - REGION_TRANSLATE(pWin -> drawable.pScreen, &sum, -pWin -> drawable.x, -pWin -> drawable.y); + RegionTranslate(&sum, -pWin -> drawable.x, -pWin -> drawable.y); if (nxagentExposeQueue.exposures[index].remoteRegion == NullRegion) { - nxagentExposeQueue.exposures[index].remoteRegion = REGION_CREATE(pwin -> drawable.pScreen, NULL, 1); + nxagentExposeQueue.exposures[index].remoteRegion = RegionCreate(NULL, 1); } - REGION_UNION(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[index].remoteRegion, + RegionUnion(nxagentExposeQueue.exposures[index].remoteRegion, nxagentExposeQueue.exposures[index].remoteRegion, &sum); #ifdef TEST @@ -2521,7 +2521,7 @@ FIXME: This can be maybe optimized by consuming the } } - REGION_UNINIT(pWin -> drawable.pScreen, &sum); + RegionUninit(&sum); } return 1; @@ -2593,7 +2593,7 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X) rect.x2 = rect.x1 + X -> xgraphicsexpose.width; rect.y2 = rect.y1 + X -> xgraphicsexpose.height; - exposeRegion = REGION_CREATE(pScreen, &rect, 0); + exposeRegion = RegionCreate(&rect, 0); if (drawableType == DRAWABLE_PIXMAP) { @@ -2610,7 +2610,7 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X) * window. */ - REGION_TRANSLATE(pScreen, exposeRegion, pStoringPixmapRec -> backingStoreX, + RegionTranslate(exposeRegion, pStoringPixmapRec -> backingStoreX, pStoringPixmapRec -> backingStoreY); /* @@ -2618,7 +2618,7 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X) * affected by the GraphicsExpose event. */ - REGION_SUBTRACT(pScreen, &(pBSwindow -> SavedRegion), &(pBSwindow -> SavedRegion), + RegionSubtract(&(pBSwindow -> SavedRegion), &(pBSwindow -> SavedRegion), exposeRegion); } @@ -2628,11 +2628,11 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X) * must be relative to the screen. */ - REGION_TRANSLATE(pScreen, exposeRegion, pWin -> drawable.x, pWin -> drawable.y); + RegionTranslate(exposeRegion, pWin -> drawable.x, pWin -> drawable.y); - REGION_UNION(pScreen, nxagentRemoteExposeRegion, nxagentRemoteExposeRegion, exposeRegion); + RegionUnion(nxagentRemoteExposeRegion, nxagentRemoteExposeRegion, exposeRegion); - REGION_DESTROY(pScreen, exposeRegion); + RegionDestroy(exposeRegion); return 1; } @@ -4091,30 +4091,30 @@ void nxagentSynchronizeExpose(void) { if ((nxagentExposeQueueHead.localRegion) != NullRegion) { - REGION_TRANSLATE(pWin -> drawable.pScreen, (nxagentExposeQueueHead.localRegion), + RegionTranslate((nxagentExposeQueueHead.localRegion), pWin -> drawable.x, pWin -> drawable.y); } if ((nxagentExposeQueueHead.remoteRegion) != NullRegion) { - REGION_TRANSLATE(pWin -> drawable.pScreen, (nxagentExposeQueueHead.remoteRegion), + RegionTranslate((nxagentExposeQueueHead.remoteRegion), pWin -> drawable.x, pWin -> drawable.y); } if ((nxagentExposeQueueHead.localRegion) != NullRegion && (nxagentExposeQueueHead.remoteRegion) != NullRegion) { - REGION_SUBTRACT(pWin -> drawable.pScreen, (nxagentExposeQueueHead.remoteRegion), + RegionSubtract((nxagentExposeQueueHead.remoteRegion), (nxagentExposeQueueHead.remoteRegion), (nxagentExposeQueueHead.localRegion)); - if (REGION_NIL(nxagentExposeQueueHead.remoteRegion) == 0 && + if (RegionNil(nxagentExposeQueueHead.remoteRegion) == 0 && ((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeExpose: Going to call miWindowExposures" " for window [%ld] - rects [%ld].\n", nxagentWindow(pWin), - REGION_NUM_RECTS(nxagentExposeQueueHead.remoteRegion)); + RegionNumRects(nxagentExposeQueueHead.remoteRegion)); #endif miWindowExposures(pWin, nxagentExposeQueueHead.remoteRegion, NullRegion); @@ -4126,14 +4126,14 @@ void nxagentSynchronizeExpose(void) if (nxagentExposeQueueHead.localRegion != NullRegion) { - REGION_DESTROY(nxagentDefaultScreen, nxagentExposeQueueHead.localRegion); + RegionDestroy(nxagentExposeQueueHead.localRegion); } nxagentExposeQueueHead.localRegion = NullRegion; if (nxagentExposeQueueHead.remoteRegion != NullRegion) { - REGION_DESTROY(nxagentDefaultScreen, nxagentExposeQueueHead.remoteRegion); + RegionDestroy(nxagentExposeQueueHead.remoteRegion); } nxagentExposeQueueHead.remoteRegion = NullRegion; @@ -4260,7 +4260,7 @@ void nxagentInitRemoteExposeRegion(void) { if (nxagentRemoteExposeRegion == NULL) { - nxagentRemoteExposeRegion = REGION_CREATE(pWin -> drawable.pScreen, NULL, 1); + nxagentRemoteExposeRegion = RegionCreate(NULL, 1); if (nxagentRemoteExposeRegion == NULL) { @@ -4273,7 +4273,7 @@ void nxagentInitRemoteExposeRegion(void) void nxagentForwardRemoteExpose(void) { - if (REGION_NOTEMPTY(WindowTable[0] -> drawable.pScreen, nxagentRemoteExposeRegion)) + if (RegionNotEmpty(nxagentRemoteExposeRegion)) { #ifdef DEBUG fprintf(stderr, "nxagentForwardRemoteExpose: Going to forward events.\n"); @@ -4285,7 +4285,7 @@ void nxagentForwardRemoteExpose(void) * Now this region should be empty. */ - REGION_EMPTY(WindowTable[0] -> drawable.pScreen, nxagentRemoteExposeRegion); + RegionEmpty(nxagentRemoteExposeRegion); } } @@ -4298,12 +4298,12 @@ void nxagentAddRectToRemoteExposeRegion(BoxPtr rect) return; } - REGION_INIT(nxagentDefaultScreen, &exposeRegion, rect, 1); + RegionInit(&exposeRegion, rect, 1); - REGION_UNION(nxagentDefaultScreen, nxagentRemoteExposeRegion, + RegionUnion(nxagentRemoteExposeRegion, nxagentRemoteExposeRegion, &exposeRegion); - REGION_UNINIT(nxagentDefaultScreen, &exposeRegion); + RegionUninit(&exposeRegion); } int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr) @@ -4320,25 +4320,25 @@ int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr) if (pWin -> drawable.class != InputOnly) { - exposeRgn = REGION_CREATE(pWin -> drawable.pScreen, NULL, 1); + exposeRgn = RegionCreate(NULL, 1); - box = *REGION_EXTENTS(pWin->drawable.pScreen, remoteExposeRgn); + box = *RegionExtents(remoteExposeRgn); #ifdef DEBUG fprintf(stderr, "nxagentClipAndSendExpose: Root expose extents: [%d] [%d] [%d] [%d].\n", box.x1, box.y1, box.x2, box.y2); #endif - box = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin -> clipList); + box = *RegionExtents(&pWin -> clipList); #ifdef DEBUG fprintf(stderr, "nxagentClipAndSendExpose: Clip list extents for window at [%p]: [%d] [%d] [%d] [%d].\n", pWin, box.x1, box.y1, box.x2, box.y2); #endif - REGION_INTERSECT(pWin -> drawable.pScreen, exposeRgn, remoteExposeRgn, &pWin -> clipList); + RegionIntersect(exposeRgn, remoteExposeRgn, &pWin -> clipList); - if (REGION_NOTEMPTY(pWin -> drawable.pScreen, exposeRgn)) + if (RegionNotEmpty(exposeRgn)) { #ifdef DEBUG fprintf(stderr, "nxagentClipAndSendExpose: Forwarding expose to window at [%p] pWin.\n", @@ -4351,15 +4351,15 @@ int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr) * ration must be done before calling it. */ - REGION_SUBTRACT(pWin -> drawable.pScreen, remoteExposeRgn, remoteExposeRgn, exposeRgn); + RegionSubtract(remoteExposeRgn, remoteExposeRgn, exposeRgn); miWindowExposures(pWin, exposeRgn, NullRegion); } - REGION_DESTROY(pWin -> drawable.pScreen, exposeRgn); + RegionDestroy(exposeRgn); } - if (REGION_NOTEMPTY(pWin -> drawable.pScreen, remoteExposeRgn)) + if (RegionNotEmpty(remoteExposeRgn)) { #ifdef DEBUG fprintf(stderr, "nxagentClipAndSendExpose: Region not empty. Walk children.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 808220346..c06e56a00 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -633,11 +633,11 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) case CT_YXSORTED: case CT_YXBANDED: { - RegionPtr pReg = RECTS_TO_REGION(pGC->pScreen, nRects, (xRectangle *)pValue, type); + RegionPtr pReg = RegionFromRects(nRects, (xRectangle *)pValue, type); clipsMatch = nxagentCompareRegions(pGC -> clientClip, pReg); - REGION_DESTROY(pGC->pScreen, pReg); + RegionDestroy(pReg); break; } @@ -671,10 +671,10 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) { if (clipsMatch == 0 && nxagentGCTrap == 0) { - nRects = REGION_NUM_RECTS((RegionPtr)pValue); + nRects = RegionNumRects((RegionPtr)pValue); size = nRects * sizeof(*pRects); pRects = (XRectangle *) xalloc(size); - pBox = REGION_RECTS((RegionPtr)pValue); + pBox = RegionRects((RegionPtr)pValue); for (i = nRects; i-- > 0;) { @@ -768,7 +768,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects) * CT_REGION client clips. */ - pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nRects, + pGC->clientClip = (void *) RegionFromRects(nRects, (xRectangle *)pValue, type); xfree(pValue); @@ -820,7 +820,7 @@ void nxagentDestroyClipHelper(GCPtr pGC) case CT_NONE: break; case CT_REGION: - REGION_DESTROY(pGC->pScreen, pGC->clientClip); + RegionDestroy(pGC->clientClip); break; case CT_PIXMAP: nxagentDestroyPixmap((PixmapPtr)pGC->clientClip); @@ -848,8 +848,8 @@ void nxagentCopyClip(GCPtr pGCDst, GCPtr pGCSrc) case CT_REGION: if (nxagentGCPriv(pGCSrc)->pPixmap == NULL) { - pRgn = REGION_CREATE(pGCDst->pScreen, NULL, 1); - REGION_COPY(pGCDst->pScreen, pRgn, pGCSrc->clientClip); + pRgn = RegionCreate(NULL, 1); + RegionCopy(pRgn, pGCSrc->clientClip); nxagentChangeClip(pGCDst, CT_REGION, pRgn, 0); } else @@ -1281,10 +1281,10 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) case CT_REGION: if (nxagentGCPriv(pGC)->pPixmap == NULL) { - nRects = REGION_NUM_RECTS((RegionPtr)pValue); + nRects = RegionNumRects((RegionPtr)pValue); size = nRects * sizeof(*pRects); pRects = (XRectangle *) xalloc(size); - pBox = REGION_RECTS((RegionPtr)pValue); + pBox = RegionRects((RegionPtr)pValue); for (i = nRects; i-- > 0;) { pRects[i].x = pBox[i].x1; pRects[i].y = pBox[i].y1; @@ -1370,7 +1370,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects) * CT_PIXMAP and CT_REGION client clips. */ - pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nRects, + pGC->clientClip = (void *) RegionFromRects(nRects, (xRectangle *)pValue, type); xfree(pValue); pValue = pGC->clientClip; @@ -1403,26 +1403,26 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2) return 0; } - if (REGION_NUM_RECTS(r1) != REGION_NUM_RECTS(r2)) + if (RegionNumRects(r1) != RegionNumRects(r2)) { return 0; } - else if (REGION_NUM_RECTS(r1) == 0) + else if (RegionNumRects(r1) == 0) { return 1; } - else if ((*REGION_EXTENTS(pScreen, r1)).x1 != (*REGION_EXTENTS(pScreen, r2)).x1) return 0; - else if ((*REGION_EXTENTS(pScreen, r1)).x2 != (*REGION_EXTENTS(pScreen, r2)).x2) return 0; - else if ((*REGION_EXTENTS(pScreen, r1)).y1 != (*REGION_EXTENTS(pScreen, r2)).y1) return 0; - else if ((*REGION_EXTENTS(pScreen, r1)).y2 != (*REGION_EXTENTS(pScreen, r2)).y2) return 0; + else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0; + else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0; + else if ((*RegionExtents(r1)).y1 != (*RegionExtents(r2)).y1) return 0; + else if ((*RegionExtents(r1)).y2 != (*RegionExtents(r2)).y2) return 0; else { - for (i = 0; i < REGION_NUM_RECTS(r1); i++) + for (i = 0; i < RegionNumRects(r1); i++) { - if (REGION_RECTS(r1)[i].x1 != REGION_RECTS(r2)[i].x1) return 0; - else if (REGION_RECTS(r1)[i].x2 != REGION_RECTS(r2)[i].x2) return 0; - else if (REGION_RECTS(r1)[i].y1 != REGION_RECTS(r2)[i].y1) return 0; - else if (REGION_RECTS(r1)[i].y2 != REGION_RECTS(r2)[i].y2) return 0; + if (RegionRects(r1)[i].x1 != RegionRects(r2)[i].x1) return 0; + else if (RegionRects(r1)[i].x2 != RegionRects(r2)[i].x2) return 0; + else if (RegionRects(r1)[i].y1 != RegionRects(r2)[i].y1) return 0; + else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0; } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 25f5fa6d7..604b1d85a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -306,12 +306,12 @@ FIXME: The popup could be synchronized with one pSrcRegion -> extents.x2, pSrcRegion -> extents.y2); #endif - REGION_INIT(pSrcDrawable -> pScreen, &corruptedRegion, NullBox, 1); + RegionInit(&corruptedRegion, NullBox, 1); - REGION_INTERSECT(pSrcDrawable -> pScreen, &corruptedRegion, + RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (REGION_NIL(&corruptedRegion) == 0) + if (RegionNil(&corruptedRegion) == 0) { #ifdef TEST fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", @@ -321,7 +321,7 @@ FIXME: The popup could be synchronized with one nxagentSynchronizeRegion(pSrcDrawable, &corruptedRegion, EVENT_BREAK, NULL); } - REGION_UNINIT(pSrcDrawable -> pScreen, &corruptedRegion); + RegionUninit(&corruptedRegion); nxagentFreeRegion(pSrcDrawable, pSrcRegion); @@ -361,7 +361,7 @@ FIXME: The popup could be synchronized with one pClipRegion -> extents.x2, pClipRegion -> extents.y2); #endif - REGION_SUBTRACT(pSrcDrawable -> pScreen, pClipRegion, pClipRegion, nxagentCorruptedRegion(pSrcDrawable)); + RegionSubtract(pClipRegion, pClipRegion, nxagentCorruptedRegion(pSrcDrawable)); #ifdef DEBUG fprintf(stderr, "nxagentDeferCopyArea: Usable copy area source region is [%d,%d,%d,%d].\n", @@ -381,11 +381,11 @@ FIXME: The popup could be synchronized with one #endif - REGION_TRANSLATE(pSrcDrawable -> pScreen, pClipRegion, dstx - srcx, dsty - srcy); + RegionTranslate(pClipRegion, dstx - srcx, dsty - srcy); } else { - REGION_INIT(pDstDrawable -> pScreen, &tmpRegion, NullBox, 1); + RegionInit(&tmpRegion, NullBox, 1); #ifdef DEBUG fprintf(stderr, "nxagentDeferCopyArea: Going to modify the original GC [%p] with clip mask " @@ -396,18 +396,18 @@ FIXME: The popup could be synchronized with one pGC -> clipOrg.x, pGC -> clipOrg.y); #endif - REGION_COPY(pDstDrawable -> pScreen, &tmpRegion, (RegionPtr) pGC -> clientClip); + RegionCopy(&tmpRegion, (RegionPtr) pGC -> clientClip); if (pGC -> clipOrg.x != 0 || pGC -> clipOrg.y != 0) { - REGION_TRANSLATE(pDstDrawable -> pScreen, &tmpRegion, pGC -> clipOrg.x, pGC -> clipOrg.y); + RegionTranslate(&tmpRegion, pGC -> clipOrg.x, pGC -> clipOrg.y); } - REGION_TRANSLATE(pSrcDrawable -> pScreen, pClipRegion, dstx - srcx, dsty - srcy); + RegionTranslate(pClipRegion, dstx - srcx, dsty - srcy); - REGION_INTERSECT(pSrcDrawable -> pScreen, pClipRegion, &tmpRegion, pClipRegion); + RegionIntersect(pClipRegion, &tmpRegion, pClipRegion); - REGION_UNINIT(pSrcDrawable -> pScreen, &tmpRegion); + RegionUninit(&tmpRegion); } /* @@ -416,18 +416,18 @@ FIXME: The popup could be synchronized with one * destination that we are not going to copy. */ - REGION_SUBTRACT(pSrcDrawable -> pScreen, pCorruptedRegion, pCorruptedRegion, pClipRegion); + RegionSubtract(pCorruptedRegion, pCorruptedRegion, pClipRegion); #ifdef DEBUG fprintf(stderr, "nxagentDeferCopyArea: Recomputed clip region is [%d,%d,%d,%d][%ld].\n", pClipRegion -> extents.x1, pClipRegion -> extents.y1, pClipRegion -> extents.x2, pClipRegion -> extents.y2, - REGION_NUM_RECTS(pClipRegion)); + RegionNumRects(pClipRegion)); fprintf(stderr, "nxagentDeferCopyArea: Inherited corrupted region is [%d,%d,%d,%d][%ld].\n", pCorruptedRegion -> extents.x1, pCorruptedRegion -> extents.y1, pCorruptedRegion -> extents.x2, pCorruptedRegion -> extents.y2, - REGION_NUM_RECTS(pCorruptedRegion)); + RegionNumRects(pCorruptedRegion)); #endif /* @@ -435,17 +435,17 @@ FIXME: The popup could be synchronized with one * synchronized and the corrupted region. */ - if (REGION_NIL(pClipRegion) == 0) + if (RegionNil(pClipRegion) == 0) { nxagentUnmarkCorruptedRegion(pDstDrawable, pClipRegion); } - if (REGION_NIL(pCorruptedRegion) == 0) + if (RegionNil(pCorruptedRegion) == 0) { nxagentMarkCorruptedRegion(pDstDrawable, pCorruptedRegion); } - if (REGION_NIL(pClipRegion) == 0) + if (RegionNil(pClipRegion) == 0) { GCPtr targetGC; @@ -468,7 +468,7 @@ FIXME: The popup could be synchronized with one GCClipXOrigin | GCClipYOrigin | GCClipMask | GCForeground | GCBackground | GCGraphicsExposures); - if (REGION_NUM_RECTS(pClipRegion) == 1) + if (RegionNumRects(pClipRegion) == 1) { /* * If the region to copy is formed by one @@ -563,12 +563,12 @@ FIXME: The popup could be synchronized with one pSrcRegion -> extents.x2, pSrcRegion -> extents.y2); #endif - REGION_INIT(pSrcDrawable -> pScreen, &corruptedRegion, NullBox, 1); + RegionInit(&corruptedRegion, NullBox, 1); - REGION_INTERSECT(pSrcDrawable -> pScreen, &corruptedRegion, + RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (REGION_NIL(&corruptedRegion) == 0) + if (RegionNil(&corruptedRegion) == 0) { #ifdef TEST fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", @@ -578,7 +578,7 @@ FIXME: The popup could be synchronized with one nxagentSynchronizeRegion(pSrcDrawable, &corruptedRegion /*pSrcRegion*/, NEVER_BREAK, NULL); } - REGION_UNINIT(pSrcDrawable -> pScreen, &corruptedRegion); + RegionUninit(&corruptedRegion); nxagentFreeRegion(pSrcDrawable, pSrcRegion); } @@ -1032,12 +1032,12 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, { pSrcRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, width, height); - REGION_INIT(pSrcDrawable -> pScreen, &corruptedRegion, NullBox, 1); + RegionInit(&corruptedRegion, NullBox, 1); - REGION_INTERSECT(pSrcDrawable -> pScreen, &corruptedRegion, + RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (REGION_NIL(&corruptedRegion) == 0) + if (RegionNil(&corruptedRegion) == 0) { #ifdef TEST fprintf(stderr, "nxagentCopyPlane: Forcing the synchronization of source drawable at [%p].\n", @@ -1053,7 +1053,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, nxagentFreeRegion(pDstDrawable, pDstRegion); } - REGION_UNINIT(pSrcDrawable -> pScreen, &corruptedRegion); + RegionUninit(&corruptedRegion); nxagentFreeRegion(pSrcDrawable, pSrcRegion); } @@ -1615,24 +1615,24 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, if (inheritCorruptedRegion == 1 || nxagentDrawableStatus(pDrawable) == NotSynchronized) { - rectRegion = RECTS_TO_REGION(pDrawable -> pScreen, nRectangles, pRectangles, CT_REGION); + rectRegion = RegionFromRects(nRectangles, pRectangles, CT_REGION); if (pGC -> clientClip != NULL) { RegionRec tmpRegion; - REGION_INIT(pDrawable -> pScreen, &tmpRegion, NullBox, 1); + RegionInit(&tmpRegion, NullBox, 1); - REGION_COPY(pDrawable -> pScreen, &tmpRegion, ((RegionPtr) pGC -> clientClip)); + RegionCopy(&tmpRegion, ((RegionPtr) pGC -> clientClip)); if (pGC -> clipOrg.x != 0 || pGC -> clipOrg.y != 0) { - REGION_TRANSLATE(pDrawable -> pScreen, &tmpRegion, pGC -> clipOrg.x, pGC -> clipOrg.y); + RegionTranslate(&tmpRegion, pGC -> clipOrg.x, pGC -> clipOrg.y); } - REGION_INTERSECT(pDrawable -> pScreen, rectRegion, rectRegion, &tmpRegion); + RegionIntersect(rectRegion, rectRegion, &tmpRegion); - REGION_UNINIT(pDrawable -> pScreen, &tmpRegion); + RegionUninit(&tmpRegion); } if (inheritCorruptedRegion == 1) @@ -1672,7 +1672,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, } } - REGION_DESTROY(pDrawable -> pScreen, rectRegion); + RegionDestroy(rectRegion); } if ((pDrawable)->type == DRAWABLE_PIXMAP) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 1f0b735b0..c84d3b7ed 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -566,7 +566,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, pRegion = nxagentCreateRegion(pDrawable, pGC, dstX, dstY, dstWidth, dstHeight); - if (REGION_NIL(pRegion) == 1) + if (RegionNil(pRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on fully clipped " @@ -1036,7 +1036,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, clipRegion = nxagentCreateRegion(pDrawable, pGC, x, y, w, h); } - if (clipRegion == NullRegion || REGION_NIL(clipRegion) == 0) + if (clipRegion == NullRegion || RegionNil(clipRegion) == 0) { nxagentPutSubImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, data, pVisual); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c index d18840dad..278e0727c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c @@ -154,7 +154,7 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, #endif /* short circuit for empty regions */ - if (!REGION_NOTEMPTY(pScreen, pRegion)) + if (!RegionNotEmpty(pRegion)) return; #ifdef COMPOSITE @@ -169,7 +169,7 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y; } if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y); + RegionTranslate(pRegion, screen_x, screen_y); #endif if (pDrawable->type == DRAWABLE_WINDOW && @@ -177,22 +177,22 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, { if (subWindowMode == ClipByChildren) { - REGION_INTERSECT(pScreen, pRegion, pRegion, + RegionIntersect(pRegion, pRegion, &((WindowPtr)(pDrawable))->clipList); } else if (subWindowMode == IncludeInferiors) { RegionPtr pTempRegion = NotClippedByChildren((WindowPtr)(pDrawable)); - REGION_INTERSECT(pScreen, pRegion, pRegion, pTempRegion); - REGION_DESTROY(pScreen, pTempRegion); + RegionIntersect(pRegion, pRegion, pTempRegion); + RegionDestroy(pTempRegion); } /* If subWindowMode is set to an invalid value, don't perform * any drawable-based clipping. */ } - REGION_NULL (pScreen, &clippedRec); + RegionNull(&clippedRec); for (; pDamage; pDamage = pNext) { pNext = pDamage->pNext; @@ -240,7 +240,7 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, { pDamageRegion = &clippedRec; if (pDamage->pDrawable->type == DRAWABLE_WINDOW) { - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, + RegionIntersect(pDamageRegion, pRegion, &((WindowPtr)(pDamage->pDrawable))->borderClip); } else { BoxRec box; @@ -248,14 +248,14 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, box.y1 = draw_y; box.x2 = draw_x + pDamage->pDrawable->width; box.y2 = draw_y + pDamage->pDrawable->height; - REGION_INIT(pScreen, &pixClip, &box, 1); - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, &pixClip); - REGION_UNINIT(pScreen, &pixClip); + RegionInit(&pixClip, &box, 1); + RegionIntersect(pDamageRegion, pRegion, &pixClip); + RegionUninit(&pixClip); } /* * Short circuit empty results */ - if (!REGION_NOTEMPTY(pScreen, pDamageRegion)) + if (!RegionNotEmpty(pDamageRegion)) continue; } @@ -270,39 +270,39 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, * Move region to target coordinate space */ if (draw_x || draw_y) - REGION_TRANSLATE (pScreen, pDamageRegion, -draw_x, -draw_y); + RegionTranslate(pDamageRegion, -draw_x, -draw_y); switch (pDamage->damageLevel) { case DamageReportRawRegion: (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure); break; case DamageReportDeltaRegion: - REGION_NULL (pScreen, &tmpRegion); - REGION_SUBTRACT (pScreen, &tmpRegion, pDamageRegion, &pDamage->damage); - if (REGION_NOTEMPTY (pScreen, &tmpRegion)) + RegionNull(&tmpRegion); + RegionSubtract(&tmpRegion, pDamageRegion, &pDamage->damage); + if (RegionNotEmpty(&tmpRegion)) { - REGION_UNION(pScreen, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); (*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure); } - REGION_UNINIT(pScreen, &tmpRegion); + RegionUninit(&tmpRegion); break; case DamageReportBoundingBox: - tmpBox = *REGION_EXTENTS (pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, + tmpBox = *RegionExtents(&pDamage->damage); + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); - if (!BOX_SAME (&tmpBox, REGION_EXTENTS (pScreen, &pDamage->damage))) + if (!BOX_SAME (&tmpBox, RegionExtents(&pDamage->damage))) (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); break; case DamageReportNonEmpty: - was_empty = !REGION_NOTEMPTY(pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + was_empty = !RegionNotEmpty(&pDamage->damage); + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); - if (was_empty && REGION_NOTEMPTY(pScreen, &pDamage->damage)) + if (was_empty && RegionNotEmpty(&pDamage->damage)) (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); break; case DamageReportNone: - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); break; } @@ -310,14 +310,14 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, * translate original region back */ if (pDamageRegion == pRegion && (draw_x || draw_y)) - REGION_TRANSLATE (pScreen, pDamageRegion, draw_x, draw_y); + RegionTranslate(pDamageRegion, draw_x, draw_y); } #ifdef COMPOSITE if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, -screen_x, -screen_y); + RegionTranslate(pRegion, -screen_x, -screen_y); #endif - REGION_UNINIT (pScreen, &clippedRec); + RegionUninit(&clippedRec); } #if DAMAGE_DEBUG_ENABLE @@ -331,13 +331,13 @@ damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode) { RegionRec region; - REGION_INIT (pDrawable->pScreen, ®ion, pBox, 1); + RegionInit(®ion, pBox, 1); #if DAMAGE_DEBUG_ENABLE _damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode, where); #else damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode); #endif - REGION_UNINIT (pDrawable->pScreen, ®ion); + RegionUninit(®ion); } static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); @@ -506,7 +506,7 @@ damageDestroyClip(GCPtr pGC) #define checkGCDamage(d,g) (getDrawableDamage(d) && \ (!g->pCompositeClip ||\ - REGION_NOTEMPTY(d->pScreen, \ + RegionNotEmpty(\ g->pCompositeClip))) #ifdef RENDER @@ -520,7 +520,7 @@ damageDestroyClip(GCPtr pGC) } #define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ - REGION_NOTEMPTY(pScreen, p->pCompositeClip)) + RegionNotEmpty(p->pCompositeClip)) static void damageComposite (CARD8 op, @@ -1722,9 +1722,9 @@ damageCopyWindow(WindowPtr pWindow, * The region comes in source relative, but the damage occurs * at the destination location. Translate back and forth. */ - REGION_TRANSLATE (pScreen, prgnSrc, dx, dy); + RegionTranslate(prgnSrc, dx, dy); damageDamageRegion (&pWindow->drawable, prgnSrc, FALSE, -1); - REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); } unwrap (pScrPriv, pScreen, CopyWindow); (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); @@ -1927,7 +1927,7 @@ DamageCreate (DamageReportFunc damageReport, return 0; pDamage->pNext = 0; pDamage->pNextWin = 0; - REGION_NULL(pScreen, &pDamage->damage); + RegionNull(&pDamage->damage); pDamage->damageLevel = damageLevel; pDamage->isInternal = isInternal; @@ -2016,7 +2016,7 @@ DamageDestroy (DamagePtr pDamage) { if (pDamage->damageDestroy) (*pDamage->damageDestroy) (pDamage, pDamage->closure); - REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->damage); + RegionUninit(&pDamage->damage); xfree (pDamage); } @@ -2028,7 +2028,7 @@ DamageSubtract (DamagePtr pDamage, RegionRec pixmapClip; DrawablePtr pDrawable = pDamage->pDrawable; - REGION_SUBTRACT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pRegion); + RegionSubtract(&pDamage->damage, &pDamage->damage, pRegion); if (pDrawable) { if (pDrawable->type == DRAWABLE_WINDOW) @@ -2041,22 +2041,22 @@ DamageSubtract (DamagePtr pDamage, box.y1 = pDrawable->y; box.x2 = pDrawable->x + pDrawable->width; box.y2 = pDrawable->y + pDrawable->height; - REGION_INIT (pDrawable->pScreen, &pixmapClip, &box, 1); + RegionInit(&pixmapClip, &box, 1); pClip = &pixmapClip; } - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, pDrawable->x, pDrawable->y); - REGION_INTERSECT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pClip); - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, -pDrawable->x, -pDrawable->y); + RegionTranslate(&pDamage->damage, pDrawable->x, pDrawable->y); + RegionIntersect(&pDamage->damage, &pDamage->damage, pClip); + RegionTranslate(&pDamage->damage, -pDrawable->x, -pDrawable->y); if (pDrawable->type != DRAWABLE_WINDOW) - REGION_UNINIT(pDrawable->pScreen, &pixmapClip); + RegionUninit(&pixmapClip); } - return REGION_NOTEMPTY (pDrawable->pScreen, &pDamage->damage); + return RegionNotEmpty(&pDamage->damage); } void DamageEmpty (DamagePtr pDamage) { - REGION_EMPTY (pDamage->pDrawable->pScreen, &pDamage->damage); + RegionEmpty(&pDamage->damage); } RegionPtr diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 704bfcc0d..6a1f2ac6a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -1669,11 +1669,11 @@ ProcTranslateCoords(register ClientPtr client) * borderSize */ && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( &pWin->borderSize, x, y, &box)) && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) @@ -2291,7 +2291,7 @@ ProcCopyArea(register ClientPtr client) (*pDst->pScreen->SendGraphicsExpose) (client, pRgn, stuff->dstDrawable, X_CopyArea, 0); if (pRgn) - REGION_DESTROY(pDst->pScreen, pRgn); + RegionDestroy(pRgn); } return(client->noClientException); @@ -2339,7 +2339,7 @@ ProcCopyPlane(register ClientPtr client) (*pdstDraw->pScreen->SendGraphicsExpose) (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); if (pRgn) - REGION_DESTROY(pdstDraw->pScreen, pRgn); + RegionDestroy(pRgn); } return(client->noClientException); } @@ -2777,7 +2777,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw); if (pVisibleRegion) { - REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y); + RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y); } } #endif @@ -2871,7 +2871,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, } #ifdef XCSECURITY if (pVisibleRegion) - REGION_DESTROY(pDraw->pScreen, pVisibleRegion); + RegionDestroy(pVisibleRegion); #endif if (!im_return) DEALLOCATE_LOCAL(pBuf); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index 11ff62947..117203103 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -379,14 +379,14 @@ XineramaSetCursorPosition( x += panoramiXdataPtr[0].x; y += panoramiXdataPtr[0].y; - if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], + if(!RegionContainsPoint(&XineramaScreenRegions[pScreen->myNum], x, y, &box)) { FOR_NSCREENS(i) { if(i == pScreen->myNum) continue; - if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box)) + if(RegionContainsPoint(&XineramaScreenRegions[i], x, y, &box)) { pScreen = screenInfo.screens[i]; break; @@ -516,7 +516,7 @@ XineramaCheckVirtualMotion( i = PanoramiXNumScreens - 1; - REGION_COPY(sprite.screen, &sprite.Reg2, + RegionCopy(&sprite.Reg2, &sprite.windows[i]->borderSize); off_x = panoramiXdataPtr[i].x; off_y = panoramiXdataPtr[i].y; @@ -526,16 +526,16 @@ XineramaCheckVirtualMotion( y = off_y - panoramiXdataPtr[i].y; if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y); + RegionTranslate(&sprite.Reg2, x, y); - REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2, + RegionUnion(&sprite.Reg2, &sprite.Reg2, &sprite.windows[i]->borderSize); off_x = panoramiXdataPtr[i].x; off_y = panoramiXdataPtr[i].y; } - lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2); + lims = *RegionExtents(&sprite.Reg2); if (sprite.hot.x < lims.x1) #ifdef XEVIE @@ -558,7 +558,7 @@ XineramaCheckVirtualMotion( #endif sprite.hot.y = lims.y2 - 1; - if (REGION_NUM_RECTS(&sprite.Reg2) > 1) + if (RegionNumRects(&sprite.Reg2) > 1) ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y); if (qe) @@ -665,7 +665,7 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) i = PanoramiXNumScreens - 1; - REGION_COPY(sprite.screen, &sprite.Reg1, + RegionCopy(&sprite.Reg1, &sprite.windows[i]->borderSize); off_x = panoramiXdataPtr[i].x; off_y = panoramiXdataPtr[i].y; @@ -675,18 +675,18 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents) y = off_y - panoramiXdataPtr[i].y; if(x || y) - REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y); + RegionTranslate(&sprite.Reg1, x, y); - REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1, + RegionUnion(&sprite.Reg1, &sprite.Reg1, &sprite.windows[i]->borderSize); off_x = panoramiXdataPtr[i].x; off_y = panoramiXdataPtr[i].y; } - sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1); + sprite.hotLimits = *RegionExtents(&sprite.Reg1); - if(REGION_NUM_RECTS(&sprite.Reg1) > 1) + if(RegionNumRects(&sprite.Reg1) > 1) sprite.hotShape = &sprite.Reg1; else sprite.hotShape = NullRegion; @@ -765,9 +765,9 @@ ConfineToShape(RegionPtr shape, int *px, int *py) int x = *px, y = *py; int incx = 1, incy = 1; - if (POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)) + if (RegionContainsPoint(shape, x, y, &box)) return; - box = *REGION_EXTENTS(sprite.hot.pScreen, shape); + box = *RegionExtents(shape); /* this is rather crude */ do { x += incx; @@ -789,7 +789,7 @@ ConfineToShape(RegionPtr shape, int *px, int *py) else if (y < box.y1) return; /* should never get here! */ } - } while (!POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box)); + } while (!RegionContainsPoint(shape, x, y, &box)); *px = x; *py = y; } @@ -877,7 +877,7 @@ CheckVirtualMotion( #endif sprite.hot.x = sprite.hot.y = 0; } - lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize); + lims = *RegionExtents(&pWin->borderSize); if (sprite.hot.x < lims.x1) #ifdef XEVIE xeviehot.x = @@ -931,7 +931,7 @@ ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen) } else { - sprite.hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize); + sprite.hotLimits = *RegionExtents(&pWin->borderSize); #ifdef SHAPE sprite.hotShape = wBoundingShape(pWin) ? &pWin->borderSize : NullRegion; @@ -2117,7 +2117,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) { BoxRec box; - if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box)) + if(RegionContainsPoint(&pWin->borderSize, x, y, &box)) return TRUE; #ifdef PANORAMIX @@ -2125,7 +2125,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) int i; for(i = 1; i < PanoramiXNumScreens; i++) { - if(POINT_IN_REGION(sprite.screen, + if(RegionContainsPoint( &sprite.windows[i]->borderSize, x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x, y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y, @@ -2180,7 +2180,7 @@ XYToWindow(int x, int y) */ && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) @@ -2329,10 +2329,10 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) sprite.hotLimits.x2 -= xoff; sprite.hotLimits.y2 -= yoff; - if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg1)) - REGION_TRANSLATE(sprite.screen, &sprite.Reg1, xoff, yoff); - if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg2)) - REGION_TRANSLATE(sprite.screen, &sprite.Reg2, xoff, yoff); + if (RegionNotEmpty(&sprite.Reg1)) + RegionTranslate(&sprite.Reg1, xoff, yoff); + if (RegionNotEmpty(&sprite.Reg2)) + RegionTranslate(&sprite.Reg2, xoff, yoff); /* FIXME: if we call ConfineCursorToWindow, must we do anything else? */ if ((grab = inputInfo.pointer->grab) && grab->confineTo) { @@ -2388,8 +2388,8 @@ DefineInitialRootWindow(register WindowPtr win) #endif sprite.screen = pScreen; /* gotta UNINIT these someplace */ - REGION_NULL(pScreen, &sprite.Reg1); - REGION_NULL(pScreen, &sprite.Reg2); + RegionNull(&sprite.Reg1); + RegionNull(&sprite.Reg2); } #endif @@ -2467,7 +2467,7 @@ XineramaPointInWindowIsVisible( if (!pWin->realized) return FALSE; - if (POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) + if (RegionContainsPoint(&pWin->borderClip, x, y, &box)) return TRUE; if(!XineramaSetWindowPntrs(pWin)) return FALSE; @@ -2481,9 +2481,9 @@ XineramaPointInWindowIsVisible( x = xoff - panoramiXdataPtr[i].x; y = yoff - panoramiXdataPtr[i].y; - if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box) + if(RegionContainsPoint(&pWin->borderClip, x, y, &box) && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box))) @@ -2659,7 +2659,7 @@ ProcWarpPointer(ClientPtr client) static Bool BorderSizeNotEmpty(WindowPtr pWin) { - if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize)) + if(RegionNotEmpty(&pWin->borderSize)) return TRUE; #ifdef PANORAMIX @@ -2667,7 +2667,7 @@ BorderSizeNotEmpty(WindowPtr pWin) int i; for(i = 1; i < PanoramiXNumScreens; i++) { - if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize)) + if(RegionNotEmpty(&sprite.windows[i]->borderSize)) return TRUE; } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c index aa3c606f8..201d6d83b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c @@ -222,21 +222,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 @@ -253,7 +253,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; } @@ -270,11 +270,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 @@ -286,14 +286,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) { @@ -311,10 +311,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 @@ -324,7 +324,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) @@ -337,7 +337,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 @@ -345,8 +345,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)( @@ -363,53 +363,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; } } @@ -424,7 +424,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; @@ -432,8 +432,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; @@ -479,8 +479,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)); @@ -554,8 +554,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; @@ -568,11 +568,11 @@ 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; } @@ -583,12 +583,12 @@ miWindowExposures(pWin, prgn, other_exposed) * than 4, let the function decide. */ - total = REGION_NUM_RECTS(exposures); + total = RegionNumRects(exposures); if (clientInterested && exposures && (total > RECTLIMIT || (total > 4 && nxagentExtentsPredicate(total) == 1))) #else - if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT)) + if (clientInterested && exposures && (RegionNumRects(exposures) > RECTLIMIT)) #endif { /* @@ -599,17 +599,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)( @@ -620,22 +620,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); } @@ -779,7 +779,7 @@ int what; } } - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * + prect = (xRectangle *)ALLOCATE_LOCAL(RegionNumRects(prgn) * sizeof(xRectangle)); if (!prect) return; @@ -822,7 +822,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; @@ -925,8 +925,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; @@ -945,7 +945,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/hw/nxagent/NXmiwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c index a720cafbf..08c052294 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c @@ -131,7 +131,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) { /* @@ -145,14 +145,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); } /* @@ -198,7 +198,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 @@ -217,10 +217,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); } @@ -231,12 +231,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); } /* @@ -247,8 +247,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) @@ -300,11 +300,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; } @@ -403,9 +403,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) @@ -425,17 +425,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; @@ -481,13 +481,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) @@ -534,8 +534,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; @@ -572,7 +572,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); } @@ -607,14 +607,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; } @@ -671,8 +671,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 @@ -685,8 +685,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 @@ -701,8 +701,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 @@ -717,16 +717,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); } } @@ -753,9 +753,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, @@ -783,7 +783,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); @@ -827,16 +827,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 @@ -847,9 +847,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 @@ -858,17 +858,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); } } @@ -892,14 +892,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 */ @@ -915,7 +915,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 @@ -925,7 +925,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); } @@ -936,21 +936,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; @@ -959,8 +959,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); @@ -977,7 +977,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 (); @@ -1021,8 +1021,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; } @@ -1039,8 +1039,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, @@ -1083,10 +1083,10 @@ miSetShape(pWin) */ if (WasViewable && pOldClip) - REGION_DESTROY(pScreen, pOldClip); + RegionDestroy(pOldClip); #else if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); + RegionDestroy(pOldClip); #endif if (bsExposed) { @@ -1096,8 +1096,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) @@ -1158,8 +1158,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; } @@ -1196,10 +1196,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); } } @@ -1214,7 +1214,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); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index 9c438394a..725f5137e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -1537,7 +1537,7 @@ SetPictureClipRects (PicturePtr pPicture, RegionPtr clientClip; int result; - clientClip = RECTS_TO_REGION(pScreen, + clientClip = RegionFromRects( nRect, rects, CT_UNSORTED); if (!clientClip) return BadAlloc; @@ -1568,14 +1568,14 @@ SetPictureClipRegion (PicturePtr pPicture, if (pRegion) { type = CT_REGION; - clientClip = REGION_CREATE (pScreen, - REGION_EXTENTS(pScreen, pRegion), - REGION_NUM_RECTS(pRegion)); + clientClip = RegionCreate( + RegionExtents(pRegion), + RegionNumRects(pRegion)); if (!clientClip) return BadAlloc; - if (!REGION_COPY (pSCreen, clientClip, pRegion)) + if (!RegionCopy(clientClip, pRegion)) { - REGION_DESTROY (pScreen, clientClip); + RegionDestroy(clientClip); return BadAlloc; } } @@ -1685,9 +1685,9 @@ CopyPicture (PicturePtr pSrc, RegionPtr clientClip; RegionPtr srcClientClip = (RegionPtr)pSrc->clientClip; - clientClip = REGION_CREATE(pSrc->pDrawable->pScreen, - REGION_EXTENTS(pSrc->pDrawable->pScreen, srcClientClip), - REGION_NUM_RECTS(srcClientClip)); + clientClip = RegionCreate( + RegionExtents(srcClientClip), + RegionNumRects(srcClientClip)); (*ps->ChangePictureClip)(pDst, CT_REGION, clientClip, 0); } break; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 013f26e28..a3d791ff8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -509,10 +509,10 @@ CreateRootWindow(ScreenPtr pScreen) box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - REGION_INIT(pScreen, &pWin->winSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderClip, &box, 1); + RegionInit(&pWin->clipList, &box, 1); + RegionInit(&pWin->winSize, &box, 1); + RegionInit(&pWin->borderSize, &box, 1); + RegionInit(&pWin->borderClip, &box, 1); pWin->drawable.class = InputOutput; pWin->optional->visual = pScreen->rootVisual; @@ -697,7 +697,7 @@ ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn, #endif /* NXAGENT_SERVER */ BoxRec box; - box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); + box = *(RegionExtents(&pWin->winSize)); /* we do these calculations to avoid overflows */ if (x > box.x1) box.x1 = x; @@ -713,8 +713,8 @@ ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn, box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - REGION_RESET(pScreen, Rgn, &box); - REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize); + RegionReset(Rgn, &box); + RegionIntersect(Rgn, Rgn, &pWin->winSize); } WindowPtr @@ -895,10 +895,10 @@ CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w, pWin->drawable.y = pParent->drawable.y + y + (int)bw; /* set up clip list correctly for unobscured WindowPtr */ - REGION_NULL(pScreen, &pWin->clipList); - REGION_NULL(pScreen, &pWin->borderClip); - REGION_NULL(pScreen, &pWin->winSize); - REGION_NULL(pScreen, &pWin->borderSize); + RegionNull(&pWin->clipList); + RegionNull(&pWin->borderClip); + RegionNull(&pWin->winSize); + RegionNull(&pWin->borderSize); pHead = RealChildHead(pParent); if (pHead) @@ -979,17 +979,17 @@ FreeWindowResources(register WindowPtr pWin) DeleteWindowFromAnySaveSet(pWin); DeleteWindowFromAnySelections(pWin); DeleteWindowFromAnyEvents(pWin, TRUE); - REGION_UNINIT(pScreen, &pWin->clipList); - REGION_UNINIT(pScreen, &pWin->winSize); - REGION_UNINIT(pScreen, &pWin->borderClip); - REGION_UNINIT(pScreen, &pWin->borderSize); + RegionUninit(&pWin->clipList); + RegionUninit(&pWin->winSize); + RegionUninit(&pWin->borderClip); + RegionUninit(&pWin->borderSize); #ifdef SHAPE if (wBoundingShape (pWin)) - REGION_DESTROY(pScreen, wBoundingShape (pWin)); + RegionDestroy(wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_DESTROY(pScreen, wClipShape (pWin)); + RegionDestroy(wClipShape (pWin)); if (wInputShape (pWin)) - REGION_DESTROY(pScreen, wInputShape (pWin)); + RegionDestroy(wInputShape (pWin)); #endif if (pWin->borderIsPixel == FALSE) (*pScreen->DestroyPixmap)(pWin->border.pixmap); @@ -1679,10 +1679,10 @@ PatchUp: { RegionRec exposed; - REGION_NULL(pScreen, &exposed); - REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); + RegionNull(&exposed); + RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize); (*pWin->drawable.pScreen->PaintWindowBorder)(pWin, &exposed, PW_BORDER); - REGION_UNINIT(pScreen, &exposed); + RegionUninit(&exposed); } return error; } @@ -1823,19 +1823,19 @@ CreateUnclippedWinSize (register WindowPtr pWin) box.y1 = pWin->drawable.y; box.x2 = pWin->drawable.x + (int) pWin->drawable.width; box.y2 = pWin->drawable.y + (int) pWin->drawable.height; - pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); + pRgn = RegionCreate(&box, 1); #ifdef SHAPE if (wBoundingShape (pWin) || wClipShape (pWin)) { #ifndef NXAGENT_SERVER ScreenPtr pScreen = pWin->drawable.pScreen; #endif /* NXAGENT_SERVER */ - REGION_TRANSLATE(pScreen, pRgn, - pWin->drawable.x, + RegionTranslate(pRgn, - pWin->drawable.x, - pWin->drawable.y); if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); + RegionIntersect(pRgn, pRgn, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, pRgn, pRgn, wClipShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, pWin->drawable.y); + RegionIntersect(pRgn, pRgn, wClipShape (pWin)); + RegionTranslate(pRgn, pWin->drawable.x, pWin->drawable.y); } #endif return pRgn; @@ -1853,7 +1853,7 @@ SetWinSize (register WindowPtr pWin) box.y1 = pWin->drawable.y; box.x2 = pWin->drawable.x + pWin->drawable.width; box.y2 = pWin->drawable.y + pWin->drawable.height; - REGION_RESET (pScreen, &pWin->winSize, &box); + RegionReset(&pWin->winSize, &box); } else #endif @@ -1866,15 +1866,15 @@ SetWinSize (register WindowPtr pWin) #ifndef NXAGENT_SERVER ScreenPtr pScreen = pWin->drawable.pScreen; #endif /* NXAGENT_SERVER */ - REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, + RegionTranslate(&pWin->winSize, - pWin->drawable.x, - pWin->drawable.y); if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, + RegionIntersect(&pWin->winSize, &pWin->winSize, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, + RegionIntersect(&pWin->winSize, &pWin->winSize, wClipShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x, + RegionTranslate(&pWin->winSize, pWin->drawable.x, pWin->drawable.y); } #endif @@ -1896,7 +1896,7 @@ SetBorderSize (register WindowPtr pWin) box.y1 = pWin->drawable.y - bw; box.x2 = pWin->drawable.x + pWin->drawable.width + bw; box.y2 = pWin->drawable.y + pWin->drawable.height + bw; - REGION_RESET (pScreen, &pWin->borderSize, &box); + RegionReset(&pWin->borderSize, &box); } else #endif @@ -1909,18 +1909,18 @@ SetBorderSize (register WindowPtr pWin) #ifndef NXAGENT_SERVER ScreenPtr pScreen = pWin->drawable.pScreen; #endif /* NXAGENT_SERVER */ - REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, + RegionTranslate(&pWin->borderSize, - pWin->drawable.x, - pWin->drawable.y); - REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize, + RegionIntersect(&pWin->borderSize, &pWin->borderSize, wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->borderSize, pWin->drawable.x, + RegionTranslate(&pWin->borderSize, pWin->drawable.x, pWin->drawable.y); - REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize, + RegionUnion(&pWin->borderSize, &pWin->borderSize, &pWin->winSize); } #endif } else { - REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize, + RegionCopy(&pWin->borderSize, &pWin->winSize); } } @@ -2135,12 +2135,12 @@ MakeBoundingRegion ( #ifndef NXAGENT_SERVER ScreenPtr pScreen = pWin->drawable.pScreen; #endif /* NXAGENT_SERVER */ - pRgn = REGION_CREATE(pScreen, pBox, 1); + pRgn = RegionCreate(pBox, 1); if (wBoundingShape (pWin)) { - REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x, + RegionTranslate(pRgn, -pWin->origin.x, -pWin->origin.y); - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->origin.x, + RegionIntersect(pRgn, pRgn, wBoundingShape (pWin)); + RegionTranslate(pRgn, pWin->origin.x, pWin->origin.y); } return pRgn; @@ -2162,10 +2162,10 @@ ShapeOverlap ( pScreen = pWin->drawable.pScreen; pWinRgn = MakeBoundingRegion (pWin, pWinBox); pSibRgn = MakeBoundingRegion (pSib, pSibBox); - REGION_INTERSECT(pScreen, pWinRgn, pWinRgn, pSibRgn); - ret = REGION_NOTEMPTY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pSibRgn); + RegionIntersect(pWinRgn, pWinRgn, pSibRgn); + ret = RegionNotEmpty(pWinRgn); + RegionDestroy(pWinRgn); + RegionDestroy(pSibRgn); return ret; } #endif @@ -2296,7 +2296,7 @@ WhereDoIGoInTheStack( else if (pSib) { if ((IsSiblingAboveMe(pWin, pSib) == Above) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) + (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)) return(pFirst); else return(pWin->nextSib); @@ -2311,7 +2311,7 @@ WhereDoIGoInTheStack( else if (pSib) { if ((IsSiblingAboveMe(pWin, pSib) == Below) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) + (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)) return NullWindow; else return(pWin->nextSib); @@ -2325,7 +2325,7 @@ WhereDoIGoInTheStack( return(pWin->nextSib); else if (pSib) { - if (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT) + if (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT) { if (IsSiblingAboveMe(pWin, pSib) == Above) return(pFirst); @@ -3069,10 +3069,10 @@ MapWindow(register WindowPtr pWin, ClientPtr client) (*pScreen->ClipNotify) (pWin, 0, 0); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree)(NullWindow, pWin, VTMap); - REGION_NULL(pScreen, &temp); - REGION_COPY(pScreen, &temp, &pWin->clipList); + RegionNull(&temp); + RegionCopy(&temp, &pWin->clipList); (*pScreen->WindowExposures) (pWin, &temp, NullRegion); - REGION_UNINIT(pScreen, &temp); + RegionUninit(&temp); } nxagentFlushConfigureWindow(); @@ -3478,7 +3478,7 @@ VisibleBoundingBoxFromPoint(register WindowPtr pWin, int x, int y, BoxPtr box) { if (!pWin->realized) return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->clipList, x, y, box)) + if (RegionContainsPoint(&pWin->clipList, x, y, box)) return(TRUE); return(FALSE); } @@ -3494,10 +3494,10 @@ PointInWindowIsVisible(register WindowPtr pWin, int x, int y) if (!pWin->realized) return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip, + if (RegionContainsPoint(&pWin->borderClip, x, y, &box) && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box))) @@ -3513,12 +3513,12 @@ NotClippedByChildren(register WindowPtr pWin) RegionPtr pReg; pScreen = pWin->drawable.pScreen; - pReg = REGION_CREATE(pScreen, NullBox, 1); + pReg = RegionCreate(NullBox, 1); if (pWin->parent || screenIsSaved != SCREEN_SAVER_ON || !HasSaverWindow (pWin->drawable.pScreen->myNum)) { - REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize); + RegionIntersect(pReg, &pWin->borderClip, &pWin->winSize); } return(pReg); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index 1dbd059ac..cd2234492 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -160,11 +160,11 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, box.x2 = width; box.y2 = height; - pPixmapPriv -> corruptedRegion = REGION_CREATE(pPixmap -> drawable.pScreen, &box, 1); + pPixmapPriv -> corruptedRegion = RegionCreate(&box, 1); } else { - pPixmapPriv -> corruptedRegion = REGION_CREATE(pPixmap -> drawable.pScreen, (BoxRec *) NULL, 1); + pPixmapPriv -> corruptedRegion = RegionCreate((BoxRec *) NULL, 1); } pPixmapPriv -> corruptedBackground = 0; @@ -269,7 +269,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, pVirtualPriv -> isVirtual = True; pVirtualPriv -> isShared = nxagentShmPixmapTrap; - pVirtualPriv -> corruptedRegion = REGION_CREATE(pVirtual -> drawable.pScreen, (BoxRec *) NULL, 1); + pVirtualPriv -> corruptedRegion = RegionCreate((BoxRec *) NULL, 1); pVirtualPriv -> corruptedBackground = 0; @@ -444,7 +444,7 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap) if (pPixmapPriv -> corruptedRegion != NullRegion) { - REGION_DESTROY(pPixmap -> drawable.pScreen, pPixmapPriv -> corruptedRegion); + RegionDestroy(pPixmapPriv -> corruptedRegion); pPixmapPriv -> corruptedRegion = NullRegion; } @@ -512,7 +512,7 @@ Bool nxagentDestroyVirtualPixmap(PixmapPtr pPixmap) if (pVirtualPriv -> corruptedRegion != NullRegion) { - REGION_DESTROY(pVirtual -> drawable.pScreen, pVirtualPriv -> corruptedRegion); + RegionDestroy(pVirtualPriv -> corruptedRegion); pVirtualPriv -> corruptedRegion = NullRegion; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 8bf1ac0bf..de1ad1207 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -1240,7 +1240,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1, glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1); - if (REGION_NIL(pRegion) == 1) + if (RegionNil(pRegion) == 1) { #ifdef TEST fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n", @@ -1602,24 +1602,24 @@ void nxagentCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, (op == PictOpSrc || (op == PictOpOver && color -> alpha == 0xffff))) { - rectRegion = RECTS_TO_REGION(pDst -> pDrawable -> pScreen, nRect, rects, CT_REGION); + rectRegion = RegionFromRects(nRect, rects, CT_REGION); if (pDst -> clientClipType != CT_NONE) { RegionRec tmpRegion; - REGION_INIT(pDst -> pDrawable -> pScreen, &tmpRegion, NullBox, 1); + RegionInit(&tmpRegion, NullBox, 1); - REGION_COPY(pDst -> pDrawable -> pScreen, &tmpRegion, (RegionPtr) pDst -> clientClip); + RegionCopy(&tmpRegion, (RegionPtr) pDst -> clientClip); if (pDst -> clipOrigin.x != 0 || pDst -> clipOrigin.y != 0) { - REGION_TRANSLATE(pDst -> pDrawable -> pScreen, &tmpRegion, pDst -> clipOrigin.x, pDst -> clipOrigin.y); + RegionTranslate(&tmpRegion, pDst -> clipOrigin.x, pDst -> clipOrigin.y); } - REGION_INTERSECT(pDst -> pDrawable -> pScreen, rectRegion, rectRegion, &tmpRegion); + RegionIntersect(rectRegion, rectRegion, &tmpRegion); - REGION_UNINIT(pDst -> pDrawable -> pScreen, &tmpRegion); + RegionUninit(&tmpRegion); } #ifdef TEST @@ -1629,7 +1629,7 @@ void nxagentCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, nxagentUnmarkCorruptedRegion(pDst -> pDrawable, rectRegion); - REGION_DESTROY(pDrawable -> pScreen, rectRegion); + RegionDestroy(rectRegion); } XRenderFillRectangles(nxagentDisplay, @@ -1716,7 +1716,7 @@ FIXME: Is this useful or just a waste of bandwidth? */ if (nxagentDrawableStatus(pDst -> pDrawable) == NotSynchronized && - RECT_IN_REGION(pDst -> pDrawable -> pScreen, nxagentCorruptedRegion(pDst -> pDrawable), + RegionContainsRect(nxagentCorruptedRegion(pDst -> pDrawable), nxagentTrapezoidExtents) == rgnIN) { #ifdef TEST diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index a677b7eb4..6131775d9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2147,8 +2147,8 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) { 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; } @@ -2167,18 +2167,18 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_INIT (pScreen, &pWin->winSize, &box, 1); - REGION_INIT (pScreen, &pWin->borderSize, &box, 1); + RegionInit(&pWin->winSize, &box, 1); + RegionInit(&pWin->borderSize, &box, 1); if (WasViewable) - REGION_RESET(pScreen, &pWin->borderClip, &box); + RegionReset(&pWin->borderClip, &box); pWin->drawable.width = pScreen->width; pWin->drawable.height = pScreen->height; - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionBreak(&pWin->clipList); } else { - REGION_EMPTY(pScreen, &pWin->borderClip); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionEmpty(&pWin->borderClip); + RegionBreak(&pWin->clipList); } ResizeChildrenWinSize (pWin, 0, 0, 0, 0); @@ -2187,8 +2187,8 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) { if (pWin->backStorage) { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); + pOldClip = RegionCreate(NullBox, 1); + RegionCopy(pOldClip, &pWin->clipList); } if (pWin->firstChild) @@ -2223,7 +2223,7 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) (pWin, 0, 0, pOldClip, pWin->drawable.x, pWin->drawable.y); if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); + RegionDestroy(pOldClip); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -2232,8 +2232,8 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) 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) @@ -2418,10 +2418,10 @@ FIXME: We should try to restore the previously WindowTable[pScreen -> myNum] -> drawable.x = 0; WindowTable[pScreen -> myNum] -> drawable.y = 0; - REGION_INIT(pScreen, &WindowTable[pScreen -> myNum] -> borderSize, &box, 1); - REGION_INIT(pScreen, &WindowTable[pScreen -> myNum] -> winSize, &box, 1); - REGION_INIT(pScreen, &WindowTable[pScreen -> myNum] -> clipList, &box, 1); - REGION_INIT(pScreen, &WindowTable[pScreen -> myNum] -> borderClip, &box, 1); + RegionInit(&WindowTable[pScreen -> myNum] -> borderSize, &box, 1); + RegionInit(&WindowTable[pScreen -> myNum] -> winSize, &box, 1); + RegionInit(&WindowTable[pScreen -> myNum] -> clipList, &box, 1); + RegionInit(&WindowTable[pScreen -> myNum] -> borderClip, &box, 1); (*pScreen -> PositionWindow)(WindowTable[pScreen -> myNum], 0, 0); @@ -2819,7 +2819,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) XFreeGC(nxagentDisplay, gc); - REGION_INIT(pScreen, &nxagentShadowUpdateRegion, (BoxRec*)NULL, 1); + RegionInit(&nxagentShadowUpdateRegion, (BoxRec*)NULL, 1); return 0; } @@ -2973,14 +2973,14 @@ int nxagentShadowSendUpdates(int *suspended) { *suspended = 0; - if (REGION_NIL(&nxagentShadowUpdateRegion) == 1) + if (RegionNil(&nxagentShadowUpdateRegion) == 1) { return 0; } nxagentMarkCorruptedRegion((DrawablePtr)nxagentShadowPixmapPtr, &nxagentShadowUpdateRegion); - REGION_EMPTY(nxagentShadowPixmapPtr -> drawable.pScreen, &nxagentShadowUpdateRegion); + RegionEmpty(&nxagentShadowUpdateRegion); return 1; } @@ -3002,9 +3002,9 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr int overlap; - REGION_NULL(pScreen, &updateRegion); + RegionNull(&updateRegion); - REGION_NULL(pScreen, &tempRegion); + RegionNull(&tempRegion); #ifdef __CYGWIN32__ @@ -3116,15 +3116,15 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr box.y1 = y; box.y2 = y + height; - REGION_INIT(pScreen, &tempRegion, &box, 1); + RegionInit(&tempRegion, &box, 1); - REGION_APPEND(pScreen, &updateRegion, &tempRegion); + RegionAppend(&updateRegion, &tempRegion); - REGION_UNINIT(pScreen, &tempRegion); + RegionUninit(&tempRegion); - REGION_VALIDATE(pScreen, &updateRegion, &overlap); + RegionValidate(&updateRegion, &overlap); - REGION_UNION(pScreen, &nxagentShadowUpdateRegion, &nxagentShadowUpdateRegion, &updateRegion); + RegionUnion(&nxagentShadowUpdateRegion, &nxagentShadowUpdateRegion, &updateRegion); } if (tBuffer) @@ -3132,7 +3132,7 @@ int nxagentShadowPoll(PixmapPtr nxagentShadowPixmapPtr, GCPtr nxagentShadowGCPtr xfree(tBuffer); } - REGION_UNINIT(pScreen, &updateRegion); + RegionUninit(&updateRegion); } else if (result == -1) { @@ -4131,8 +4131,8 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, pPrivPixmap -> isBackingPixmap = 1; - fbCopyWindowProc(&pWin -> drawable, &pVirtualPixmap -> drawable, 0, REGION_RECTS(prgnSave), - REGION_NUM_RECTS(prgnSave), xorg, yorg, FALSE, FALSE, 0, 0); + fbCopyWindowProc(&pWin -> drawable, &pVirtualPixmap -> drawable, 0, RegionRects(prgnSave), + RegionNumRects(prgnSave), xorg, yorg, FALSE, FALSE, 0, 0); pDrawable = &pWin -> drawable; @@ -4145,34 +4145,34 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, * Coordinates are relative to the window. */ - REGION_INIT(pWin -> pScreen, &cleanRegion, NullBox, 1); + RegionInit(&cleanRegion, NullBox, 1); - REGION_COPY(pWin -> pScreen, &cleanRegion, nxagentCorruptedRegion((DrawablePtr) pWin)); + RegionCopy(&cleanRegion, nxagentCorruptedRegion((DrawablePtr) pWin)); /* * Subtract the corrupted region from the saved region. */ - REGION_SUBTRACT(pWin -> pScreen, &pBackingStore -> SavedRegion, &pBackingStore -> SavedRegion, &cleanRegion); + RegionSubtract(&pBackingStore -> SavedRegion, &pBackingStore -> SavedRegion, &cleanRegion); /* * Translate the corrupted region. Coordinates * are relative to the backing store pixmap. */ - REGION_TRANSLATE(pWin -> pScreen, &cleanRegion, -pBackingStore -> x, -pBackingStore -> y); + RegionTranslate(&cleanRegion, -pBackingStore -> x, -pBackingStore -> y); /* * Compute the clean region to be saved: subtract * the corrupted region from the region to be saved. */ - REGION_SUBTRACT(pWin -> pScreen, &cleanRegion, prgnSave, &cleanRegion); + RegionSubtract(&cleanRegion, prgnSave, &cleanRegion); - nRects = REGION_NUM_RECTS(&cleanRegion); + nRects = RegionNumRects(&cleanRegion); size = nRects * sizeof(*pRects); pRects = (XRectangle *) xalloc(size); - pBox = REGION_RECTS(&cleanRegion); + pBox = RegionRects(&cleanRegion); for (i = nRects; i-- > 0;) { @@ -4186,9 +4186,9 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, xfree((char *) pRects); - extents = *REGION_EXTENTS(pWin -> pScreen, &cleanRegion); + extents = *RegionExtents(&cleanRegion); - REGION_UNINIT(pWin -> pScreen, &cleanRegion); + RegionUninit(&cleanRegion); xDst = extents.x1; yDst = extents.y1; @@ -4248,15 +4248,15 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, * root window size. */ - REGION_INTERSECT(pWin -> pScreen, prgnRestore, prgnRestore, + RegionIntersect(prgnRestore, prgnRestore, &WindowTable[pWin -> drawable.pScreen -> myNum] -> winSize); pBackingStore = (miBSWindowPtr) pWin -> backStorage; pVirtualPixmap = nxagentVirtualPixmap(pPixmap); - fbCopyWindowProc(&pVirtualPixmap -> drawable, &pWin -> drawable, 0, REGION_RECTS(prgnRestore), - REGION_NUM_RECTS(prgnRestore), -xorg, -yorg, FALSE, FALSE, 0, 0); + fbCopyWindowProc(&pVirtualPixmap -> drawable, &pWin -> drawable, 0, RegionRects(prgnRestore), + RegionNumRects(prgnRestore), -xorg, -yorg, FALSE, FALSE, 0, 0); pDrawable = &pVirtualPixmap -> drawable; @@ -4268,7 +4268,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, * Translate the reference point to the origin of the window. */ - REGION_TRANSLATE(pWin -> drawable.pScreen, prgnRestore, + RegionTranslate(prgnRestore, -pWin -> drawable.x - pWin -> borderWidth, -pWin -> drawable.y - pWin -> borderWidth); @@ -4276,26 +4276,26 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, if (nxagentDrawableStatus((DrawablePtr) pPixmap) == NotSynchronized) { - clipRegion = REGION_CREATE(pPixmap -> drawable -> pScreen, NullBox, 1); + clipRegion = RegionCreate(NullBox, 1); - REGION_COPY(pPixmap -> drawable -> pScreen, clipRegion, + RegionCopy(clipRegion, nxagentCorruptedRegion((DrawablePtr) pPixmap)); /* * Translate the reference point to the origin of the window. */ - REGION_TRANSLATE(pPixmap -> drawable -> pScreen, clipRegion, + RegionTranslate(clipRegion, pBackingStore -> x, pBackingStore -> y); - REGION_INTERSECT(pPixmap -> drawable -> pScreen, clipRegion, prgnRestore, clipRegion); + RegionIntersect(clipRegion, prgnRestore, clipRegion); /* * Subtract the corrupted region from the saved areas. * miBSRestoreAreas will return the exposure region. */ - REGION_SUBTRACT(pPixmap -> drawable -> pScreen, &pBackingStore->SavedRegion, + RegionSubtract(&pBackingStore->SavedRegion, &pBackingStore->SavedRegion, clipRegion); /* @@ -4304,24 +4304,24 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, if (nxagentRemoteExposeRegion != NULL) { - REGION_TRANSLATE(pPixmap -> drawable -> pScreen, clipRegion, pWin -> drawable.x, pWin -> drawable.y); + RegionTranslate(clipRegion, pWin -> drawable.x, pWin -> drawable.y); - REGION_UNION(pScreen, nxagentRemoteExposeRegion, nxagentRemoteExposeRegion, clipRegion); + RegionUnion(nxagentRemoteExposeRegion, nxagentRemoteExposeRegion, clipRegion); - REGION_TRANSLATE(pPixmap -> drawable -> pScreen, clipRegion, -pWin -> drawable.x, -pWin -> drawable.y); + RegionTranslate(clipRegion, -pWin -> drawable.x, -pWin -> drawable.y); } /* * Compute the region to be restored. */ - REGION_SUBTRACT(pPixmap -> drawable -> pScreen, clipRegion, prgnRestore, clipRegion); + RegionSubtract(clipRegion, prgnRestore, clipRegion); } - nRects = REGION_NUM_RECTS(clipRegion); + nRects = RegionNumRects(clipRegion); size = nRects * sizeof(*pRects); pRects = (XRectangle *) xalloc(size); - pBox = REGION_RECTS(clipRegion); + pBox = RegionRects(clipRegion); for (i = nRects; i-- > 0;) { @@ -4335,7 +4335,7 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, xfree(pRects); - extents = *REGION_EXTENTS(pWin -> pScreen, clipRegion); + extents = *RegionExtents(clipRegion); xDst = extents.x1; yDst = extents.y1; @@ -4355,14 +4355,14 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, if (clipRegion != NULL && clipRegion != prgnRestore) { - REGION_DESTROY(pPixmap -> drawable -> pScreen, clipRegion); + RegionDestroy(clipRegion); } /* * Restore the reference point to the origin of the screen. */ - REGION_TRANSLATE(pWin -> drawable.pScreen, prgnRestore, + RegionTranslate(prgnRestore, pWin -> drawable.x - pWin -> borderWidth, pWin -> drawable.y + pWin -> borderWidth); @@ -4437,11 +4437,11 @@ void nxagentShadowAdaptToRatio(void) box.x2 = nxagentShadowPixmapPtr -> drawable.width; box.y2 = nxagentShadowPixmapPtr -> drawable.height; - REGION_INIT(pScreen, ®ion, &box, 1); + RegionInit(®ion, &box, 1); nxagentMarkCorruptedRegion((DrawablePtr)nxagentShadowPixmapPtr, ®ion); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); } void nxagentPrintGeometry() diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 4cc2ea607..1840328e4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -502,7 +502,7 @@ void nxagentReleaseSplit(DrawablePtr pDrawable) (void *) pDrawable); #endif - REGION_DESTROY(pDrawable -> pScreen, pResource -> region); + RegionDestroy(pResource -> region); pResource -> region = NullRegion; } @@ -623,11 +623,11 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion) * streamed. */ - REGION_INIT(pDrawable -> pScreen, &tmpRegion, NullBox, 1); + RegionInit(&tmpRegion, NullBox, 1); - REGION_INTERSECT(pDrawable -> pScreen, &tmpRegion, pResource -> region, pRegion); + RegionIntersect(&tmpRegion, pResource -> region, pRegion); - if (REGION_NIL(&tmpRegion) == 0) + if (RegionNil(&tmpRegion) == 0) { #ifdef TEST fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid " @@ -644,7 +644,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion) } #endif - REGION_UNINIT(pDrawable -> pScreen, &tmpRegion); + RegionUninit(&tmpRegion); } } @@ -1097,9 +1097,9 @@ void nxagentHandleEndSplitEvent(int resource) if (pResource -> drawable != NULL && pResource -> region != NullRegion) { - if (REGION_NIL(pResource -> region) == 0) + if (RegionNil(pResource -> region) == 0) { - REGION_SUBTRACT(pResource -> drawable -> pScreen, + RegionSubtract( nxagentCorruptedRegion(pResource -> drawable), nxagentCorruptedRegion(pResource -> drawable), pResource -> region); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 782ab9c9c..9201df197 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -388,7 +388,7 @@ FIXME: We need to set save under on the real display? nxagentWindowPriv(pWin) -> visibilityState = VisibilityUnobscured; - nxagentWindowPriv(pWin) -> corruptedRegion = REGION_CREATE(pWin -> drawable.pScreen, NULL, 1); + nxagentWindowPriv(pWin) -> corruptedRegion = RegionCreate(NULL, 1); nxagentWindowPriv(pWin) -> hasTransparentChildren = 0; @@ -486,8 +486,8 @@ FIXME: Do all the windows for which nxagentWindowTopLevel(pWin) #endif /* SHAPE */ #else #ifdef SHAPE - nxagentWindowPriv(pWin)->boundingShape = REGION_CREATE(pWin->drawable.pScreen, NULL, 1); - nxagentWindowPriv(pWin)->clipShape = REGION_CREATE(pWin->drawable.pScreen, NULL, 1); + nxagentWindowPriv(pWin)->boundingShape = RegionCreate(NULL, 1); + nxagentWindowPriv(pWin)->clipShape = RegionCreate(NULL, 1); #endif /* SHAPE */ #endif @@ -546,14 +546,14 @@ Bool nxagentDestroyWindow(WindowPtr pWin) { if (nxagentExposeQueue.exposures[i].localRegion != NullRegion) { - REGION_DESTROY(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[i].localRegion); + RegionDestroy(nxagentExposeQueue.exposures[i].localRegion); } nxagentExposeQueue.exposures[i].localRegion = NullRegion; if (nxagentExposeQueue.exposures[i].remoteRegion != NullRegion) { - REGION_DESTROY(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[i].remoteRegion); + RegionDestroy(nxagentExposeQueue.exposures[i].remoteRegion); } nxagentExposeQueue.exposures[i].remoteRegion = NullRegion; @@ -576,13 +576,13 @@ Bool nxagentDestroyWindow(WindowPtr pWin) if (pWindowPriv->boundingShape) { - REGION_DESTROY(pWin->drawable.pScreen, + RegionDestroy( pWindowPriv->boundingShape); } if (pWindowPriv->clipShape) { - REGION_DESTROY(pWin->drawable.pScreen, + RegionDestroy( pWindowPriv->clipShape); } @@ -590,17 +590,17 @@ Bool nxagentDestroyWindow(WindowPtr pWin) #else - REGION_DESTROY(pWin->drawable.pScreen, + RegionDestroy( pWindowPriv->boundingShape); - REGION_DESTROY(pWin->drawable.pScreen, + RegionDestroy( pWindowPriv->clipShape); #endif if (pWindowPriv -> corruptedRegion) { - REGION_DESTROY(pWin -> drawable.pScreen, + RegionDestroy( pWindowPriv -> corruptedRegion); pWindowPriv -> corruptedRegion = NULL; @@ -1342,7 +1342,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) if (nxagentExposeQueue.exposures[i].pWindow == pWin && nxagentExposeQueue.exposures[i].remoteRegion != NullRegion) { - REGION_TRANSLATE(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[i].remoteRegion, offX, offY); + RegionTranslate(nxagentExposeQueue.exposures[i].remoteRegion, offX, offY); } } } @@ -1989,9 +1989,9 @@ void nxagentPaintWindowBackground(pWin, pRegion, what) { BoxPtr pBox; - pBox = REGION_RECTS(pRegion); + pBox = RegionRects(pRegion); - for (i = 0; i < REGION_NUM_RECTS(pRegion); i++) + for (i = 0; i < RegionNumRects(pRegion); i++) { XClearArea(nxagentDisplay, nxagentWindow(pWin), pBox[i].x1 - pWin->drawable.x, @@ -2015,13 +2015,13 @@ void nxagentPaintWindowBackground(pWin, pRegion, what) * so we need to clip ourselves. */ - REGION_INIT(pWin -> drawable.pScreen, &temp, NullBox, 1); + RegionInit(&temp, NullBox, 1); - REGION_INTERSECT(pWin -> drawable.pScreen, &temp, pRegion, &pWin -> clipList); + RegionIntersect(&temp, pRegion, &pWin -> clipList); nxagentFrameBufferPaintWindow(pWin, &temp, what); - REGION_UNINIT(pWin -> drawable.pScreen, &temp); + RegionUninit(&temp); } void nxagentPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) @@ -2034,13 +2034,13 @@ void nxagentPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) * so we need to clip ourselves. */ - REGION_INIT(pWin -> drawable.pScreen, &temp, NullBox, 1); + RegionInit(&temp, NullBox, 1); - REGION_INTERSECT(pWin -> drawable.pScreen, &temp, pRegion, &pWin -> borderClip); + RegionIntersect(&temp, pRegion, &pWin -> borderClip); nxagentFrameBufferPaintWindow(pWin, &temp, what); - REGION_UNINIT(pWin -> drawable.pScreen, &temp); + RegionUninit(&temp); } void nxagentCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion) @@ -2149,29 +2149,29 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo nxagentExposeArrayIsInitialized = 1; } - REGION_INIT(pWin -> drawable.pScreen, &temp, (BoxRec *) NULL, 1); + RegionInit(&temp, (BoxRec *) NULL, 1); if (pRgn != NULL) { - if (REGION_NUM_RECTS(pRgn) > RECTLIMIT) + if (RegionNumRects(pRgn) > RECTLIMIT) { - box = *REGION_EXTENTS(pWin -> drawable.pScreen, pRgn); + box = *RegionExtents(pRgn); - REGION_EMPTY(pWin -> drawable.pScreen, pRgn); - REGION_INIT(pWin -> drawable.pScreen, pRgn, &box, 1); + RegionEmpty(pRgn); + RegionInit(pRgn, &box, 1); } - REGION_UNION(pWin -> drawable.pScreen, &temp, &temp, pRgn); + RegionUnion(&temp, &temp, pRgn); } if (other_exposed != NULL) { - REGION_UNION(pWin -> drawable.pScreen, &temp, &temp, other_exposed); + RegionUnion(&temp, &temp, other_exposed); } - if (REGION_NIL(&temp) == 0) + if (RegionNil(&temp) == 0) { - REGION_TRANSLATE(pWin -> drawable.pScreen, &temp, + RegionTranslate(&temp, -(pWin -> drawable.x), -(pWin -> drawable.y)); if (nxagentExposeQueue.length < EXPOSED_SIZE) @@ -2183,15 +2183,15 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo nxagentExposeQueue.exposures[index].pWindow = pWin; - nxagentExposeQueue.exposures[index].localRegion = REGION_CREATE(pwin -> drawable.pScreen, NULL, 1); + nxagentExposeQueue.exposures[index].localRegion = RegionCreate(NULL, 1); if (nxagentOption(Rootless) && nxagentWindowPriv(pWin) && (nxagentWindowPriv(pWin) -> isMapped == 0 || nxagentWindowPriv(pWin) -> visibilityState != VisibilityUnobscured)) { - nxagentExposeQueue.exposures[index].remoteRegion = REGION_CREATE(pwin -> drawable.pScreen, NULL, 1); + nxagentExposeQueue.exposures[index].remoteRegion = RegionCreate(NULL, 1); - REGION_UNION(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[index].remoteRegion, + RegionUnion(nxagentExposeQueue.exposures[index].remoteRegion, nxagentExposeQueue.exposures[index].remoteRegion, &temp); #ifdef TEST @@ -2201,7 +2201,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo } else { - REGION_UNION(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[index].localRegion, + RegionUnion(nxagentExposeQueue.exposures[index].localRegion, nxagentExposeQueue.exposures[index].localRegion, &temp); #ifdef TEST @@ -2234,21 +2234,21 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo (nxagentWindowPriv(pWin) -> isMapped == 0 || nxagentWindowPriv(pWin) -> visibilityState != VisibilityUnobscured)) { - REGION_UNINIT(pWin -> drawable.pScreen, &temp); + RegionUninit(&temp); return; } } else { - REGION_UNINIT(pWin -> drawable.pScreen, &temp); + RegionUninit(&temp); #ifdef TEST fprintf(stderr, "nxagentWindowExposures: WARNING! Reached maximum size of collect exposures vector.\n"); #endif - if ((pRgn != NULL && REGION_NOTEMPTY(pWin -> drawable.pScreen, pRgn) != 0) || - (other_exposed != NULL && REGION_NOTEMPTY(pWin -> drawable.pScreen, other_exposed) != 0)) + if ((pRgn != NULL && RegionNotEmpty(pRgn) != 0) || + (other_exposed != NULL && RegionNotEmpty(other_exposed) != 0)) { nxagentUnmarkExposedRegion(pWin, pRgn, other_exposed); @@ -2259,11 +2259,11 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo } } - REGION_UNINIT(pWin -> drawable.pScreen, &temp); + RegionUninit(&temp); } - if ((pRgn != NULL && REGION_NOTEMPTY(pWin -> drawable.pScreen, pRgn) != 0) || - (other_exposed != NULL && REGION_NOTEMPTY(pWin -> drawable.pScreen, other_exposed) != 0)) + if ((pRgn != NULL && RegionNotEmpty(pRgn) != 0) || + (other_exposed != NULL && RegionNotEmpty(other_exposed) != 0)) { nxagentUnmarkExposedRegion(pWin, pRgn, other_exposed); @@ -2283,11 +2283,11 @@ static Bool nxagentRegionEqual(RegionPtr pReg1, RegionPtr pReg2) if (pReg1 == NullRegion || pReg2 == NullRegion) return False; - pBox1 = REGION_RECTS(pReg1); - n1 = REGION_NUM_RECTS(pReg1); + pBox1 = RegionRects(pReg1); + n1 = RegionNumRects(pReg1); - pBox2 = REGION_RECTS(pReg2); - n2 = REGION_NUM_RECTS(pReg2); + pBox2 = RegionRects(pReg2); + n2 = RegionNumRects(pReg2); if (n1 != n2) return False; @@ -2326,23 +2326,23 @@ void nxagentShapeWindow(WindowPtr pWin) { #ifdef DEBUG fprintf(stderr, "nxagentShapeWindow: wBounding shape has [%ld] rects.\n", - REGION_NUM_RECTS(wBoundingShape(pWin))); + RegionNumRects(wBoundingShape(pWin))); #endif #ifdef NXAGENT_SHAPE2 if (!nxagentWindowPriv(pWin)->boundingShape) { - nxagentWindowPriv(pWin)->boundingShape = REGION_CREATE(pWin->drawable.pScreen, NULL, 1); + nxagentWindowPriv(pWin)->boundingShape = RegionCreate(NULL, 1); } #endif - REGION_COPY(pWin->drawable.pScreen, + RegionCopy( nxagentWindowPriv(pWin)->boundingShape, wBoundingShape(pWin)); reg = XCreateRegion(); - pBox = REGION_RECTS(nxagentWindowPriv(pWin)->boundingShape); + pBox = RegionRects(nxagentWindowPriv(pWin)->boundingShape); for (i = 0; - i < REGION_NUM_RECTS(nxagentWindowPriv(pWin)->boundingShape); + i < RegionNumRects(nxagentWindowPriv(pWin)->boundingShape); i++) { rect.x = pBox[i].x1; @@ -2365,7 +2365,7 @@ void nxagentShapeWindow(WindowPtr pWin) fprintf(stderr, "nxagentShapeWindow: wBounding shape does not exist. Removing the shape.\n"); #endif - REGION_EMPTY(pWin->drawable.pScreen, + RegionEmpty( nxagentWindowPriv(pWin)->boundingShape); #ifndef NXAGENT_SHAPE @@ -2386,23 +2386,23 @@ void nxagentShapeWindow(WindowPtr pWin) { #ifdef DEBUG fprintf(stderr, "nxagentShapeWindow: wClip shape has [%ld] rects.\n", - REGION_NUM_RECTS(wClipShape(pWin))); + RegionNumRects(wClipShape(pWin))); #endif #ifdef NXAGENT_SHAPE2 if (!nxagentWindowPriv(pWin)->clipShape) { - nxagentWindowPriv(pWin)->clipShape = REGION_CREATE(pWin->drawable.pScreen, NULL, 1); + nxagentWindowPriv(pWin)->clipShape = RegionCreate(NULL, 1); } #endif - REGION_COPY(pWin->drawable.pScreen, + RegionCopy( nxagentWindowPriv(pWin)->clipShape, wClipShape(pWin)); reg = XCreateRegion(); - pBox = REGION_RECTS(nxagentWindowPriv(pWin)->clipShape); + pBox = RegionRects(nxagentWindowPriv(pWin)->clipShape); for (i = 0; - i < REGION_NUM_RECTS(nxagentWindowPriv(pWin)->clipShape); + i < RegionNumRects(nxagentWindowPriv(pWin)->clipShape); i++) { rect.x = pBox[i].x1; @@ -2425,7 +2425,7 @@ void nxagentShapeWindow(WindowPtr pWin) fprintf(stderr, "nxagentShapeWindow: wClip shape does not exist. Removing the shape.\n"); #endif - REGION_EMPTY(pWin->drawable.pScreen, + RegionEmpty( nxagentWindowPriv(pWin)->clipShape); #ifndef NXAGENT_SHAPE @@ -2450,15 +2450,15 @@ static int nxagentForceExposure(WindowPtr pWin, void * ptr) Box.x2 = Box.x1 + pWin->drawable.width; Box.y2 = Box.y1 + pWin->drawable.height; - exposedRgn = REGION_CREATE(pWin->drawable.pScreen, &Box, 1); - REGION_INTERSECT(pWin->drawable.pScreen, exposedRgn, exposedRgn, &pRoot->winSize); + exposedRgn = RegionCreate(&Box, 1); + RegionIntersect(exposedRgn, exposedRgn, &pRoot->winSize); - if (exposedRgn != NULL && REGION_NOTEMPTY(pWin -> drawable.pScreen, exposedRgn) != 0) + if (exposedRgn != NULL && RegionNotEmpty(exposedRgn) != 0) { miWindowExposures(pWin, exposedRgn, NullRegion); } - REGION_DESTROY(pWin->drawable.pScreen, exposedRgn); + RegionDestroy(exposedRgn); } return WT_WALKCHILDREN; @@ -3186,14 +3186,14 @@ static void nxagentReconfigureWindow(void * param0, XID param1, void * data_buff #ifdef SHAPE if (nxagentWindowPriv(pWin) -> boundingShape) { - REGION_DESTROY(pWin -> drawable.pScreen, + RegionDestroy( nxagentWindowPriv(pWin) -> boundingShape); nxagentWindowPriv(pWin) -> boundingShape = NULL; } if (nxagentWindowPriv(pWin) -> clipShape) { - REGION_DESTROY(pWin -> drawable.pScreen, + RegionDestroy( nxagentWindowPriv(pWin) -> clipShape); nxagentWindowPriv(pWin) -> clipShape = NULL; } @@ -3740,7 +3740,7 @@ void nxagentEmptyBackingStoreRegion(void * param0, XID param1, void * data_buffe if (pBackingStore != NULL) { - REGION_EMPTY(pWin -> pScreen, &pBackingStore->SavedRegion); + RegionEmpty(&pBackingStore->SavedRegion); #ifdef TEST fprintf(stderr, "nxagentEmptyBackingStoreRegion: Emptying saved region for window at [%p].\n", (void*) pWin); |