diff options
author | marha <marha@users.sourceforge.net> | 2010-06-11 12:14:52 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-06-11 12:14:52 +0000 |
commit | 4c61bf84b11e26e6f22648668c95ea760a379163 (patch) | |
tree | 0ac762ab2815eae283dded7447ad7cb5a54b926a /xorg-server/xfixes/region.c | |
parent | e1dabd2ce8be0d70c6c15353b58de256129dfd1f (diff) | |
download | vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.gz vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.bz2 vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.zip |
xserver git update 11/6/2010
Diffstat (limited to 'xorg-server/xfixes/region.c')
-rw-r--r-- | xorg-server/xfixes/region.c | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c index 7b1c40b15..0461ded11 100644 --- a/xorg-server/xfixes/region.c +++ b/xorg-server/xfixes/region.c @@ -39,20 +39,20 @@ RegionResFree (pointer data, XID id) {
RegionPtr pRegion = (RegionPtr) data;
- REGION_DESTROY (0, pRegion);
+ RegionDestroy(pRegion);
return Success;
}
RegionPtr
XFixesRegionCopy (RegionPtr pRegion)
{
- RegionPtr pNew = REGION_CREATE (0, REGION_EXTENTS(0, pRegion),
- REGION_NUM_RECTS(pRegion));
+ RegionPtr pNew = RegionCreate(RegionExtents(pRegion),
+ RegionNumRects(pRegion));
if (!pNew)
return 0;
- if (!REGION_COPY (0, pNew, pRegion))
+ if (!RegionCopy(pNew, pRegion))
{
- REGION_DESTROY (0, pNew);
+ RegionDestroy(pNew);
return 0;
}
return pNew;
@@ -63,7 +63,7 @@ XFixesRegionInit (void) {
RegionResType = CreateNewResourceType(RegionResFree, "XFixesRegion");
- return (RegionResType != 0);
+ return RegionResType != 0;
}
int
@@ -81,7 +81,7 @@ ProcXFixesCreateRegion (ClientPtr client) return BadLength;
things >>= 3;
- pRegion = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED);
+ pRegion = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED);
if (!pRegion)
return BadAlloc;
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
@@ -124,7 +124,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) if (pPixmap->drawable.depth != 1)
return BadMatch;
- pRegion = BITMAP_TO_REGION(pPixmap->drawable.pScreen, pPixmap);
+ pRegion = BitmapToRegion(pPixmap->drawable.pScreen, pPixmap);
if (!pRegion)
return BadAlloc;
@@ -227,7 +227,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) switch (pGC->clientClipType) {
case CT_PIXMAP:
- pRegion = BITMAP_TO_REGION(pGC->pScreen, (PixmapPtr) pGC->clientClip);
+ pRegion = BitmapToRegion(pGC->pScreen, (PixmapPtr) pGC->clientClip);
if (!pRegion)
return BadAlloc;
break;
@@ -274,7 +274,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) switch (pPicture->clientClipType) {
case CT_PIXMAP:
- pRegion = BITMAP_TO_REGION(pPicture->pDrawable->pScreen,
+ pRegion = BitmapToRegion(pPicture->pDrawable->pScreen,
(PixmapPtr) pPicture->clientClip);
if (!pRegion)
return BadAlloc;
@@ -346,15 +346,15 @@ ProcXFixesSetRegion (ClientPtr client) return BadLength;
things >>= 3;
- pNew = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED);
+ pNew = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED);
if (!pNew)
return BadAlloc;
- if (!REGION_COPY (0, pRegion, pNew))
+ if (!RegionCopy(pRegion, pNew))
{
- REGION_DESTROY (0, pNew);
+ RegionDestroy(pNew);
return BadAlloc;
}
- REGION_DESTROY (0, pNew);
+ RegionDestroy(pNew);
return Success;
}
@@ -380,7 +380,7 @@ ProcXFixesCopyRegion (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
- if (!REGION_COPY(pScreen, pDestination, pSource))
+ if (!RegionCopy(pDestination, pSource))
return BadAlloc;
return Success;
@@ -412,15 +412,15 @@ ProcXFixesCombineRegion (ClientPtr client) switch (stuff->xfixesReqType) {
case X_XFixesUnionRegion:
- if (!REGION_UNION (0, pDestination, pSource1, pSource2))
+ if (!RegionUnion(pDestination, pSource1, pSource2))
return BadAlloc;
break;
case X_XFixesIntersectRegion:
- if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2))
+ if (!RegionIntersect(pDestination, pSource1, pSource2))
return BadAlloc;
break;
case X_XFixesSubtractRegion:
- if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2))
+ if (!RegionSubtract(pDestination, pSource1, pSource2))
return BadAlloc;
break;
}
@@ -466,7 +466,7 @@ ProcXFixesInvertRegion (ClientPtr client) else
bounds.y2 = stuff->y + stuff->height;
- if (!REGION_INVERSE(0, pDestination, pSource, &bounds))
+ if (!RegionInverse(pDestination, pSource, &bounds))
return BadAlloc;
return Success;
@@ -498,7 +498,7 @@ ProcXFixesTranslateRegion (ClientPtr client) REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
- REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy);
+ RegionTranslate(pRegion, stuff->dx, stuff->dy);
return Success;
}
@@ -526,7 +526,7 @@ ProcXFixesRegionExtents (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
- REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource));
+ RegionReset(pDestination, RegionExtents(pSource));
return Success;
}
@@ -558,9 +558,9 @@ ProcXFixesFetchRegion (ClientPtr client) REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess);
- pExtent = REGION_EXTENTS (0, pRegion);
- pBox = REGION_RECTS (pRegion);
- nBox = REGION_NUM_RECTS (pRegion);
+ pExtent = RegionExtents(pRegion);
+ pBox = RegionRects (pRegion);
+ nBox = RegionNumRects (pRegion);
reply = malloc(sizeof (xXFixesFetchRegionReply) +
nBox * sizeof (xRectangle));
@@ -663,7 +663,6 @@ int ProcXFixesSetWindowShapeRegion (ClientPtr client)
{
WindowPtr pWin;
- ScreenPtr pScreen;
RegionPtr pRegion;
RegionPtr *pDestRegion;
int rc;
@@ -678,7 +677,6 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) return rc;
}
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess);
- pScreen = pWin->drawable.pScreen;
switch (stuff->destKind) {
case ShapeBounding:
case ShapeClip:
@@ -708,7 +706,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) break;
}
if (stuff->xOff || stuff->yOff)
- REGION_TRANSLATE (0, pRegion, stuff->xOff, stuff->yOff);
+ RegionTranslate(pRegion, stuff->xOff, stuff->yOff);
}
else
{
@@ -731,9 +729,9 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) pDestRegion = &pRegion; /* a NULL region pointer */
}
if (*pDestRegion)
- REGION_DESTROY(pScreen, *pDestRegion);
+ RegionDestroy(*pDestRegion);
*pDestRegion = pRegion;
- (*pScreen->SetShape) (pWin);
+ (*pWin->drawable.pScreen->SetShape) (pWin, stuff->destKind);
SendShapeNotify (pWin, stuff->destKind);
return Success;
}
@@ -801,8 +799,8 @@ ProcXFixesExpandRegion (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, DixReadAccess);
VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess);
- nBoxes = REGION_NUM_RECTS(pSource);
- pSrc = REGION_RECTS(pSource);
+ nBoxes = RegionNumRects(pSource);
+ pSrc = RegionRects(pSource);
if (nBoxes)
{
pTmp = malloc(nBoxes * sizeof (BoxRec));
@@ -815,12 +813,12 @@ ProcXFixesExpandRegion (ClientPtr client) pTmp[i].y1 = pSrc[i].y1 - stuff->top;
pTmp[i].y2 = pSrc[i].y2 + stuff->bottom;
}
- REGION_EMPTY (pScreen, pDestination);
+ RegionEmpty(pDestination);
for (i = 0; i < nBoxes; i++)
{
RegionRec r;
- REGION_INIT (pScreen, &r, &pTmp[i], 0);
- REGION_UNION (pScreen, pDestination, pDestination, &r);
+ RegionInit(&r, &pTmp[i], 0);
+ RegionUnion(pDestination, pDestination, &r);
}
free(pTmp);
}
|