aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/miext
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/miext
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/miext')
-rw-r--r--nx-X11/programs/Xserver/miext/cw/cw.c30
-rw-r--r--nx-X11/programs/Xserver/miext/cw/cw_ops.c4
-rwxr-xr-xnx-X11/programs/Xserver/miext/damage/damage.c86
3 files changed, 60 insertions, 60 deletions
diff --git a/nx-X11/programs/Xserver/miext/cw/cw.c b/nx-X11/programs/Xserver/miext/cw/cw.c
index 8079a0009..9f39b9650 100644
--- a/nx-X11/programs/Xserver/miext/cw/cw.c
+++ b/nx-X11/programs/Xserver/miext/cw/cw.c
@@ -190,8 +190,8 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
XID vals[2];
RegionPtr pCompositeClip;
- pCompositeClip = REGION_CREATE (pScreen, NULL, 0);
- REGION_COPY (pScreen, pCompositeClip, pGC->pCompositeClip);
+ pCompositeClip = RegionCreate(NULL, 0);
+ RegionCopy(pCompositeClip, pGC->pCompositeClip);
/* Either the drawable has changed, or the clip list in the drawable has
* changed. Copy the new clip list over and set the new translated
@@ -397,8 +397,8 @@ cwFillRegionSolid(DrawablePtr pDrawable, RegionPtr pRegion, unsigned long pixel)
NULL, v);
ValidateGC(pDrawable, pGC);
- pBox = REGION_RECTS(pRegion);
- nbox = REGION_NUM_RECTS(pRegion);
+ pBox = RegionRects(pRegion);
+ nbox = RegionNumRects(pRegion);
for (i = 0; i < nbox; i++, pBox++) {
xRectangle rect;
@@ -433,8 +433,8 @@ cwFillRegionTiled(DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
ValidateGC(pDrawable, pGC);
- pBox = REGION_RECTS(pRegion);
- nbox = REGION_NUM_RECTS(pRegion);
+ pBox = RegionRects(pRegion);
+ nbox = RegionNumRects(pRegion);
for (i = 0; i < nbox; i++, pBox++) {
xRectangle rect;
@@ -473,7 +473,7 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
if (pWin && (pWin->backgroundState == BackgroundPixel ||
pWin->backgroundState == BackgroundPixmap))
{
- REGION_TRANSLATE(pScreen, pRegion, x_screen, y_screen);
+ RegionTranslate(pRegion, x_screen, y_screen);
if (pWin->backgroundState == BackgroundPixel) {
cwFillRegionSolid(pBackingDrawable, pRegion,
@@ -483,7 +483,7 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
pWin->background.pixmap, x_off, y_off);
}
- REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen);
+ RegionTranslate(pRegion, -x_screen, -y_screen);
}
}
@@ -509,7 +509,7 @@ cwPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
x_screen = x_off - pWin->drawable.x;
y_screen = y_off - pWin->drawable.y;
- REGION_TRANSLATE(pScreen, pRegion, x_screen, y_screen);
+ RegionTranslate(pRegion, x_screen, y_screen);
if (pWin->borderIsPixel) {
cwFillRegionSolid(pBackingDrawable, pRegion, pWin->border.pixel);
@@ -518,7 +518,7 @@ cwPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
x_off, y_off);
}
- REGION_TRANSLATE(pScreen, pRegion, -x_screen, -y_screen);
+ RegionTranslate(pRegion, -x_screen, -y_screen);
}
SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder);
@@ -545,7 +545,7 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
- pExtents = REGION_EXTENTS(pScreen, prgnSrc);
+ pExtents = RegionExtents(prgnSrc);
pBackingPixmap = (PixmapPtr) cwGetBackingDrawable((DrawablePtr)pWin,
&x_off, &y_off);
@@ -558,15 +558,15 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
dst_y = src_y - dy;
/* Translate region (as required by API) */
- REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy);
+ RegionTranslate(prgnSrc, -dx, -dy);
pGC = GetScratchGC(pBackingPixmap->drawable.depth, pScreen);
/*
* Copy region to GC as clip, aligning as dest clip
*/
- pClip = REGION_CREATE (pScreen, NULL, 0);
- REGION_INTERSECT(pScreen, pClip, &pWin->borderClip, prgnSrc);
- REGION_TRANSLATE(pScreen, pClip,
+ pClip = RegionCreate(NULL, 0);
+ RegionIntersect(pClip, &pWin->borderClip, prgnSrc);
+ RegionTranslate(pClip,
-pBackingPixmap->screen_x,
-pBackingPixmap->screen_y);
diff --git a/nx-X11/programs/Xserver/miext/cw/cw_ops.c b/nx-X11/programs/Xserver/miext/cw/cw_ops.c
index 9e09d0532..e4c53b79f 100644
--- a/nx-X11/programs/Xserver/miext/cw/cw_ops.c
+++ b/nx-X11/programs/Xserver/miext/cw/cw_ops.c
@@ -195,7 +195,7 @@ cwCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy,
dstx, dsty);
if (exposed != NULL)
- REGION_TRANSLATE(pDst->pScreen, exposed, odstx - dstx, odsty - dsty);
+ RegionTranslate(exposed, odstx - dstx, odsty - dsty);
EPILOGUE(pGC);
@@ -223,7 +223,7 @@ cwCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy,
dstx, dsty, plane);
if (exposed != NULL)
- REGION_TRANSLATE(pDst->pScreen, exposed, odstx - dstx, odsty - dsty);
+ RegionTranslate(exposed, odstx - dstx, odsty - dsty);
EPILOGUE(pGC);
diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c
index 0dd788ec3..60e2ae4b5 100755
--- a/nx-X11/programs/Xserver/miext/damage/damage.c
+++ b/nx-X11/programs/Xserver/miext/damage/damage.c
@@ -137,7 +137,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
@@ -152,7 +152,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 &&
@@ -160,22 +160,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;
@@ -223,7 +223,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;
@@ -231,14 +231,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;
}
@@ -253,39 +253,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;
}
@@ -293,14 +293,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
@@ -314,13 +314,13 @@ damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode)
{
RegionRec region;
- REGION_INIT (pDrawable->pScreen, &region, pBox, 1);
+ RegionInit(&region, pBox, 1);
#if DAMAGE_DEBUG_ENABLE
_damageDamageRegion (pDrawable, &region, TRUE, subWindowMode, where);
#else
damageDamageRegion (pDrawable, &region, TRUE, subWindowMode);
#endif
- REGION_UNINIT (pDrawable->pScreen, &region);
+ RegionUninit(&region);
}
static void damageValidateGC(GCPtr, unsigned long, DrawablePtr);
@@ -489,7 +489,7 @@ damageDestroyClip(GCPtr pGC)
#define checkGCDamage(d,g) (getDrawableDamage(d) && \
(!g->pCompositeClip ||\
- REGION_NOTEMPTY(d->pScreen, \
+ RegionNotEmpty(\
g->pCompositeClip)))
#ifdef RENDER
@@ -503,7 +503,7 @@ damageDestroyClip(GCPtr pGC)
}
#define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \
- REGION_NOTEMPTY(pScreen, p->pCompositeClip))
+ RegionNotEmpty(p->pCompositeClip))
static void
damageComposite (CARD8 op,
@@ -1615,9 +1615,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);
@@ -1820,7 +1820,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;
@@ -1909,7 +1909,7 @@ DamageDestroy (DamagePtr pDamage)
{
if (pDamage->damageDestroy)
(*pDamage->damageDestroy) (pDamage, pDamage->closure);
- REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->damage);
+ RegionUninit(&pDamage->damage);
xfree (pDamage);
}
@@ -1921,7 +1921,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)
@@ -1934,22 +1934,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