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/nxagent/Screen.c | |
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/nxagent/Screen.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 118 |
1 files changed, 59 insertions, 59 deletions
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() |