aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/GC.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-03-16 11:11:43 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-05-02 14:53:06 +0200
commit63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4 (patch)
tree3d67994a85c5d8c3a929ab315fbcb617baa6423d /nx-X11/programs/Xserver/hw/nxagent/GC.c
parent28ba877803d8383eac282b873b8e0bb50c8db46b (diff)
downloadnx-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/GC.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/GC.c44
1 files changed, 22 insertions, 22 deletions
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;
}
}