From 68dd0b52e13c844d662192654fb10cb993257a59 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 22 Jun 2015 09:36:08 +0200 Subject: Replace 'pointer' type with 'void *' This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard Reviewed-by: Eric Anholt Rebased against NX: Mike Gabriel --- nx-X11/programs/Xserver/composite/compwindow.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nx-X11/programs/Xserver/composite/compwindow.c') diff --git a/nx-X11/programs/Xserver/composite/compwindow.c b/nx-X11/programs/Xserver/composite/compwindow.c index 2093095f0..2bb581329 100644 --- a/nx-X11/programs/Xserver/composite/compwindow.c +++ b/nx-X11/programs/Xserver/composite/compwindow.c @@ -30,7 +30,7 @@ #ifdef COMPOSITE_DEBUG static int -compCheckWindow (WindowPtr pWin, pointer data) +compCheckWindow (WindowPtr pWin, void * data) { ScreenPtr pScreen = pWin->drawable.pScreen; PixmapPtr pWinPixmap = (*pScreen->GetWindowPixmap) (pWin); @@ -71,7 +71,7 @@ typedef struct _compPixmapVisit { } CompPixmapVisitRec, *CompPixmapVisitPtr; static Bool -compRepaintBorder (ClientPtr pClient, pointer closure) +compRepaintBorder (ClientPtr pClient, void * closure) { WindowPtr pWindow = LookupWindow ((XID) closure, pClient); @@ -88,7 +88,7 @@ compRepaintBorder (ClientPtr pClient, pointer closure) } static int -compSetPixmapVisitWindow (WindowPtr pWindow, pointer data) +compSetPixmapVisitWindow (WindowPtr pWindow, void * data) { CompPixmapVisitPtr pVisit = (CompPixmapVisitPtr) data; ScreenPtr pScreen = pWindow->drawable.pScreen; @@ -105,7 +105,7 @@ compSetPixmapVisitWindow (WindowPtr pWindow, pointer data) SetBorderSize (pWindow); if (HasBorder (pWindow)) QueueWorkProc (compRepaintBorder, serverClient, - (pointer) pWindow->drawable.id); + (void *) pWindow->drawable.id); return WT_WALKCHILDREN; } @@ -116,7 +116,7 @@ compSetPixmap (WindowPtr pWindow, PixmapPtr pPixmap) visitRec.pWindow = pWindow; visitRec.pPixmap = pPixmap; - TraverseTree (pWindow, compSetPixmapVisitWindow, (pointer) &visitRec); + TraverseTree (pWindow, compSetPixmapVisitWindow, (void *) &visitRec); compCheckTree (pWindow->drawable.pScreen); } -- cgit v1.2.3 From 63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 16 Mar 2016 11:11:43 +0100 Subject: 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 (X.Org xserver commit: 2dc138922b7588515d5f2447e4b9dcdc0bef15e0) v2: Mike Gabriel (apply fix-region script to nx-libs) --- nx-X11/programs/Xserver/Xext/mbuf.c | 20 +- nx-X11/programs/Xserver/Xext/mbufbf.c | 78 ++--- nx-X11/programs/Xserver/Xext/mbufpx.c | 26 +- nx-X11/programs/Xserver/Xext/panoramiX.c | 34 +- nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 24 +- nx-X11/programs/Xserver/Xext/security.c | 14 +- nx-X11/programs/Xserver/Xext/shape.c | 48 +-- nx-X11/programs/Xserver/Xext/xtest.c | 4 +- nx-X11/programs/Xserver/composite/compalloc.c | 6 +- nx-X11/programs/Xserver/composite/compext.c | 2 +- nx-X11/programs/Xserver/composite/compwindow.c | 42 +-- nx-X11/programs/Xserver/damageext/damageext.c | 8 +- nx-X11/programs/Xserver/dix/dispatch.c | 12 +- nx-X11/programs/Xserver/dix/events.c | 62 ++-- nx-X11/programs/Xserver/dix/window.c | 112 +++---- nx-X11/programs/Xserver/fb/fb.h | 2 +- nx-X11/programs/Xserver/fb/fb24_32.c | 8 +- nx-X11/programs/Xserver/fb/fbarc.c | 2 +- nx-X11/programs/Xserver/fb/fbbits.h | 4 +- nx-X11/programs/Xserver/fb/fbbstore.c | 8 +- nx-X11/programs/Xserver/fb/fbcompose.c | 36 +- nx-X11/programs/Xserver/fb/fbcopy.c | 26 +- nx-X11/programs/Xserver/fb/fbfill.c | 2 +- nx-X11/programs/Xserver/fb/fbfillrect.c | 6 +- nx-X11/programs/Xserver/fb/fbfillsp.c | 6 +- nx-X11/programs/Xserver/fb/fbgc.c | 2 +- nx-X11/programs/Xserver/fb/fbglyph.c | 4 +- nx-X11/programs/Xserver/fb/fbimage.c | 8 +- nx-X11/programs/Xserver/fb/fbline.c | 4 +- nx-X11/programs/Xserver/fb/fboverlay.c | 42 +-- nx-X11/programs/Xserver/fb/fbpict.c | 6 +- nx-X11/programs/Xserver/fb/fbpixmap.c | 10 +- nx-X11/programs/Xserver/fb/fbpoint.c | 2 +- nx-X11/programs/Xserver/fb/fbpseudocolor.c | 130 ++++---- nx-X11/programs/Xserver/fb/fbpush.c | 4 +- nx-X11/programs/Xserver/fb/fbseg.c | 4 +- nx-X11/programs/Xserver/fb/fbsetsp.c | 4 +- nx-X11/programs/Xserver/fb/fbwindow.c | 18 +- nx-X11/programs/Xserver/fix-region | 40 +++ nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 232 ++++++------- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 8 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 74 ++--- nx-X11/programs/Xserver/hw/nxagent/GC.c | 44 +-- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 68 ++-- nx-X11/programs/Xserver/hw/nxagent/Image.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXdamage.c | 86 ++--- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 12 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 62 ++-- nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c | 114 +++---- nx-X11/programs/Xserver/hw/nxagent/NXmiwindow.c | 156 ++++----- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 18 +- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 112 +++---- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 18 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 118 +++---- nx-X11/programs/Xserver/hw/nxagent/Split.c | 14 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 124 +++---- nx-X11/programs/Xserver/include/regionstr.h | 114 +++---- nx-X11/programs/Xserver/mi/mibank.c | 92 ++--- nx-X11/programs/Xserver/mi/mibitblt.c | 32 +- nx-X11/programs/Xserver/mi/mibstore.c | 288 ++++++++-------- nx-X11/programs/Xserver/mi/miexpose.c | 112 +++---- nx-X11/programs/Xserver/mi/migc.c | 44 +-- nx-X11/programs/Xserver/mi/mioverlay.c | 424 ++++++++++++------------ nx-X11/programs/Xserver/mi/miregion.c | 154 ++++----- nx-X11/programs/Xserver/mi/misprite.c | 6 +- nx-X11/programs/Xserver/mi/mivaltree.c | 140 ++++---- nx-X11/programs/Xserver/mi/miwindow.c | 154 ++++----- nx-X11/programs/Xserver/miext/cw/cw.c | 30 +- nx-X11/programs/Xserver/miext/cw/cw_ops.c | 4 +- nx-X11/programs/Xserver/miext/damage/damage.c | 86 ++--- nx-X11/programs/Xserver/render/mipict.c | 80 ++--- nx-X11/programs/Xserver/render/mirect.c | 4 +- nx-X11/programs/Xserver/render/picture.c | 18 +- nx-X11/programs/Xserver/xfixes/region.c | 60 ++-- nx-X11/programs/Xserver/xkb/ddxFakeMtn.c | 8 +- 76 files changed, 2017 insertions(+), 1977 deletions(-) create mode 100755 nx-X11/programs/Xserver/fix-region (limited to 'nx-X11/programs/Xserver/composite/compwindow.c') diff --git a/nx-X11/programs/Xserver/Xext/mbuf.c b/nx-X11/programs/Xserver/Xext/mbuf.c index e6dec8f6f..5379f2656 100644 --- a/nx-X11/programs/Xserver/Xext/mbuf.c +++ b/nx-X11/programs/Xserver/Xext/mbuf.c @@ -903,9 +903,9 @@ ProcClearImageBufferArea (client) box.y1 = clearRect.y; box.x2 = clearRect.x + clearRect.width; box.y2 = clearRect.y + clearRect.height; - REGION_INIT(pScreen, ®ion, &box, 1); + RegionInit(®ion, &box, 1); MultibufferExpose(pMultibuffer, ®ion); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); } return Success; } @@ -1202,13 +1202,13 @@ PerformDisplayRequest (ppMultibuffers, pMultibuffer, nbuf) * window-relative so that region ops involving * pExposed and pWinSize behave sensibly. */ - REGION_TRANSLATE(pWin->drawable.pScreen, pWinSize, + RegionTranslate(pWinSize, -pWin->drawable.x, -pWin->drawable.y); - REGION_INTERSECT(pWin->drawable.pScreen, pExposed, + RegionIntersect(pExposed, pExposed, pWinSize); - REGION_DESTROY(pWin->drawable.pScreen, pWinSize); + RegionDestroy(pWinSize); MultibufferExpose (pPrevMultibuffer, pExposed); - REGION_DESTROY(pWin->drawable.pScreen, pExposed); + RegionDestroy(pExposed); } graphicsExpose = FALSE; DoChangeGC (pGC, GCGraphicsExposures, &graphicsExpose, FALSE); @@ -1371,7 +1371,7 @@ MultibufferExpose (pMultibuffer, pRegion) MultibufferPtr pMultibuffer; RegionPtr pRegion; { - if (pRegion && !REGION_NIL(pRegion)) + if (pRegion && !RegionNil(pRegion)) { xEvent *pEvent; PixmapPtr pPixmap; @@ -1381,11 +1381,11 @@ MultibufferExpose (pMultibuffer, pRegion) int numRects; pPixmap = pMultibuffer->pPixmap; - REGION_TRANSLATE(pPixmap->drawable.pScreen, pRegion, + RegionTranslate(pRegion, -pPixmap->drawable.x, -pPixmap->drawable.y); /* XXX MultibufferExpose "knows" the region representation */ - numRects = REGION_NUM_RECTS(pRegion); - pBox = REGION_RECTS(pRegion); + numRects = RegionNumRects(pRegion); + pBox = RegionRects(pRegion); pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent)); if (pEvent) { diff --git a/nx-X11/programs/Xserver/Xext/mbufbf.c b/nx-X11/programs/Xserver/Xext/mbufbf.c index 318fa6756..359fb63aa 100644 --- a/nx-X11/programs/Xserver/Xext/mbufbf.c +++ b/nx-X11/programs/Xserver/Xext/mbufbf.c @@ -245,9 +245,9 @@ bufMultibufferInit(pScreen, pMBScreen) box.y2 = pScreen->height; pMBPriv->rgnChanged = TRUE; - REGION_INIT(pScreen, &pMBPriv->backBuffer, &box, 1); - REGION_INIT(pScreen, &pMBPriv->subtractRgn, &box, 1); - REGION_NULL(pScreen, &pMBPriv->unionRgn); + RegionInit(&pMBPriv->backBuffer, &box, 1); + RegionInit(&pMBPriv->subtractRgn, &box, 1); + RegionNull(&pMBPriv->unionRgn); /* Misc functions */ pMBPriv->CopyBufferBits = bufCopyBufferBitsFunc[pScreen->myNum]; @@ -374,10 +374,10 @@ bufCreateImageBuffers (pWin, nbuf, ids, action, hint) pMBScreen = MB_SCREEN_PRIV(pScreen); pMBWindow = MB_WINDOW_PRIV(pWin); - pMBWindow->devPrivate.ptr = (void *) REGION_CREATE(pScreen, 0,0); + pMBWindow->devPrivate.ptr = (void *) RegionCreate(0,0); if (!pMBWindow->devPrivate.ptr) return(0); - REGION_COPY(pScreen, (RegionPtr) pMBWindow->devPrivate.ptr, + RegionCopy((RegionPtr) pMBWindow->devPrivate.ptr, &pWin->clipList); for (i = 0; i < nbuf; i++) @@ -429,7 +429,7 @@ bufDestroyImageBuffers(pWin) if (pWin->realized && (pMBWindow->displayedMultibuffer == BACK_BUFFER)) { (* pMBPriv->CopyBufferBits)(pMBWindow, BACK_BUFFER, FRONT_BUFFER); - REGION_SUBTRACT(pScreen, &pMBPriv->backBuffer, + RegionSubtract(&pMBPriv->backBuffer, &pMBPriv->backBuffer, &pWin->clipList); (* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane, &pWin->clipList, FRONT_BUFFER); @@ -439,7 +439,7 @@ bufDestroyImageBuffers(pWin) pWin->devPrivates[frameWindowPrivateIndex] = pMBPriv->frameBuffer[FRONT_BUFFER]; - REGION_DESTROY(pScreen, (RegionPtr) pMBWindow->devPrivate.ptr); + RegionDestroy((RegionPtr) pMBWindow->devPrivate.ptr); pMBWindow->devPrivate.ptr = NULL; } } @@ -506,7 +506,7 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures) box.y2 = y2; pScreen = pBuffer->drawable.pScreen; - REGION_INIT(pScreen, ®, &box, 1); + RegionInit(®, &box, 1); if (pBuffer->backStorage) { /* @@ -520,7 +520,7 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures) generateExposures); } - REGION_INTERSECT(pScreen, ®, ®, &pBuffer->clipList); + RegionIntersect(®, ®, &pBuffer->clipList); if (pBuffer->backgroundState != None) (*pScreen->PaintWindowBackground)(pBuffer, ®, PW_BACKGROUND); if (generateExposures) @@ -537,9 +537,9 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures) else if (pBuffer->backgroundState != None) (*pScreen->PaintWindowBackground)(pBuffer, ®, PW_BACKGROUND); #endif - REGION_UNINIT(pScreen, ®); + RegionUninit(®); if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); + RegionDestroy(pBSReg); } static void @@ -567,9 +567,9 @@ bufResetProc(pScreen) * whoever called RegisterDoubleBufferHardware */ - REGION_UNINIT(pScreen, &pMBPriv->backBuffer); - REGION_UNINIT(pScreen, &pMBPriv->subtractRgn); - REGION_UNINIT(pScreen, &pMBPriv->unionRgn); + RegionUninit(&pMBPriv->backBuffer); + RegionUninit(&pMBPriv->subtractRgn); + RegionUninit(&pMBPriv->unionRgn); xfree(pMBPriv); } @@ -624,7 +624,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum) int numRects; XID value; - if (REGION_NUM_RECTS(prgn) == 0) + if (RegionNumRects(prgn) == 0) return; pDrawable = (DrawablePtr) selectPlane.ptr; @@ -632,7 +632,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum) if (!pGC) return; - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * + prect = (xRectangle *)ALLOCATE_LOCAL(RegionNumRects(prgn) * sizeof(xRectangle)); if (!prect) { @@ -644,8 +644,8 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum) DoChangeGC(pGC, GCForeground, &value, 0); ValidateGC(pDrawable, 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; @@ -697,10 +697,10 @@ bufDisplayImageBuffers(pScreen, ppMBWindow, ppMBBuffer, nbuf) &pWin->clipList, number); if (number == BACK_BUFFER) - REGION_UNION(pScreen, backBuffer, backBuffer, + RegionUnion(backBuffer, backBuffer, &pWin->clipList); else - REGION_SUBTRACT(pScreen, backBuffer, backBuffer, + RegionSubtract(backBuffer, backBuffer, &pWin->clipList); /* Switch which framebuffer the window draws into */ @@ -764,36 +764,36 @@ bufPostValidateTree(pParent, pChild, kind) pSubtractRgn = &pMBPriv->subtractRgn; pUnionRgn = &pMBPriv->unionRgn; - REGION_VALIDATE(pScreen, pSubtractRgn, &overlap); + RegionValidate(pSubtractRgn, &overlap); #ifdef DEBUG if (overlap) FatalError("bufPostValidateTree: subtractRgn overlaps"); #endif - REGION_VALIDATE(pScreen, pUnionRgn, &overlap); + RegionValidate(pUnionRgn, &overlap); #ifdef DEBUG if (overlap) FatalError("bufPostValidateTree: unionRgn overlaps"); #endif /* Update backBuffer: subtract must come before union */ - REGION_SUBTRACT(pScreen, &pMBPriv->backBuffer, &pMBPriv->backBuffer, + RegionSubtract(&pMBPriv->backBuffer, &pMBPriv->backBuffer, pSubtractRgn); - REGION_UNION(pScreen, &pMBPriv->backBuffer, &pMBPriv->backBuffer, + RegionUnion(&pMBPriv->backBuffer, &pMBPriv->backBuffer, pUnionRgn); /* Paint gained and lost backbuffer areas in select plane */ - REGION_NULL(pScreen, &exposed); - REGION_SUBTRACT(pScreen, &exposed, pSubtractRgn, pUnionRgn); + RegionNull(&exposed); + RegionSubtract(&exposed, pSubtractRgn, pUnionRgn); (* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane, &exposed, FRONT_BUFFER); - REGION_SUBTRACT(pScreen, &exposed, pUnionRgn, pSubtractRgn); + RegionSubtract(&exposed, pUnionRgn, pSubtractRgn); (* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane, &exposed, BACK_BUFFER); - REGION_UNINIT(pScreen, &exposed); - REGION_EMPTY(pScreen, pSubtractRgn); - REGION_EMPTY(pScreen, pUnionRgn); + RegionUninit(&exposed); + RegionEmpty(pSubtractRgn); + RegionEmpty(pUnionRgn); } } @@ -826,16 +826,16 @@ bufClipNotify(pWin, dx,dy) { RegionPtr pOldClipList = (RegionPtr) pMBWindow->devPrivate.ptr; - if (! REGION_EQUAL(pScreen, pOldClipList, &pWin->clipList)) + if (! RegionEqual(pOldClipList, &pWin->clipList)) { if (pMBWindow->displayedMultibuffer == BACK_BUFFER) { pMBPriv->rgnChanged = TRUE; - REGION_APPEND(pScreen, &pMBPriv->subtractRgn, pOldClipList); - REGION_APPEND(pScreen, &pMBPriv->unionRgn, &pWin->clipList); + RegionAppend(&pMBPriv->subtractRgn, pOldClipList); + RegionAppend(&pMBPriv->unionRgn, &pWin->clipList); } - REGION_COPY(pScreen, pOldClipList,&pWin->clipList); + RegionCopy(pOldClipList,&pWin->clipList); } /* Update buffer x,y,w,h, and clipList */ @@ -912,13 +912,13 @@ bufWindowExposures(pWin, prgn, other_exposed) handleBuffers = (!pMBPriv->inClearToBackground) && (pWin->drawable.type == DRAWABLE_WINDOW) && - pMBWindow && (prgn && !REGION_NIL(prgn)); + pMBWindow && (prgn && !RegionNil(prgn)); /* miWindowExposures munges prgn and other_exposed. */ if (handleBuffers) { - REGION_NULL(pScreen, &tmp_rgn); - REGION_COPY(pScreen, &tmp_rgn, prgn); + RegionNull(&tmp_rgn); + RegionCopy(&tmp_rgn, prgn); } UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, WindowExposures); @@ -950,7 +950,7 @@ bufWindowExposures(pWin, prgn, other_exposed) MultibufferExpose(pMBBuffer, &tmp_rgn); } - REGION_UNINIT(pScreen, &tmp_rgn); + RegionUninit(&tmp_rgn); } /* @@ -1018,7 +1018,7 @@ bufCopyWindow(pWin, ptOldOrg, prgnSrc) */ /* CopyWindow translates prgnSrc... translate it back for 2nd call. */ - REGION_TRANSLATE(pScreen, prgnSrc, + RegionTranslate(prgnSrc, ptOldOrg.x - pWin->drawable.x, ptOldOrg.y - pWin->drawable.y); pwinroot->devPrivates[frameWindowPrivateIndex] = diff --git a/nx-X11/programs/Xserver/Xext/mbufpx.c b/nx-X11/programs/Xserver/Xext/mbufpx.c index 0e9ae1628..3d28d3ff3 100644 --- a/nx-X11/programs/Xserver/Xext/mbufpx.c +++ b/nx-X11/programs/Xserver/Xext/mbufpx.c @@ -262,8 +262,8 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion) RegionPtr pRegion; { xRectangle *pRects; - int nrects = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); + int nrects = RegionNumRects(pRegion); + BoxPtr pbox = RegionRects(pRegion); pRects = (xRectangle *)ALLOCATE_LOCAL(nrects * sizeof(xRectangle)); if (pRects) @@ -390,13 +390,13 @@ pixDisplayImageBuffers(pScreen, ppMBWindow, ppMBBuffer, nbuf) * window-relative so that region ops involving * pExposed and pWinSize behave sensibly. */ - REGION_TRANSLATE(pScreen, pWinSize, + RegionTranslate(pWinSize, -pWin->drawable.x, -pWin->drawable.y); - REGION_INTERSECT(pScreen, pExposed, pExposed, pWinSize); - REGION_DESTROY(pScreen, pWinSize); + RegionIntersect(pExposed, pExposed, pWinSize); + RegionDestroy(pWinSize); MultibufferExpose (pPrevMBBuffer, pExposed); - REGION_DESTROY(pScreen, pExposed); + RegionDestroy(pExposed); } bool = FALSE; DoChangeGC (pGC, GCGraphicsExposures, &bool, FALSE); @@ -522,7 +522,7 @@ pixPositionWindow (pWin, x, y) box.x1 = box.y1 = 0; box.x2 = width; box.y2 = height; - REGION_INIT(pScreen, &exposedRegion, &box, 1); + RegionInit(&exposedRegion, &box, 1); if (pWin->bitGravity != ForgetGravity) { RegionRec preservedRegion; @@ -530,9 +530,9 @@ pixPositionWindow (pWin, x, y) box.y1 = desty; box.x2 = destx + savewidth; box.y2 = desty + saveheight; - REGION_INIT(pScreen, &preservedRegion, &box, 1); - REGION_SUBTRACT(pScreen, &exposedRegion, &exposedRegion, &preservedRegion); - REGION_UNINIT(pScreen, &preservedRegion); + RegionInit(&preservedRegion, &box, 1); + RegionSubtract(&exposedRegion, &exposedRegion, &preservedRegion); + RegionUninit(&preservedRegion); } } /* end if (clear) */ @@ -575,7 +575,7 @@ pixPositionWindow (pWin, x, y) } FreeScratchGC (pGC); if (clear) - REGION_UNINIT(pScreen, &exposedRegion); + RegionUninit(&exposedRegion); return TRUE; } @@ -628,7 +628,7 @@ pixClearImageBufferArea(pMBBuffer, x,y, width,height, exposures) if (box.x2 > w_width) box.x2 = w_width; if (box.y2 > w_height) box.y2 = w_height; - REGION_INIT(pScreen, ®ion, &box, 1); + RegionInit(®ion, &box, 1); if (pMBBuffer->number == pMBBuffer->pMBWindow->displayedMultibuffer) pDrawable = (DrawablePtr) pWin; @@ -640,7 +640,7 @@ pixClearImageBufferArea(pMBBuffer, x,y, width,height, exposures) if (exposures) MultibufferExpose(pMBBuffer, ®ion); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); } static void diff --git a/nx-X11/programs/Xserver/Xext/panoramiX.c b/nx-X11/programs/Xserver/Xext/panoramiX.c index 000c4bf04..2671ba0d3 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiX.c +++ b/nx-X11/programs/Xserver/Xext/panoramiX.c @@ -161,9 +161,9 @@ XineramaCloseScreen (int i, ScreenPtr pScreen) pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->CreateGC = pScreenPriv->CreateGC; - REGION_UNINIT(pScreen, &XineramaScreenRegions[pScreen->myNum]); + RegionUninit(&XineramaScreenRegions[pScreen->myNum]); if (pScreen->myNum == 0) - REGION_UNINIT(pScreen, &PanoramiXScreenRegion); + RegionUninit(&PanoramiXScreenRegion); xfree ((void *) pScreenPriv); @@ -434,7 +434,7 @@ static void XineramaInitData(ScreenPtr pScreen) { int i, w, h; - REGION_NULL(pScreen, &PanoramiXScreenRegion) + RegionNull(&PanoramiXScreenRegion); for (i = 0; i < PanoramiXNumScreens; i++) { BoxRec TheBox; @@ -450,8 +450,8 @@ static void XineramaInitData(ScreenPtr pScreen) TheBox.y1 = panoramiXdataPtr[i].y; TheBox.y2 = TheBox.y1 + panoramiXdataPtr[i].height; - REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1); - REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion, + RegionInit(&XineramaScreenRegions[i], &TheBox, 1); + RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion, &XineramaScreenRegions[i]); } @@ -473,9 +473,9 @@ void XineramaReinitData(ScreenPtr pScreen) { int i; - REGION_UNINIT(pScreen, &PanoramiXScreenRegion); + RegionUninit(&PanoramiXScreenRegion); for (i = 0; i < PanoramiXNumScreens; i++) - REGION_UNINIT(pScreen, &XineramaScreenRegions[i]); + RegionUninit(&XineramaScreenRegions[i]); XineramaInitData(pScreen); } @@ -1182,15 +1182,15 @@ XineramaGetImageData( SrcBox.x2 = SrcBox.x1 + width; SrcBox.y2 = SrcBox.y1 + height; - REGION_INIT(pScreen, &SrcRegion, &SrcBox, 1); - REGION_NULL(pScreen, &GrabRegion); + RegionInit(&SrcRegion, &SrcBox, 1); + RegionNull(&GrabRegion); depth = (format == XYPixmap) ? 1 : pDraw->depth; for(i = 0; i < PanoramiXNumScreens; i++) { pDraw = pDrawables[i]; - inOut = RECT_IN_REGION(pScreen,&XineramaScreenRegions[i],&SrcBox); + inOut = RegionContainsRect(&XineramaScreenRegions[i],&SrcBox); if(inOut == rgnIN) { (*pDraw->pScreen->GetImage)(pDraw, @@ -1201,13 +1201,13 @@ XineramaGetImageData( } else if (inOut == rgnOUT) continue; - REGION_INTERSECT(pScreen, &GrabRegion, &SrcRegion, + RegionIntersect(&GrabRegion, &SrcRegion, &XineramaScreenRegions[i]); - nbox = REGION_NUM_RECTS(&GrabRegion); + nbox = RegionNumRects(&GrabRegion); if(nbox) { - pbox = REGION_RECTS(&GrabRegion); + pbox = RegionRects(&GrabRegion); while(nbox--) { w = pbox->x2 - pbox->x1; @@ -1284,8 +1284,8 @@ XineramaGetImageData( pbox++; } - REGION_SUBTRACT(pScreen, &SrcRegion, &SrcRegion, &GrabRegion); - if(!REGION_NOTEMPTY(pScreen, &SrcRegion)) + RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion); + if(!RegionNotEmpty(&SrcRegion)) break; } @@ -1294,6 +1294,6 @@ XineramaGetImageData( if(ScratchMem) xfree(ScratchMem); - REGION_UNINIT(pScreen, &SrcRegion); - REGION_UNINIT(pScreen, &GrabRegion); + RegionUninit(&SrcRegion); + RegionUninit(&GrabRegion); } diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index 2f2b2c63e..8078e2bd0 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -621,7 +621,7 @@ int PanoramiXTranslateCoords(ClientPtr client) * borderSize */ && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wBoundingShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) @@ -1109,21 +1109,21 @@ int PanoramiXCopyArea(ClientPtr client) RegionRec totalReg; Bool overlap; - REGION_NULL(pScreen, &totalReg); + RegionNull(&totalReg); FOR_NSCREENS_BACKWARD(j) { if(pRgn[j]) { if(srcIsRoot) { - REGION_TRANSLATE(pScreen, pRgn[j], + RegionTranslate(pRgn[j], panoramiXdataPtr[j].x, panoramiXdataPtr[j].y); } - REGION_APPEND(pScreen, &totalReg, pRgn[j]); - REGION_DESTROY(pScreen, pRgn[j]); + RegionAppend(&totalReg, pRgn[j]); + RegionDestroy(pRgn[j]); } } - REGION_VALIDATE(pScreen, &totalReg, &overlap); + RegionValidate(&totalReg, &overlap); (*pScreen->SendGraphicsExpose)( client, &totalReg, stuff->dstDrawable, X_CopyArea, 0); - REGION_UNINIT(pScreen, &totalReg); + RegionUninit(&totalReg); } result = client->noClientException; @@ -1220,17 +1220,17 @@ int PanoramiXCopyPlane(ClientPtr client) RegionRec totalReg; Bool overlap; - REGION_NULL(pScreen, &totalReg); + RegionNull(&totalReg); FOR_NSCREENS_BACKWARD(j) { if(pRgn[j]) { - REGION_APPEND(pScreen, &totalReg, pRgn[j]); - REGION_DESTROY(pScreen, pRgn[j]); + RegionAppend(&totalReg, pRgn[j]); + RegionDestroy(pRgn[j]); } } - REGION_VALIDATE(pScreen, &totalReg, &overlap); + RegionValidate(&totalReg, &overlap); (*pScreen->SendGraphicsExpose)( client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0); - REGION_UNINIT(pScreen, &totalReg); + RegionUninit(&totalReg); } return (client->noClientException); diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index bcc8574cb..ccf80b401 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -1400,12 +1400,12 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h, imageBox.y1 = y; imageBox.x2 = x + w; imageBox.y2 = y + h; - REGION_INIT(pScreen, &imageRegion, &imageBox, 1); - REGION_NULL(pScreen, &censorRegion); + RegionInit(&imageRegion, &imageBox, 1); + RegionNull(&censorRegion); /* censorRegion = imageRegion - visibleRegion */ - REGION_SUBTRACT(pScreen, &censorRegion, &imageRegion, pVisibleRegion); - nRects = REGION_NUM_RECTS(&censorRegion); + RegionSubtract(&censorRegion, &imageRegion, pVisibleRegion); + nRects = RegionNumRects(&censorRegion); if (nRects > 0) { /* we have something to censor */ GCPtr pScratchGC = NULL; @@ -1425,7 +1425,7 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h, failed = TRUE; goto failSafe; } - for (pBox = REGION_RECTS(&censorRegion), i = 0; + for (pBox = RegionRects(&censorRegion), i = 0; i < nRects; i++, pBox++) { @@ -1475,8 +1475,8 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h, if (pScratchGC) FreeScratchGC(pScratchGC); if (pPix) FreeScratchPixmapHeader(pPix); } - REGION_UNINIT(pScreen, &imageRegion); - REGION_UNINIT(pScreen, &censorRegion); + RegionUninit(&imageRegion); + RegionUninit(&censorRegion); } /* SecurityCensorImage */ /**********************************************************************/ diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index 78d3be319..8516192c0 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -186,11 +186,11 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create) ScreenPtr pScreen = pWin->drawable.pScreen; if (srcRgn && (xoff || yoff)) - REGION_TRANSLATE(pScreen, srcRgn, xoff, yoff); + RegionTranslate(srcRgn, xoff, yoff); if (!pWin->parent) { if (srcRgn) - REGION_DESTROY(pScreen, srcRgn); + RegionDestroy(srcRgn); return Success; } @@ -201,7 +201,7 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create) */ if (srcRgn == NULL) { if (*destRgnp != NULL) { - REGION_DESTROY (pScreen, *destRgnp); + RegionDestroy(*destRgnp); *destRgnp = 0; /* go on to remove shape and generate ShapeNotify */ } @@ -220,17 +220,17 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create) else switch (op) { case ShapeSet: if (*destRgnp) - REGION_DESTROY(pScreen, *destRgnp); + RegionDestroy(*destRgnp); *destRgnp = srcRgn; srcRgn = 0; break; case ShapeUnion: if (*destRgnp) - REGION_UNION(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionUnion(*destRgnp, *destRgnp, srcRgn); break; case ShapeIntersect: if (*destRgnp) - REGION_INTERSECT(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionIntersect(*destRgnp, *destRgnp, srcRgn); else { *destRgnp = srcRgn; srcRgn = 0; @@ -239,20 +239,20 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create) case ShapeSubtract: if (!*destRgnp) *destRgnp = (*create)(pWin); - REGION_SUBTRACT(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionSubtract(*destRgnp, *destRgnp, srcRgn); break; case ShapeInvert: if (!*destRgnp) - *destRgnp = REGION_CREATE(pScreen, (BoxPtr) 0, 0); + *destRgnp = RegionCreate((BoxPtr) 0, 0); else - REGION_SUBTRACT(pScreen, *destRgnp, srcRgn, *destRgnp); + RegionSubtract(*destRgnp, srcRgn, *destRgnp); break; default: client->errorValue = op; return BadValue; } if (srcRgn) - REGION_DESTROY(pScreen, srcRgn); + RegionDestroy(srcRgn); (*pScreen->SetShape) (pWin); SendShapeNotify (pWin, kind); return Success; @@ -268,7 +268,7 @@ CreateBoundingShape (pWin) extents.y1 = -wBorderWidth (pWin); extents.x2 = pWin->drawable.width + wBorderWidth (pWin); extents.y2 = pWin->drawable.height + wBorderWidth (pWin); - return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); + return RegionCreate(&extents, 1); } RegionPtr @@ -281,7 +281,7 @@ CreateClipShape (pWin) extents.y1 = 0; extents.x2 = pWin->drawable.width; extents.y2 = pWin->drawable.height; - return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); + return RegionCreate(&extents, 1); } static int @@ -360,7 +360,7 @@ ProcShapeRectangles (client) ctype = VerifyRectOrder(nrects, prects, (int)stuff->ordering); if (ctype < 0) return BadMatch; - srcRgn = RECTS_TO_REGION(pScreen, nrects, prects, ctype); + srcRgn = RegionFromRects(nrects, prects, ctype); if (!pWin->optional) MakeWindowOptional (pWin); @@ -455,7 +455,7 @@ ProcShapeMask (client) if (pPixmap->drawable.pScreen != pScreen || pPixmap->drawable.depth != 1) return BadMatch; - srcRgn = BITMAP_TO_REGION(pScreen, pPixmap); + srcRgn = BitmapToRegion(pScreen, pPixmap); if (!srcRgn) return BadAlloc; } @@ -581,8 +581,8 @@ ProcShapeCombine (client) } if (srcRgn) { - tmp = REGION_CREATE(pScreen, (BoxPtr) 0, 0); - REGION_COPY(pScreen, tmp, srcRgn); + tmp = RegionCreate((BoxPtr) 0, 0); + RegionCopy(tmp, srcRgn); srcRgn = tmp; } else srcRgn = (*createSrc) (pSrcWin); @@ -673,7 +673,7 @@ ProcShapeOffset (client) pScreen = pWin->drawable.pScreen; if (srcRgn) { - REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff); + RegionTranslate(srcRgn, stuff->xOff, stuff->yOff); (*pScreen->SetShape) (pWin); } SendShapeNotify (pWin, (int)stuff->destKind); @@ -729,7 +729,7 @@ ProcShapeQueryExtents (client) rep.clipShaped = (wClipShape(pWin) != 0); if ((region = wBoundingShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ - pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region); + pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = -wBorderWidth (pWin); @@ -743,7 +743,7 @@ ProcShapeQueryExtents (client) rep.heightBoundingShape = extents.y2 - extents.y1; if ((region = wClipShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ - pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region); + pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = 0; @@ -932,7 +932,7 @@ SendShapeNotify (pWin, which) case ShapeBounding: region = wBoundingShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth (pWin); @@ -945,7 +945,7 @@ SendShapeNotify (pWin, which) case ShapeClip: region = wClipShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = 0; @@ -958,7 +958,7 @@ SendShapeNotify (pWin, which) case ShapeInput: region = wInputShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth (pWin); @@ -1087,8 +1087,8 @@ ProcShapeGetRectangles (client) } } else { BoxPtr box; - nrects = REGION_NUM_RECTS(region); - box = REGION_RECTS(region); + nrects = RegionNumRects(region); + box = RegionRects(region); rects = (xRectangle *) ALLOCATE_LOCAL (nrects * sizeof (xRectangle)); if (!rects && nrects) return BadAlloc; diff --git a/nx-X11/programs/Xserver/Xext/xtest.c b/nx-X11/programs/Xserver/Xext/xtest.c index 482ad91d4..8a03db5f9 100644 --- a/nx-X11/programs/Xserver/Xext/xtest.c +++ b/nx-X11/programs/Xserver/Xext/xtest.c @@ -402,11 +402,11 @@ ProcXTestFakeInput(client) int i; int x = ev->u.keyButtonPointer.rootX + panoramiXdataPtr[0].x; int y = ev->u.keyButtonPointer.rootY + 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, + if (RegionContainsPoint( &XineramaScreenRegions[i], x, y, &box)) { root = WindowTable[i]; diff --git a/nx-X11/programs/Xserver/composite/compalloc.c b/nx-X11/programs/Xserver/composite/compalloc.c index d496ee9ba..f66a90989 100644 --- a/nx-X11/programs/Xserver/composite/compalloc.c +++ b/nx-X11/programs/Xserver/composite/compalloc.c @@ -103,7 +103,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) if (wasMapped) UnmapWindow (pWin, FALSE); - REGION_NULL (pScreen, &cw->borderClip); + RegionNull(&cw->borderClip); cw->update = CompositeRedirectAutomatic; cw->clients = 0; cw->oldx = COMP_ORIGIN_INVALID; @@ -177,7 +177,7 @@ compFreeClientWindow (WindowPtr pWin, XID id) if (cw->damage) DamageDestroy (cw->damage); - REGION_UNINIT (pScreen, &cw->borderClip); + RegionUninit(&cw->borderClip); pWin->devPrivates[CompWindowPrivateIndex].ptr = 0; xfree (cw); @@ -503,7 +503,7 @@ compFreePixmap (WindowPtr pWin) * case correctly. Unmap adds the window borderClip to the * parent exposed area; regions beyond the parent cause crashes */ - REGION_COPY (pScreen, &pWin->borderClip, &cw->borderClip); + RegionCopy(&pWin->borderClip, &cw->borderClip); pRedirectPixmap = (*pScreen->GetWindowPixmap) (pWin); pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent); pWin->redirectDraw = FALSE; diff --git a/nx-X11/programs/Xserver/composite/compext.c b/nx-X11/programs/Xserver/composite/compext.c index d182da1fd..f57235d46 100644 --- a/nx-X11/programs/Xserver/composite/compext.c +++ b/nx-X11/programs/Xserver/composite/compext.c @@ -201,7 +201,7 @@ ProcCompositeCreateRegionFromBorderClip (ClientPtr client) pRegion = XFixesRegionCopy (pBorderClip); if (!pRegion) return BadAlloc; - REGION_TRANSLATE (pScreen, pRegion, -pWin->drawable.x, -pWin->drawable.y); + RegionTranslate(pRegion, -pWin->drawable.x, -pWin->drawable.y); if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; diff --git a/nx-X11/programs/Xserver/composite/compwindow.c b/nx-X11/programs/Xserver/composite/compwindow.c index 2bb581329..fbdc44420 100644 --- a/nx-X11/programs/Xserver/composite/compwindow.c +++ b/nx-X11/programs/Xserver/composite/compwindow.c @@ -79,10 +79,10 @@ compRepaintBorder (ClientPtr pClient, void * closure) { RegionRec exposed; - REGION_NULL(pScreen, &exposed); - REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize); + RegionNull(&exposed); + RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize); (*pWindow->drawable.pScreen->PaintWindowBorder)(pWindow, &exposed, PW_BORDER); - REGION_UNINIT(pScreen, &exposed); + RegionUninit(&exposed); } return TRUE; } @@ -245,7 +245,7 @@ compClipNotify (WindowPtr pWin, int dx, int dy) if (cw->borderClipX != pWin->drawable.x || cw->borderClipY != pWin->drawable.y) { - REGION_TRANSLATE (pScreen, &cw->borderClip, + RegionTranslate(&cw->borderClip, pWin->drawable.x - cw->borderClipX, pWin->drawable.y - cw->borderClipY); cw->borderClipX = pWin->drawable.x; @@ -492,14 +492,14 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); - REGION_NULL (pWin->drawable.pScreen, &rgnDst); + RegionNull(&rgnDst); - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); - REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst, + RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y); dx = dx + pPixmap->screen_x - cw->oldx; @@ -507,8 +507,8 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); if (pGC) { - BoxPtr pBox = REGION_RECTS (&rgnDst); - int nBox = REGION_NUM_RECTS (&rgnDst); + BoxPtr pBox = RegionRects (&rgnDst); + int nBox = RegionNumRects (&rgnDst); ValidateGC(&pPixmap->drawable, pGC); while (nBox--) @@ -536,16 +536,16 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) if (ptOldOrg.x != pWin->drawable.x || ptOldOrg.y != pWin->drawable.y) { if (dx || dy) - REGION_TRANSLATE (pScreen, prgnSrc, dx, dy); + RegionTranslate(prgnSrc, dx, dy); (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); if (dx || dy) - REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); } else { ptOldOrg.x -= dx; ptOldOrg.y -= dy; - REGION_TRANSLATE (prgnSrc, prgnSrc, + RegionTranslate(prgnSrc, pWin->drawable.x - ptOldOrg.x, pWin->drawable.y - ptOldOrg.y); DamageDamageRegion (&pWin->drawable, prgnSrc); @@ -613,26 +613,26 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion) CompWindowPtr cw = GetCompWindow (pWin); RegionRec damage; - REGION_NULL (pScreen, &damage); + RegionNull(&damage); /* * Align old border clip with new border clip */ - REGION_TRANSLATE (pScreen, &cw->borderClip, + RegionTranslate(&cw->borderClip, pWin->drawable.x - cw->borderClipX, pWin->drawable.y - cw->borderClipY); /* * Compute newly visible portion of window for repaint */ - REGION_SUBTRACT (pScreen, &damage, pRegion, &cw->borderClip); + RegionSubtract(&damage, pRegion, &cw->borderClip); /* * Report that as damaged so it will be redrawn */ DamageDamageRegion (&pWin->drawable, &damage); - REGION_UNINIT (pScreen, &damage); + RegionUninit(&damage); /* * Save the new border clip region */ - REGION_COPY (pScreen, &cw->borderClip, pRegion); + RegionCopy(&cw->borderClip, pRegion); cw->borderClipX = pWin->drawable.x; cw->borderClipY = pWin->drawable.y; } @@ -694,18 +694,18 @@ compWindowUpdateAutomatic (WindowPtr pWin) /* * First move the region from window to screen coordinates */ - REGION_TRANSLATE (pScreen, pRegion, + RegionTranslate(pRegion, pWin->drawable.x, pWin->drawable.y); /* * Clip against the "real" border clip */ - REGION_INTERSECT (pScreen, pRegion, pRegion, &cw->borderClip); + RegionIntersect(pRegion, pRegion, &cw->borderClip); /* * Now translate from screen to dest coordinates */ - REGION_TRANSLATE (pScreen, pRegion, + RegionTranslate(pRegion, -pParent->drawable.x, -pParent->drawable.y); /* diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index 33cbb5f7b..8d03dfed5 100755 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -99,10 +99,10 @@ DamageExtReport (DamagePtr pDamage, RegionPtr pRegion, void *closure) switch (pDamageExt->level) { case DamageReportRawRegion: case DamageReportDeltaRegion: - DamageExtNotify (pDamageExt, REGION_RECTS(pRegion), REGION_NUM_RECTS(pRegion)); + DamageExtNotify (pDamageExt, RegionRects(pRegion), RegionNumRects(pRegion)); break; case DamageReportBoundingBox: - DamageExtNotify (pDamageExt, REGION_EXTENTS(prScreen, pRegion), 1); + DamageExtNotify (pDamageExt, RegionExtents(pRegion), 1); break; case DamageReportNonEmpty: DamageExtNotify (pDamageExt, NullBox, 0); @@ -261,14 +261,14 @@ ProcDamageSubtract (ClientPtr client) if (pRepair) { if (pParts) - REGION_INTERSECT (prScreen, pParts, DamageRegion (pDamage), pRepair); + RegionIntersect(pParts, DamageRegion (pDamage), pRepair); if (DamageSubtract (pDamage, pRepair)) DamageExtReport (pDamage, DamageRegion (pDamage), (void *) pDamageExt); } else { if (pParts) - REGION_COPY (prScreen, pParts, DamageRegion (pDamage)); + RegionCopy(pParts, DamageRegion (pDamage)); DamageEmpty (pDamage); } } diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index b6010e627..009e1ac08 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -1266,11 +1266,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)) @@ -1758,7 +1758,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); @@ -1806,7 +1806,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); } @@ -2228,7 +2228,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 @@ -2322,7 +2322,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/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 1166bf84b..3163270f4 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -346,14 +346,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; @@ -483,7 +483,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; @@ -493,16 +493,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 @@ -525,7 +525,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) @@ -632,7 +632,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; @@ -642,18 +642,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; @@ -732,9 +732,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; @@ -756,7 +756,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; } @@ -844,7 +844,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 = @@ -898,7 +898,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; @@ -1972,7 +1972,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 @@ -1980,7 +1980,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, @@ -2016,7 +2016,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)) @@ -2156,10 +2156,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) { @@ -2211,8 +2211,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 } @@ -2278,7 +2278,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; @@ -2292,9 +2292,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))) @@ -2470,7 +2470,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 @@ -2478,7 +2478,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/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index 5854f2e95..ce94dc8a5 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -439,10 +439,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; @@ -515,7 +515,7 @@ ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn, ScreenPtr pScreen = pWin->drawable.pScreen; 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; @@ -531,8 +531,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 @@ -713,10 +713,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) @@ -797,17 +797,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); @@ -1467,10 +1467,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; } @@ -1611,18 +1611,18 @@ 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)) { ScreenPtr pScreen = pWin->drawable.pScreen; - 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; @@ -1640,7 +1640,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 @@ -1652,15 +1652,15 @@ SetWinSize (register WindowPtr pWin) if (wBoundingShape (pWin) || wClipShape (pWin)) { ScreenPtr pScreen = pWin->drawable.pScreen; - 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 @@ -1682,7 +1682,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 @@ -1694,18 +1694,18 @@ SetBorderSize (register WindowPtr pWin) if (wBoundingShape (pWin)) { ScreenPtr pScreen = pWin->drawable.pScreen; - 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); } } @@ -1905,12 +1905,12 @@ MakeBoundingRegion ( RegionPtr pRgn; ScreenPtr pScreen = pWin->drawable.pScreen; - 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; @@ -1932,10 +1932,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 @@ -2066,7 +2066,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); @@ -2081,7 +2081,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); @@ -2095,7 +2095,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); @@ -2785,10 +2785,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); } return(Success); @@ -3184,7 +3184,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); } @@ -3200,10 +3200,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))) @@ -3219,12 +3219,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/fb/fb.h b/nx-X11/programs/Xserver/fb/fb.h index b64f3a227..1da5d2470 100644 --- a/nx-X11/programs/Xserver/fb/fb.h +++ b/nx-X11/programs/Xserver/fb/fb.h @@ -703,7 +703,7 @@ typedef struct { */ #define fbWindowEnabled(pWin) \ - REGION_NOTEMPTY((pWin)->drawable.pScreen, \ + RegionNotEmpty(\ &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip) #define fbDrawableEnabled(pDrawable) \ diff --git a/nx-X11/programs/Xserver/fb/fb24_32.c b/nx-X11/programs/Xserver/fb/fb24_32.c index 68e0ef84d..350055c14 100644 --- a/nx-X11/programs/Xserver/fb/fb24_32.c +++ b/nx-X11/programs/Xserver/fb/fb24_32.c @@ -338,8 +338,8 @@ fb24_32SetSpans (DrawablePtr pDrawable, { d = dst + (ppt->y + dstYoff) * dstStride; s = (CARD8 *) src; - n = REGION_NUM_RECTS(pClip); - pbox = REGION_RECTS (pClip); + n = RegionNumRects(pClip); + pbox = RegionRects (pClip); while (n--) { if (pbox->y1 > ppt->y) @@ -400,8 +400,8 @@ fb24_32PutZImage (DrawablePtr pDrawable, dstStride *= sizeof(FbBits); dst = (CARD8 *) dstBits; - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/nx-X11/programs/Xserver/fb/fbarc.c b/nx-X11/programs/Xserver/fb/fbarc.c index 315aa181c..0b386f70e 100644 --- a/nx-X11/programs/Xserver/fb/fbarc.c +++ b/nx-X11/programs/Xserver/fb/fbarc.c @@ -101,7 +101,7 @@ fbPolyArc (DrawablePtr pDrawable, y2 = box.y1 + (int)parcs->height + 1; box.y2 = y2; if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) && - (RECT_IN_REGION(pDrawable->pScreen, cclip, &box) == rgnIN) ) + (RegionContainsRect(cclip, &box) == rgnIN) ) (*arc) (dst, dstStride, dstBpp, parcs, pDrawable->x + dstXoff, pDrawable->y + dstYoff, pPriv->and, pPriv->xor); diff --git a/nx-X11/programs/Xserver/fb/fbbits.h b/nx-X11/programs/Xserver/fb/fbbits.h index 7dfff58b4..5cd7ae70f 100644 --- a/nx-X11/programs/Xserver/fb/fbbits.h +++ b/nx-X11/programs/Xserver/fb/fbbits.h @@ -668,7 +668,7 @@ POLYLINE (DrawablePtr pDrawable, int xoff = pDrawable->x; int yoff = pDrawable->y; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - BoxPtr pBox = REGION_EXTENTS (pDrawable->pScreen, fbGetCompositeClip (pGC)); + BoxPtr pBox = RegionExtents(fbGetCompositeClip (pGC)); FbBits *dst; int dstStride; @@ -800,7 +800,7 @@ POLYSEGMENT (DrawablePtr pDrawable, int xoff = pDrawable->x; int yoff = pDrawable->y; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - BoxPtr pBox = REGION_EXTENTS (pDrawable->pScreen, fbGetCompositeClip (pGC)); + BoxPtr pBox = RegionExtents(fbGetCompositeClip (pGC)); FbBits *dst; int dstStride; diff --git a/nx-X11/programs/Xserver/fb/fbbstore.c b/nx-X11/programs/Xserver/fb/fbbstore.c index 01ec9b7e0..e9eedde5b 100644 --- a/nx-X11/programs/Xserver/fb/fbbstore.c +++ b/nx-X11/programs/Xserver/fb/fbbstore.c @@ -39,8 +39,8 @@ fbSaveAreas(PixmapPtr pPixmap, fbCopyWindowProc (&pWin->drawable, &pPixmap->drawable, 0, - REGION_RECTS(prgnSave), - REGION_NUM_RECTS(prgnSave), + RegionRects(prgnSave), + RegionNumRects(prgnSave), xorg, yorg, FALSE, FALSE, @@ -57,8 +57,8 @@ fbRestoreAreas(PixmapPtr pPixmap, fbCopyWindowProc (&pPixmap->drawable, &pWin->drawable, 0, - REGION_RECTS(prgnRestore), - REGION_NUM_RECTS(prgnRestore), + RegionRects(prgnRestore), + RegionNumRects(prgnRestore), -xorg, -yorg, FALSE, FALSE, diff --git a/nx-X11/programs/Xserver/fb/fbcompose.c b/nx-X11/programs/Xserver/fb/fbcompose.c index f8169995f..07ae9490f 100644 --- a/nx-X11/programs/Xserver/fb/fbcompose.c +++ b/nx-X11/programs/Xserver/fb/fbcompose.c @@ -2896,7 +2896,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 if (pict->filter == PictFilterNearest) { if (pict->repeatType == RepeatNormal) { - if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) { + if (RegionNumRects(pict->pCompositeClip) == 1) { box = pict->pCompositeClip->extents; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -2927,7 +2927,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 y = MOD(v.vector[1]>>16, pict->pDrawable->height); x = MOD(v.vector[0]>>16, pict->pDrawable->width); } - if (POINT_IN_REGION (0, pict->pCompositeClip, x, y, &box)) + if (RegionContainsPoint(pict->pCompositeClip, x, y, &box)) buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed); else buffer[i] = 0; @@ -2938,7 +2938,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 } } } else { - if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) { + if (RegionNumRects(pict->pCompositeClip) == 1) { box = pict->pCompositeClip->extents; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -2970,7 +2970,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 y = v.vector[1]>>16; x = v.vector[0]>>16; } - if (POINT_IN_REGION (0, pict->pCompositeClip, x, y, &box)) + if (RegionContainsPoint(pict->pCompositeClip, x, y, &box)) buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed); else buffer[i] = 0; @@ -2983,7 +2983,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 } } else if (pict->filter == PictFilterBilinear) { if (pict->repeatType == RepeatNormal) { - if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) { + if (RegionNumRects(pict->pCompositeClip) == 1) { box = pict->pCompositeClip->extents; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -3082,14 +3082,14 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 b = bits + (y1 + pict->pDrawable->y)*stride; - tl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y1, &box) + tl = RegionContainsPoint(pict->pCompositeClip, x1, y1, &box) ? fetch(b, x1 + pict->pDrawable->x, indexed) : 0; - tr = POINT_IN_REGION(0, pict->pCompositeClip, x2, y1, &box) + tr = RegionContainsPoint(pict->pCompositeClip, x2, y1, &box) ? fetch(b, x2 + pict->pDrawable->x, indexed) : 0; b = bits + (y2 + pict->pDrawable->y)*stride; - bl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y2, &box) + bl = RegionContainsPoint(pict->pCompositeClip, x1, y2, &box) ? fetch(b, x1 + pict->pDrawable->x, indexed) : 0; - br = POINT_IN_REGION(0, pict->pCompositeClip, x2, y2, &box) + br = RegionContainsPoint(pict->pCompositeClip, x2, y2, &box) ? fetch(b, x2 + pict->pDrawable->x, indexed) : 0; ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; @@ -3112,7 +3112,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 } } } else { - if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) { + if (RegionNumRects(pict->pCompositeClip) == 1) { box = pict->pCompositeClip->extents; for (i = 0; i < width; ++i) { if (!v.vector[2]) { @@ -3209,14 +3209,14 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 b = bits + (y1 + pict->pDrawable->y)*stride; x_off = x1 + pict->pDrawable->x; - tl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y1, &box) + tl = RegionContainsPoint(pict->pCompositeClip, x1, y1, &box) ? fetch(b, x_off, indexed) : 0; - tr = POINT_IN_REGION(0, pict->pCompositeClip, x2, y1, &box) + tr = RegionContainsPoint(pict->pCompositeClip, x2, y1, &box) ? fetch(b, x_off + 1, indexed) : 0; b += stride; - bl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y2, &box) + bl = RegionContainsPoint(pict->pCompositeClip, x1, y2, &box) ? fetch(b, x_off, indexed) : 0; - br = POINT_IN_REGION(0, pict->pCompositeClip, x2, y2, &box) + br = RegionContainsPoint(pict->pCompositeClip, x2, y2, &box) ? fetch(b, x_off + 1, indexed) : 0; ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx; @@ -3274,7 +3274,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32 for (x = x1; x < x2; x++) { if (*p) { int tx = (pict->repeatType == RepeatNormal) ? MOD (x, pict->pDrawable->width) : x; - if (POINT_IN_REGION (0, pict->pCompositeClip, tx, ty, &box)) { + if (RegionContainsPoint(pict->pCompositeClip, tx, ty, &box)) { FbBits *b = bits + (ty + pict->pDrawable->y)*stride; CARD32 c = fetch(b, tx + pict->pDrawable->x, indexed); @@ -3563,8 +3563,8 @@ fbCompositeGeneral (CARD8 op, if (width > SCANLINE_BUFFER_LENGTH) scanline_buffer = (CARD32 *) malloc(width * 3 * sizeof(CARD32)); - n = REGION_NUM_RECTS (®ion); - pbox = REGION_RECTS (®ion); + n = RegionNumRects (®ion); + pbox = RegionRects (®ion); while (n--) { h = pbox->y2 - pbox->y1; @@ -3618,7 +3618,7 @@ fbCompositeGeneral (CARD8 op, } pbox++; } - REGION_UNINIT (pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); if (scanline_buffer != _scanline_buffer) free(scanline_buffer); diff --git a/nx-X11/programs/Xserver/fb/fbcopy.c b/nx-X11/programs/Xserver/fb/fbcopy.c index 1e7b93435..f68811ebb 100644 --- a/nx-X11/programs/Xserver/fb/fbcopy.c +++ b/nx-X11/programs/Xserver/fb/fbcopy.c @@ -306,8 +306,8 @@ fbCopyRegion (DrawablePtr pSrcDrawable, int nbox; BoxPtr pboxNew1, pboxNew2, pboxBase, pboxNext, pboxTmp; - pbox = REGION_RECTS(pDstRegion); - nbox = REGION_NUM_RECTS(pDstRegion); + pbox = RegionRects(pDstRegion); + nbox = RegionNumRects(pDstRegion); /* XXX we have to err on the side of safety when both are windows, * because we don't know if IncludeInferiors is being used. @@ -466,7 +466,7 @@ fbDoCopy (DrawablePtr pSrcDrawable, * VT is inactive, make sure the region isn't empty */ if (!((WindowPtr) pSrcDrawable)->parent && - REGION_NOTEMPTY (pSrcDrawable->pScreen, + RegionNotEmpty( &((WindowPtr) pSrcDrawable)->borderClip)) { /* @@ -548,9 +548,9 @@ fbDoCopy (DrawablePtr pSrcDrawable, blown region and call intersect */ cclip = fbGetCompositeClip(pGC); - if (REGION_NUM_RECTS(cclip) == 1) + if (RegionNumRects(cclip) == 1) { - BoxPtr pBox = REGION_RECTS(cclip); + BoxPtr pBox = RegionRects(cclip); if (box_x1 < pBox->x1) box_x1 = pBox->x1; if (box_x2 > pBox->x2) box_x2 = pBox->x2; @@ -563,7 +563,7 @@ fbDoCopy (DrawablePtr pSrcDrawable, /* Check to see if the region is empty */ if (box_x1 >= box_x2 || box_y1 >= box_y2) { - REGION_NULL(pGC->pScreen, &rgnDst); + RegionNull(&rgnDst); } else { @@ -572,25 +572,25 @@ fbDoCopy (DrawablePtr pSrcDrawable, box.y1 = box_y1; box.x2 = box_x2; box.y2 = box_y2; - REGION_INIT(pGC->pScreen, &rgnDst, &box, 1); + RegionInit(&rgnDst, &box, 1); } /* Clip against complex source if needed */ if (!fastSrc) { - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); - REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); + RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip); + RegionTranslate(&rgnDst, -dx, -dy); } /* Clip against complex dest if needed */ if (!fastDst) { - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, + RegionIntersect(&rgnDst, &rgnDst, fbGetCompositeClip(pGC)); } /* Do bit blitting */ - numRects = REGION_NUM_RECTS(&rgnDst); + numRects = RegionNumRects(&rgnDst); if (numRects && widthSrc && heightSrc) fbCopyRegion (pSrcDrawable, pDstDrawable, pGC, &rgnDst, dx, dy, copyProc, bitPlane, closure); @@ -604,9 +604,9 @@ fbDoCopy (DrawablePtr pSrcDrawable, xOut - pDstDrawable->x, yOut - pDstDrawable->y, (unsigned long) bitPlane); - REGION_UNINIT(pGC->pScreen, &rgnDst); + RegionUninit(&rgnDst); if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); fbValidateDrawable (pDstDrawable); return prgnExposed; } diff --git a/nx-X11/programs/Xserver/fb/fbfill.c b/nx-X11/programs/Xserver/fb/fbfill.c index c61ff3b4c..be6723c01 100644 --- a/nx-X11/programs/Xserver/fb/fbfill.c +++ b/nx-X11/programs/Xserver/fb/fbfill.c @@ -184,7 +184,7 @@ fbSolidBoxClipped (DrawablePtr pDrawable, fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/nx-X11/programs/Xserver/fb/fbfillrect.c b/nx-X11/programs/Xserver/fb/fbfillrect.c index 2a60da165..37a7b20f7 100644 --- a/nx-X11/programs/Xserver/fb/fbfillrect.c +++ b/nx-X11/programs/Xserver/fb/fbfillrect.c @@ -47,7 +47,7 @@ fbPolyFillRect(DrawablePtr pDrawable, xorg = pDrawable->x; yorg = pDrawable->y; - pextent = REGION_EXTENTS(pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; @@ -74,7 +74,7 @@ fbPolyFillRect(DrawablePtr pDrawable, if ((fullX1 >= fullX2) || (fullY1 >= fullY2)) continue; - n = REGION_NUM_RECTS (pClip); + n = RegionNumRects (pClip); if (n == 1) { fbFill (pDrawable, @@ -83,7 +83,7 @@ fbPolyFillRect(DrawablePtr pDrawable, } else { - pbox = REGION_RECTS(pClip); + pbox = RegionRects(pClip); /* * clip the rectangle to each box in the clip region * this is logically equivalent to calling Intersect() diff --git a/nx-X11/programs/Xserver/fb/fbfillsp.c b/nx-X11/programs/Xserver/fb/fbfillsp.c index e2bb71e3a..5d465482f 100644 --- a/nx-X11/programs/Xserver/fb/fbfillsp.c +++ b/nx-X11/programs/Xserver/fb/fbfillsp.c @@ -44,7 +44,7 @@ fbFillSpans (DrawablePtr pDrawable, int fullX1, fullX2, fullY1; int partX1, partX2; - pextent = REGION_EXTENTS(pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; @@ -69,7 +69,7 @@ fbFillSpans (DrawablePtr pDrawable, if (fullX1 >= fullX2) continue; - nbox = REGION_NUM_RECTS (pClip); + nbox = RegionNumRects (pClip); if (nbox == 1) { fbFill (pDrawable, @@ -78,7 +78,7 @@ fbFillSpans (DrawablePtr pDrawable, } else { - pbox = REGION_RECTS(pClip); + pbox = RegionRects(pClip); while(nbox--) { if (pbox->y1 <= fullY1 && fullY1 < pbox->y2) diff --git a/nx-X11/programs/Xserver/fb/fbgc.c b/nx-X11/programs/Xserver/fb/fbgc.c index fdd7a319c..a980023ef 100644 --- a/nx-X11/programs/Xserver/fb/fbgc.c +++ b/nx-X11/programs/Xserver/fb/fbgc.c @@ -211,7 +211,7 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) ) { miComputeCompositeClip (pGC, pDrawable); - pPriv->oneRect = REGION_NUM_RECTS(fbGetCompositeClip(pGC)) == 1; + pPriv->oneRect = RegionNumRects(fbGetCompositeClip(pGC)) == 1; } #ifdef FB_24_32BIT diff --git a/nx-X11/programs/Xserver/fb/fbglyph.c b/nx-X11/programs/Xserver/fb/fbglyph.c index bb0dda669..3c0913cf8 100644 --- a/nx-X11/programs/Xserver/fb/fbglyph.c +++ b/nx-X11/programs/Xserver/fb/fbglyph.c @@ -41,7 +41,7 @@ fbGlyphIn (RegionPtr pRegion, int height) { BoxRec box; - BoxPtr pExtents = REGION_EXTENTS (dummyScreen, pRegion); + BoxPtr pExtents = RegionExtents(pRegion); /* * Check extents by hand to avoid 16 bit overflows @@ -58,7 +58,7 @@ fbGlyphIn (RegionPtr pRegion, box.x2 = x + width; box.y1 = y; box.y2 = y + height; - return RECT_IN_REGION (dummyScreen, pRegion, &box) == rgnIN; + return RegionContainsRect(pRegion, &box) == rgnIN; } #ifdef FB_24BIT diff --git a/nx-X11/programs/Xserver/fb/fbimage.c b/nx-X11/programs/Xserver/fb/fbimage.c index 96bd8cf95..06b501b41 100644 --- a/nx-X11/programs/Xserver/fb/fbimage.c +++ b/nx-X11/programs/Xserver/fb/fbimage.c @@ -140,8 +140,8 @@ fbPutZImage (DrawablePtr pDrawable, fbGetStipDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { @@ -228,8 +228,8 @@ fbPutXYImage (DrawablePtr pDrawable, } } - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/nx-X11/programs/Xserver/fb/fbline.c b/nx-X11/programs/Xserver/fb/fbline.c index 8e99dd99f..0a9954998 100644 --- a/nx-X11/programs/Xserver/fb/fbline.c +++ b/nx-X11/programs/Xserver/fb/fbline.c @@ -119,7 +119,7 @@ fbPolyLine (DrawablePtr pDrawable, #ifndef FBNOPIXADDR if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && - REGION_NUM_RECTS (fbGetCompositeClip(pGC)) == 1) + RegionNumRects (fbGetCompositeClip(pGC)) == 1) { switch (pDrawable->bitsPerPixel) { case 8: line = fbPolyline8; break; @@ -156,7 +156,7 @@ fbPolySegment (DrawablePtr pDrawable, #ifndef FBNOPIXADDR if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && - REGION_NUM_RECTS (fbGetCompositeClip(pGC)) == 1) + RegionNumRects (fbGetCompositeClip(pGC)) == 1) { switch (pDrawable->bitsPerPixel) { case 8: seg = fbPolySegment8; break; diff --git a/nx-X11/programs/Xserver/fb/fboverlay.c b/nx-X11/programs/Xserver/fb/fboverlay.c index 81c54316f..49623ba4f 100644 --- a/nx-X11/programs/Xserver/fb/fboverlay.c +++ b/nx-X11/programs/Xserver/fb/fboverlay.c @@ -74,7 +74,7 @@ fbOverlayCreateWindow(WindowPtr pWin) */ if (!pWin->parent) { - REGION_EMPTY (pWin->drawable.pScreen, + RegionEmpty( &pScrPriv->layer[i].u.run.region); } return TRUE; @@ -92,7 +92,7 @@ fbOverlayCloseScreen (int iScreen, ScreenPtr pScreen) for (i = 0; i < pScrPriv->nlayers; i++) { (*pScreen->DestroyPixmap)(pScrPriv->layer[i].u.run.pixmap); - REGION_UNINIT (pScreen, &pScrPriv->layer[i].u.run.region); + RegionUninit(&pScrPriv->layer[i].u.run.region); } return TRUE; } @@ -146,7 +146,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen) pbits)) return FALSE; pScrPriv->layer[i].u.run.pixmap = pPixmap; - REGION_INIT(pScreen, &pScrPriv->layer[i].u.run.region, &box, 0); + RegionInit(&pScrPriv->layer[i].u.run.region, &box, 0); } pScreen->devPrivate = pScrPriv->layer[0].u.run.pixmap; return TRUE; @@ -174,24 +174,24 @@ fbOverlayUpdateLayerRegion (ScreenPtr pScreen, int i; RegionRec rgnNew; - if (!prgn || !REGION_NOTEMPTY(pScreen, prgn)) + if (!prgn || !RegionNotEmpty(prgn)) return; for (i = 0; i < pScrPriv->nlayers; i++) { if (i == layer) { /* add new piece to this fb */ - REGION_UNION (pScreen, + RegionUnion( &pScrPriv->layer[i].u.run.region, &pScrPriv->layer[i].u.run.region, prgn); } - else if (REGION_NOTEMPTY (pScreen, + else if (RegionNotEmpty( &pScrPriv->layer[i].u.run.region)) { /* paint new piece with chroma key */ - REGION_NULL (pScreen, &rgnNew); - REGION_INTERSECT (pScreen, + RegionNull(&rgnNew); + RegionIntersect( &rgnNew, prgn, &pScrPriv->layer[i].u.run.region); @@ -199,9 +199,9 @@ fbOverlayUpdateLayerRegion (ScreenPtr pScreen, &rgnNew, pScrPriv->layer[i].key, i); - REGION_UNINIT(pScreen, &rgnNew); + RegionUninit(&rgnNew); /* remove piece from other fbs */ - REGION_SUBTRACT (pScreen, + RegionSubtract( &pScrPriv->layer[i].u.run.region, &pScrPriv->layer[i].u.run.region, prgn); @@ -231,21 +231,21 @@ fbOverlayCopyWindow(WindowPtr pWin, /* * Clip to existing bits */ - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_NULL (pScreen, &rgnDst); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); - REGION_TRANSLATE(pScreen, &rgnDst, dx, dy); + RegionTranslate(prgnSrc, -dx, -dy); + RegionNull(&rgnDst); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); + RegionTranslate(&rgnDst, dx, dy); /* * Compute the portion of each fb affected by this copy */ for (i = 0; i < pScrPriv->nlayers; i++) { - REGION_NULL (pScreen, &layerRgn[i]); - REGION_INTERSECT(pScreen, &layerRgn[i], &rgnDst, + RegionNull(&layerRgn[i]); + RegionIntersect(&layerRgn[i], &rgnDst, &pScrPriv->layer[i].u.run.region); - if (REGION_NOTEMPTY (pScreen, &layerRgn[i])) + if (RegionNotEmpty(&layerRgn[i])) { - REGION_TRANSLATE(pScreen, &layerRgn[i], -dx, -dy); + RegionTranslate(&layerRgn[i], -dx, -dy); pPixmap = pScrPriv->layer[i].u.run.pixmap; fbCopyRegion (&pPixmap->drawable, &pPixmap->drawable, 0, @@ -258,12 +258,12 @@ fbOverlayCopyWindow(WindowPtr pWin, */ for (i = 0; i < pScrPriv->nlayers; i++) { - if (REGION_NOTEMPTY (pScreen, &layerRgn[i])) + if (RegionNotEmpty(&layerRgn[i])) fbOverlayUpdateLayerRegion (pScreen, i, &layerRgn[i]); - REGION_UNINIT(pScreen, &layerRgn[i]); + RegionUninit(&layerRgn[i]); } - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); } void diff --git a/nx-X11/programs/Xserver/fb/fbpict.c b/nx-X11/programs/Xserver/fb/fbpict.c index 5ab3756b9..330c55de3 100644 --- a/nx-X11/programs/Xserver/fb/fbpict.c +++ b/nx-X11/programs/Xserver/fb/fbpict.c @@ -1248,8 +1248,8 @@ fbComposite (CARD8 op, height)) return; - n = REGION_NUM_RECTS (®ion); - pbox = REGION_RECTS (®ion); + n = RegionNumRects (®ion); + pbox = RegionRects (®ion); while (n--) { h = pbox->y2 - pbox->y1; @@ -1309,7 +1309,7 @@ fbComposite (CARD8 op, } pbox++; } - REGION_UNINIT (pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); } #endif /* RENDER */ diff --git a/nx-X11/programs/Xserver/fb/fbpixmap.c b/nx-X11/programs/Xserver/fb/fbpixmap.c index 7ea288cb1..6c2cafd94 100644 --- a/nx-X11/programs/Xserver/fb/fbpixmap.c +++ b/nx-X11/programs/Xserver/fb/fbpixmap.c @@ -119,7 +119,7 @@ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \ if ((reg)->data->numRects == (reg)->data->size) \ { \ miRectAlloc(reg, 1); \ - fr = REGION_BOXPTR(reg); \ + fr = RegionBoxptr(reg); \ r = fr + (reg)->data->numRects; \ } \ r->x1 = (rx1); \ @@ -156,10 +156,10 @@ fbPixmapToRegion(PixmapPtr pPix) FbBits *pwLine; int nWidth; - pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1); + pReg = RegionCreate(NULL, 1); if(!pReg) return NullRegion; - FirstRect = REGION_BOXPTR(pReg); + FirstRect = RegionBoxptr(pReg); rects = FirstRect; pwLine = (FbBits *) pPix->devPrivate.ptr; @@ -305,8 +305,8 @@ fbPixmapToRegion(PixmapPtr pPix) pReg->extents.x1 = pReg->extents.x2 = 0; else { - pReg->extents.y1 = REGION_BOXPTR(pReg)->y1; - pReg->extents.y2 = REGION_END(pReg)->y2; + pReg->extents.y1 = RegionBoxptr(pReg)->y1; + pReg->extents.y2 = RegionEnd(pReg)->y2; if (pReg->data->numRects == 1) { xfree(pReg->data); diff --git a/nx-X11/programs/Xserver/fb/fbpoint.c b/nx-X11/programs/Xserver/fb/fbpoint.c index 5229d6970..06d8662ba 100644 --- a/nx-X11/programs/Xserver/fb/fbpoint.c +++ b/nx-X11/programs/Xserver/fb/fbpoint.c @@ -157,7 +157,7 @@ fbPolyPoint (DrawablePtr pDrawable, case 32: dots = fbDots32; break; } #endif - for (nBox = REGION_NUM_RECTS (pClip), pBox = REGION_RECTS (pClip); + for (nBox = RegionNumRects (pClip), pBox = RegionRects (pClip); nBox--; pBox++) (*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit, pDrawable->x, pDrawable->y, dstXoff, dstYoff, and, xor); diff --git a/nx-X11/programs/Xserver/fb/fbpseudocolor.c b/nx-X11/programs/Xserver/fb/fbpseudocolor.c index 469f3ea08..51f21ed21 100644 --- a/nx-X11/programs/Xserver/fb/fbpseudocolor.c +++ b/nx-X11/programs/Xserver/fb/fbpseudocolor.c @@ -166,10 +166,10 @@ int xxGeneration; # define PRINT_RECTS(rec) {\ int i;\ BoxPtr box;\ - ErrorF("RECTS: %i\n",REGION_NUM_RECTS(&rec));\ - if (REGION_NUM_RECTS(&rec) > 1) { \ - for (i = 0; i < REGION_NUM_RECTS(&rec); i++ ) {\ - box = REGION_BOX(&rec,i);\ + ErrorF("RECTS: %i\n",RegionNumRects(&rec));\ + if (RegionNumRects(&rec) > 1) { \ + for (i = 0; i < RegionNumRects(&rec); i++ ) {\ + box = RegionBox(&rec,i);\ ErrorF("x1: %hi x2: %hi y1: %hi y2: %hi\n", \ box->x1,box->x2,box->y1,box->y2);\ }\ @@ -308,8 +308,8 @@ xxCreateScreenResources(ScreenPtr pScreen) box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_NULL(pScreen, &pScrPriv->region); - REGION_INIT(pScreen, &pScrPriv->bRegion, &box, 0); + RegionNull(&pScrPriv->region); + RegionInit(&pScrPriv->bRegion, &box, 0); return TRUE; } @@ -323,7 +323,7 @@ xxCloseScreen (int iScreen, ScreenPtr pScreen) (*pScreen->DestroyPixmap)(pScrPriv->pPixmap); /* We don't need to free the baseColormap as FreeClientResourcess will have taken care of it. */ - REGION_UNINIT (pScreen, &pScrPriv->region); + RegionUninit(&pScrPriv->region); unwrap (pScrPriv,pScreen, CloseScreen); ret = pScreen->CloseScreen(iScreen,pScreen); @@ -678,7 +678,7 @@ xxCreateWindow(WindowPtr pWin) pWin->devPrivates[fbWinPrivateIndex].ptr = (void *) pScrPriv->pPixmap; PRINT_RECTS(pScrPriv->region); if (!pWin->parent) { - REGION_EMPTY (pWin->drawable.pScreen, &pScrPriv->region); + RegionEmpty(&pScrPriv->region); } PRINT_RECTS(pScrPriv->region); @@ -694,11 +694,11 @@ xxWalkChildren(WindowPtr pWin, RegionPtr pReg, PixmapPtr pPixmap) do { if (fbGetWindowPixmap(pCurWin) == pPixmap) { DBG("WalkWindow Add\n"); - REGION_UNION(pWin->drawable.pScreen,pReg,pReg, + RegionUnion(pReg,pReg, &pCurWin->borderClip); } else { DBG("WalkWindow Sub\n"); - REGION_SUBTRACT(pWin->drawable.pScreen,pReg,pReg, + RegionSubtract(pReg,pReg, &pCurWin->borderClip); } if (pCurWin->lastChild) @@ -713,7 +713,7 @@ xxPickMyWindows(WindowPtr pWin, RegionPtr pRgn) xxScrPriv(pScreen); if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { - REGION_UNION(pWin->drawable.pScreen,pRgn,pRgn,&pWin->borderClip); + RegionUnion(pRgn,pRgn,&pWin->borderClip); } if (pWin->lastChild) xxWalkChildren(pWin->lastChild,pRgn,pScrPriv->pPixmap); @@ -736,11 +736,11 @@ xxCopyWindow(WindowPtr pWin, dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_NULL(pScreen, &rgn_new); - REGION_UNION(pScreen, &rgn_new,&rgn_new,prgnSrc); - REGION_TRANSLATE(pScreen,&rgn_new,-dx,-dy); + RegionNull(&rgn_new); + RegionUnion(&rgn_new,&rgn_new,prgnSrc); + RegionTranslate(&rgn_new,-dx,-dy); - REGION_NULL(pScreen, &rgn); + RegionNull(&rgn); xxPickMyWindows(pWin,&rgn); unwrap (pScrPriv, pScreen, CopyWindow); @@ -749,19 +749,19 @@ xxCopyWindow(WindowPtr pWin, pWin->devPrivates[fbWinPrivateIndex].ptr = pPixmap; wrap(pScrPriv, pScreen, CopyWindow, xxCopyWindow); - REGION_INTERSECT(pScreen,&rgn,&rgn,&rgn_new); - if (REGION_NOTEMPTY (pScreen,&rgn)) { + RegionIntersect(&rgn,&rgn,&rgn_new); + if (RegionNotEmpty(&rgn)) { fbCopyRegion(&pScrPriv->pPixmap->drawable,&pScrPriv->pPixmap->drawable, 0,&rgn,dx,dy,fbCopyWindowProc,0,(void*)0); - REGION_TRANSLATE(pScreen,&rgn,dx,dy); - REGION_INTERSECT(pScreen,&rgn_new,&pScrPriv->region,&rgn); - REGION_SUBTRACT(pScreen,&pScrPriv->region,&pScrPriv->region,&rgn); - REGION_TRANSLATE(pScreen,&rgn_new,-dx,-dy); - REGION_UNION(pScreen,&pScrPriv->region,&pScrPriv->region,&rgn_new); + RegionTranslate(&rgn,dx,dy); + RegionIntersect(&rgn_new,&pScrPriv->region,&rgn); + RegionSubtract(&pScrPriv->region,&pScrPriv->region,&rgn); + RegionTranslate(&rgn_new,-dx,-dy); + RegionUnion(&pScrPriv->region,&pScrPriv->region,&rgn_new); } #if 1 - REGION_UNINIT(pScreen,&rgn_new); - REGION_UNINIT(pScreen,&rgn); + RegionUninit(&rgn_new); + RegionUninit(&rgn); #endif } @@ -775,14 +775,14 @@ xxWindowExposures (WindowPtr pWin, if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { DBG("WindowExposures\n"); PRINT_RECTS(pScrPriv->region); - REGION_UNION(pWin->drawable.pScreen,&pScrPriv->region, + RegionUnion(&pScrPriv->region, &pScrPriv->region, prgn); PRINT_RECTS(pScrPriv->region); } else { DBG("WindowExposures NonPseudo\n"); PRINT_RECTS(pScrPriv->region); - REGION_SUBTRACT(pWin->drawable.pScreen,&pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, prgn); PRINT_RECTS(pScrPriv->region); @@ -800,23 +800,23 @@ xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) DBG("xxPaintWindow\n"); - REGION_NULL (pWin->drawable.pScreen, &rgni); + RegionNull(&rgni); #if 0 - REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, &pWin->borderClip); - REGION_INTERSECT(pWin->drawable.pScreen, &rgni, &rgni, pRegion); + RegionUnion(&rgni, &rgni, &pWin->borderClip); + RegionIntersect(&rgni, &rgni, pRegion); #else - REGION_UNION (pWin->drawable.pScreen, &rgni, &rgni, pRegion); + RegionUnion(&rgni, &rgni, pRegion); #endif switch (what) { case PW_BORDER: - REGION_SUBTRACT (pWin->drawable.pScreen, &rgni, &rgni, &pWin->winSize); + RegionSubtract(&rgni, &rgni, &pWin->winSize); if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { DBG("PaintWindowBorder\n"); - REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region, + RegionUnion(&pScrPriv->region, &pScrPriv->region, &rgni); } else { DBG("PaintWindowBorder NoOverlay\n"); - REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, &rgni); } unwrap (pScrPriv, pWin->drawable.pScreen, PaintWindowBorder); @@ -829,15 +829,15 @@ xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) case None: break; default: - REGION_INTERSECT (pWin->drawable.pScreen, &rgni, + RegionIntersect(&rgni, &rgni,&pWin->winSize); if (fbGetWindowPixmap(pWin) == pScrPriv->pPixmap) { DBG("PaintWindowBackground\n"); - REGION_UNION (pWin->drawable.pScreen, &pScrPriv->region, + RegionUnion(&pScrPriv->region, &pScrPriv->region, &rgni); } else { DBG("PaintWindowBackground NoOverlay\n"); - REGION_SUBTRACT (pWin->drawable.pScreen, &pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, &rgni); } break; @@ -852,7 +852,7 @@ xxPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what) PRINT_RECTS(rgni); PRINT_RECTS(pScrPriv->region); #if 1 - REGION_UNINIT(pWin->drawable.pScreen,&rgni); + RegionUninit(&rgni); #endif } @@ -862,8 +862,8 @@ xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, { xxScrPriv(pScreen); CARD32 mask = (1 << pScrPriv->myDepth) - 1; - int num = REGION_NUM_RECTS(pReg); - BoxPtr pbox = REGION_RECTS(pReg); + int num = RegionNumRects(pReg); + BoxPtr pbox = RegionRects(pReg); int width, height; CARD8 *src; CARD16 *dst, *dst_base; @@ -905,8 +905,8 @@ xxUpdateCmapPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, { xxScrPriv(pScreen); CARD32 mask = (1 << pScrPriv->myDepth) - 1; - int num = REGION_NUM_RECTS(pReg); - BoxPtr pbox = REGION_RECTS(pReg); + int num = RegionNumRects(pReg); + BoxPtr pbox = RegionRects(pReg); int width, height; CARD8 *src; CARD16 *dst, *dst_base; @@ -950,14 +950,14 @@ xxUpdateCmapPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, static void xxGetWindowRegion(WindowPtr pWin,RegionPtr winreg) { - REGION_NULL(pWin->drawable.pScreen,winreg); + RegionNull(winreg); /* get visible part of the border ...Argh */ - REGION_SUBTRACT(pWin->drawable.pScreen,winreg,&pWin->borderSize, + RegionSubtract(winreg,&pWin->borderSize, &pWin->winSize); - REGION_INTERSECT(pWin->drawable.pScreen,winreg,winreg, + RegionIntersect(winreg,winreg, &pWin->borderClip); /* add window interior excluding children */ - REGION_UNION(pWin->drawable.pScreen,winreg,winreg, + RegionUnion(winreg,winreg, &pWin->clipList); } @@ -985,18 +985,18 @@ xxUpdateRegion(WindowPtr pWin, void * unused) if (!pCmapPriv->dirty) goto CONTINUE; - REGION_NULL (pScreen, &rgni); + RegionNull(&rgni); /* This will be taken care of when damaged regions are updated */ - REGION_SUBTRACT(pScreen, &rgni, &winreg, &pScrPriv->region); - if (REGION_NOTEMPTY (pScreen,&rgni)) + RegionSubtract(&rgni, &winreg, &pScrPriv->region); + if (RegionNotEmpty(&rgni)) xxUpdateCmapPseudocolorRegion(pScreen,&rgni, pCmapPriv); } CONTINUE: - REGION_NULL (pScreen, &rgni); - REGION_INTERSECT (pScreen, &rgni, &winreg, &pScrPriv->region); + RegionNull(&rgni); + RegionIntersect(&rgni, &winreg, &pScrPriv->region); - if (REGION_NOTEMPTY (pScreen,&rgni)) { + if (RegionNotEmpty(&rgni)) { if (pmap == (void *) -1) { pmap = (ColormapPtr)LookupIDByType(wColormap(pWin),RT_COLORMAP); @@ -1008,12 +1008,12 @@ xxUpdateRegion(WindowPtr pWin, void * unused) if (pCmapPriv != (void *)-1) xxCopyPseudocolorRegion(pScreen,&rgni, pCmapPriv); - REGION_SUBTRACT(pScreen, &pScrPriv->region, &pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, &rgni); } #if 1 - REGION_UNINIT(pScreen,&rgni); - REGION_UNINIT(pScreen,&winreg); + RegionUninit(&rgni); + RegionUninit(&winreg); #endif } return WT_WALKCHILDREN; @@ -1033,7 +1033,7 @@ xxUpdateFb(ScreenPtr pScreen) WalkTree(pScreen,xxUpdateRegion,NULL); #if 0 - if (REGION_NOTEMPTY (pScreen,&pScrPriv->region)) { + if (RegionNotEmpty(&pScrPriv->region)) { ColormapPtr pmap = (void *) -1; xxCmapPrivPtr pCmapPriv; @@ -1042,7 +1042,7 @@ xxUpdateFb(ScreenPtr pScreen) pCmapPriv = xxGetCmapPriv(pmap); if (pCmapPriv != (void *)-1) xxCopyPseudocolorRegion(pScreen,&pScrPriv->region, pCmapPriv); - REGION_SUBTRACT(pScreen, &pScrPriv->region, &pScrPriv->region, + RegionSubtract(&pScrPriv->region, &pScrPriv->region, &pScrPriv->region); } #endif @@ -1071,7 +1071,7 @@ xxBlockHandler (void * data, ScreenPtr pScreen = (ScreenPtr) data; xxScrPriv(pScreen); - if (REGION_NOTEMPTY (pScreen,&pScrPriv->region) || pScrPriv->colormapDirty) + if (RegionNotEmpty(&pScrPriv->region) || pScrPriv->colormapDirty) xxUpdateFb (pScreen); } @@ -1241,15 +1241,15 @@ GCOps xxGCOps = { if (BOX_NOT_EMPTY(box)) { \ RegionRec region; \ ScreenPtr pScreen = pGC->pScreen;\ - REGION_INIT (pScreen, ®ion, &box, 1); \ - REGION_INTERSECT(pScreen,®ion,®ion,\ + RegionInit(®ion, &box, 1); \ + RegionIntersect(®ion,®ion,\ (pGC)->pCompositeClip);\ - if (REGION_NOTEMPTY(pScreen,®ion)) { \ + if (RegionNotEmpty(®ion)) { \ xxScrPriv(pScreen);\ PRINT_RECTS(pScrPriv->region);\ - REGION_UNION(pScreen,&pScrPriv->region,&pScrPriv->region,®ion);\ + RegionUnion(&pScrPriv->region,&pScrPriv->region,®ion);\ PRINT_RECTS(pScrPriv->region);\ - REGION_UNINIT(pScreen,®ion);\ + RegionUninit(®ion);\ }\ }\ } @@ -2234,11 +2234,11 @@ xxPushPixels( RegionRec region; \ xxScrPriv(pScreen);\ ScreenPtr pScreen = pScreen;\ - REGION_INIT (pScreen, ®ion, &box, 1); \ + RegionInit(®ion, &box, 1); \ PRINT_RECTS(pScrPriv->region);\ - REGION_UNION(pScreen,&pScrPriv->region,&pScrPriv->region,®ion);\ + RegionUnion(&pScrPriv->region,&pScrPriv->region,®ion);\ PRINT_RECTS(pScrPriv->region);\ - REGION_UNINIT(pScreen,®ion);\ + RegionUninit(®ion);\ }\ } diff --git a/nx-X11/programs/Xserver/fb/fbpush.c b/nx-X11/programs/Xserver/fb/fbpush.c index 8f1336963..78d2e450d 100644 --- a/nx-X11/programs/Xserver/fb/fbpush.c +++ b/nx-X11/programs/Xserver/fb/fbpush.c @@ -192,8 +192,8 @@ fbPushImage (DrawablePtr pDrawable, BoxPtr pbox; int x1, y1, x2, y2; - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/nx-X11/programs/Xserver/fb/fbseg.c b/nx-X11/programs/Xserver/fb/fbseg.c index 18a996e0c..2947992a6 100644 --- a/nx-X11/programs/Xserver/fb/fbseg.c +++ b/nx-X11/programs/Xserver/fb/fbseg.c @@ -615,8 +615,8 @@ fbSegment (DrawablePtr pDrawable, unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - nBox = REGION_NUM_RECTS (pClip); - pBox = REGION_RECTS (pClip); + nBox = RegionNumRects (pClip); + pBox = RegionRects (pClip); bres = fbSelectBres (pDrawable, pGC); diff --git a/nx-X11/programs/Xserver/fb/fbsetsp.c b/nx-X11/programs/Xserver/fb/fbsetsp.c index eefc2da82..c7074f036 100644 --- a/nx-X11/programs/Xserver/fb/fbsetsp.c +++ b/nx-X11/programs/Xserver/fb/fbsetsp.c @@ -63,8 +63,8 @@ fbSetSpans (DrawablePtr pDrawable, xoff = (int) (((long) src) & (FB_MASK >> 3)); s = (FbBits *) (src - xoff); xoff <<= 3; - n = REGION_NUM_RECTS(pClip); - pbox = REGION_RECTS (pClip); + n = RegionNumRects(pClip); + pbox = RegionRects (pClip); while (n--) { if (pbox->y1 > ppt->y) diff --git a/nx-X11/programs/Xserver/fb/fbwindow.c b/nx-X11/programs/Xserver/fb/fbwindow.c index 1269902b9..5ce7ba729 100644 --- a/nx-X11/programs/Xserver/fb/fbwindow.c +++ b/nx-X11/programs/Xserver/fb/fbwindow.c @@ -132,15 +132,15 @@ fbCopyWindow(WindowPtr pWin, dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); - REGION_NULL (pWin->drawable.pScreen, &rgnDst); + RegionNull(&rgnDst); - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); #ifdef COMPOSITE if (pPixmap->screen_x || pPixmap->screen_y) - REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst, + RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y); #endif @@ -148,7 +148,7 @@ fbCopyWindow(WindowPtr pWin, 0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0); - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); + RegionUninit(&rgnDst); fbValidateDrawable (&pWin->drawable); } @@ -215,8 +215,8 @@ fbFillRegionSolid (DrawablePtr pDrawable, FbStride dstStride; int dstBpp; int dstXoff, dstYoff; - int n = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); + int n = RegionNumRects(pRegion); + BoxPtr pbox = RegionRects(pRegion); fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); @@ -253,8 +253,8 @@ fbFillRegionTiled (DrawablePtr pDrawable, int tileBpp; int tileXoff, tileYoff; /* XXX assumed to be zero */ int tileWidth, tileHeight; - int n = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); + int n = RegionNumRects(pRegion); + BoxPtr pbox = RegionRects(pRegion); int xRot = pDrawable->x; int yRot = pDrawable->y; diff --git a/nx-X11/programs/Xserver/fix-region b/nx-X11/programs/Xserver/fix-region new file mode 100755 index 000000000..61fe6e0fb --- /dev/null +++ b/nx-X11/programs/Xserver/fix-region @@ -0,0 +1,40 @@ +#!/bin/sh +sed -i \ + -e 's/REGION_NIL\b/RegionNil/g' \ + -e 's/REGION_NAR\b/RegionNar/g' \ + -e 's/REGION_NUM_RECTS\b/RegionNumRects/g' \ + -e 's/REGION_SIZE\b/RegionSize/g' \ + -e 's/REGION_RECTS\b/RegionRects/g' \ + -e 's/REGION_BOXPTR\b/RegionBoxptr/g' \ + -e 's/REGION_BOX\b/RegionBox/g' \ + -e 's/REGION_TOP\b/RegionTop/g' \ + -e 's/REGION_END\b/RegionEnd/g' \ + -e 's/REGION_SZOF\b/RegionSizeof/g' \ + -e 's/REGION_CREATE *([^,]*, */RegionCreate(/g' \ + -e 's/REGION_COPY *([^,]*, */RegionCopy(/g' \ + -e 's/REGION_DESTROY *([^,]*, */RegionDestroy(/g' \ + -e 's/REGION_INTERSECT *([^,]*, */RegionIntersect(/g' \ + -e 's/REGION_UNION *([^,]*, */RegionUnion(/g' \ + -e 's/REGION_SUBTRACT *([^,]*, */RegionSubtract(/g' \ + -e 's/REGION_INVERSE *([^,]*, */RegionInverse(/g' \ + -e 's/REGION_TRANSLATE *([^,]*, */RegionTranslate(/g' \ + -e 's/RECT_IN_REGION *([^,]*, */RegionContainsRect(/g' \ + -e 's/POINT_IN_REGION *([^,]*, */RegionContainsPoint(/g' \ + -e 's/REGION_EQUAL *([^,]*, */RegionEqual(/g' \ + -e 's/REGION_APPEND *([^,]*, */RegionAppend(/g' \ + -e 's/REGION_VALIDATE *([^,]*, */RegionValidate(/g' \ + -e 's/BITMAP_TO_REGION\b/BitmapToRegion/g' \ + -e 's/RECTS_TO_REGION *([^,]*, */RegionFromRects(/g' \ + -e 's/REGION_BREAK *([^,]*, */RegionBreak(/g' \ + -e 's/REGION_INIT *([^,]*, */RegionInit(/g' \ + -e 's/REGION_UNINIT *([^,]*, */RegionUninit(/g' \ + -e 's/REGION_RESET *([^,]*, */RegionReset(/g' \ + -e 's/REGION_NOTEMPTY *([^,]*, */RegionNotEmpty(/g' \ + -e 's/REGION_BROKEN *([^,]*, */RegionBroken(/g' \ + -e 's/REGION_EMPTY *([^,]*, */RegionEmpty(/g' \ + -e 's/REGION_EXTENTS *([^,]*, */RegionExtents(/g' \ + -e 's/REGION_NUM_RECTS *([^,]*, */RegionNumRects(/g' \ + -e 's/REGION_RECTS *([^,]*, */RegionRects(/g' \ + -e 's/REGION_NULL *([^,]*, */RegionNull(/g' \ + -e 's/REGION_NULL$/RegionNull/g' \ + "$@" 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); diff --git a/nx-X11/programs/Xserver/include/regionstr.h b/nx-X11/programs/Xserver/include/regionstr.h index cf41170a6..b1eb100a5 100644 --- a/nx-X11/programs/Xserver/include/regionstr.h +++ b/nx-X11/programs/Xserver/include/regionstr.h @@ -103,73 +103,73 @@ extern RegDataRec miBrokenData; #ifdef NEED_SCREEN_REGIONS -#define REGION_CREATE(_pScreen, _rect, _size) \ +#define RegionCreate(_rect, _size) \ (*(REG_pScreen)->RegionCreate)(_rect, _size) -#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ +#define RegionInit(_pReg, _rect, _size) \ (*(REG_pScreen)->RegionInit)(_pReg, _rect, _size) -#define REGION_COPY(_pScreen, dst, src) \ +#define RegionCopy(dst, src) \ (*(REG_pScreen)->RegionCopy)(dst, src) -#define REGION_DESTROY(_pScreen, _pReg) \ +#define RegionDestroy(_pReg) \ (*(REG_pScreen)->RegionDestroy)(_pReg) -#define REGION_UNINIT(_pScreen, _pReg) \ +#define RegionUninit(_pReg) \ (*(REG_pScreen)->RegionUninit)(_pReg) -#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \ +#define RegionIntersect(newReg, reg1, reg2) \ (*(REG_pScreen)->Intersect)(newReg, reg1, reg2) -#define REGION_UNION(_pScreen, newReg, reg1, reg2) \ +#define RegionUnion(newReg, reg1, reg2) \ (*(REG_pScreen)->Union)(newReg, reg1, reg2) -#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \ +#define RegionSubtract(newReg, reg1, reg2) \ (*(REG_pScreen)->Subtract)(newReg, reg1, reg2) -#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \ +#define RegionInverse(newReg, reg1, invRect) \ (*(REG_pScreen)->Inverse)(newReg, reg1, invRect) -#define REGION_RESET(_pScreen, _pReg, _pBox) \ +#define RegionReset(_pReg, _pBox) \ (*(REG_pScreen)->RegionReset)(_pReg, _pBox) -#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \ +#define RegionTranslate(_pReg, _x, _y) \ (*(REG_pScreen)->TranslateRegion)(_pReg, _x, _y) -#define RECT_IN_REGION(_pScreen, _pReg, prect) \ +#define RegionContainsRect(_pReg, prect) \ (*(REG_pScreen)->RectIn)(_pReg, prect) -#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \ +#define RegionContainsPoint(_pReg, _x, _y, prect) \ (*(REG_pScreen)->PointInRegion)(_pReg, _x, _y, prect) -#define REGION_NOTEMPTY(_pScreen, _pReg) \ +#define RegionNotEmpty(_pReg) \ (*(REG_pScreen)->RegionNotEmpty)(_pReg) -#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \ +#define RegionEqual(_pReg1, _pReg2) \ (*(REG_pScreen)->RegionEqual)(_pReg1, _pReg2) -#define REGION_BROKEN(_pScreen, _pReg) \ +#define RegionBroken(_pReg) \ (*(REG_pScreen)->RegionBroken)(_pReg) -#define REGION_BREAK(_pScreen, _pReg) \ +#define RegionBreak(_pReg) \ (*(REG_pScreen)->RegionBreak)(_pReg) -#define REGION_EMPTY(_pScreen, _pReg) \ +#define RegionEmpty(_pReg) \ (*(REG_pScreen)->RegionEmpty)(_pReg) -#define REGION_EXTENTS(_pScreen, _pReg) \ +#define RegionExtents(_pReg) \ (*(REG_pScreen)->RegionExtents)(_pReg) -#define REGION_APPEND(_pScreen, dstrgn, rgn) \ +#define RegionAppend(dstrgn, rgn) \ (*(REG_pScreen)->RegionAppend)(dstrgn, rgn) -#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \ +#define RegionValidate(badreg, pOverlap) \ (*(REG_pScreen)->RegionValidate)(badreg, pOverlap) #define BITMAP_TO_REGION(_pScreen, pPix) \ (*(REG_pScreen)->BitmapToRegion)(pPix) -#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ +#define RegionFromRects(nrects, prect, ctype) \ (*(REG_pScreen)->RectsToRegion)(nrects, prect, ctype) #else /* !NEED_SCREEN_REGIONS */ @@ -177,80 +177,80 @@ extern RegDataRec miBrokenData; /* Reference _pScreen macro argument and check its type */ #define REGION_SCREEN(_pScreen) (void)((REG_pScreen)->myNum) -#define REGION_CREATE(_pScreen, _rect, _size) \ +#define RegionCreate(_rect, _size) \ (REGION_SCREEN(_pScreen), miRegionCreate(_rect, _size)) -#define REGION_COPY(_pScreen, dst, src) \ +#define RegionCopy(dst, src) \ (REGION_SCREEN(_pScreen), miRegionCopy(dst, src)) -#define REGION_DESTROY(_pScreen, _pReg) \ +#define RegionDestroy(_pReg) \ (REGION_SCREEN(_pScreen), miRegionDestroy(_pReg)) -#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \ +#define RegionIntersect(newReg, reg1, reg2) \ (REGION_SCREEN(_pScreen), miIntersect(newReg, reg1, reg2)) -#define REGION_UNION(_pScreen, newReg, reg1, reg2) \ +#define RegionUnion(newReg, reg1, reg2) \ (REGION_SCREEN(_pScreen), miUnion(newReg, reg1, reg2)) -#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \ +#define RegionSubtract(newReg, reg1, reg2) \ (REGION_SCREEN(_pScreen), miSubtract(newReg, reg1, reg2)) -#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \ +#define RegionInverse(newReg, reg1, invRect) \ (REGION_SCREEN(_pScreen), miInverse(newReg, reg1, invRect)) -#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \ +#define RegionTranslate(_pReg, _x, _y) \ (REGION_SCREEN(_pScreen), miTranslateRegion(_pReg, _x, _y)) -#define RECT_IN_REGION(_pScreen, _pReg, prect) \ +#define RegionContainsRect(_pReg, prect) \ (REGION_SCREEN(_pScreen), miRectIn(_pReg, prect)) -#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \ +#define RegionContainsPoint(_pReg, _x, _y, prect) \ (REGION_SCREEN(_pScreen), miPointInRegion(_pReg, _x, _y, prect)) -#define REGION_APPEND(_pScreen, dstrgn, rgn) \ +#define RegionAppend(dstrgn, rgn) \ (REGION_SCREEN(_pScreen), miRegionAppend(dstrgn, rgn)) -#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \ +#define RegionValidate(badreg, pOverlap) \ (REGION_SCREEN(_pScreen), miRegionValidate(badreg, pOverlap)) #define BITMAP_TO_REGION(_pScreen, pPix) \ (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */ -#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ +#define RegionFromRects(nrects, prect, ctype) \ (REGION_SCREEN(_pScreen), miRectsToRegion(nrects, prect, ctype)) -#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \ +#define RegionEqual(_pReg1, _pReg2) \ (REGION_SCREEN(_pScreen), miRegionEqual(_pReg1, _pReg2)) -#define REGION_BREAK(_pScreen, _pReg) \ +#define RegionBreak(_pReg) \ (REGION_SCREEN(_pScreen), miRegionBreak(_pReg)) #ifdef DONT_INLINE_REGION_OPS -#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ +#define RegionInit(_pReg, _rect, _size) \ (REGION_SCREEN(_pScreen), miRegionInit(_pReg, _rect, _size)) -#define REGION_UNINIT(_pScreen, _pReg) \ +#define RegionUninit(_pReg) \ (REGION_SCREEN(_pScreen), miRegionUninit(_pReg)) -#define REGION_RESET(_pScreen, _pReg, _pBox) \ +#define RegionReset(_pReg, _pBox) \ (REGION_SCREEN(_pScreen), miRegionReset(_pReg, _pBox)) -#define REGION_NOTEMPTY(_pScreen, _pReg) \ +#define RegionNotEmpty(_pReg) \ (REGION_SCREEN(_pScreen), miRegionNotEmpty(_pReg)) -#define REGION_BROKEN(_pScreen, _pReg) \ +#define RegionBroken(_pReg) \ (REGION_SCREEN(_pScreen), miRegionBroken(_pReg)) -#define REGION_EMPTY(_pScreen, _pReg) \ +#define RegionEmpty(_pReg) \ (REGION_SCREEN(_pScreen), miRegionEmpty(_pReg)) -#define REGION_EXTENTS(_pScreen, _pReg) \ +#define RegionExtents(_pReg) \ (REGION_SCREEN(_pScreen), miRegionExtents(_pReg)) #else /* inline certain simple region ops for performance */ -#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ +#define RegionInit(_pReg, _rect, _size) \ { \ REGION_SCREEN(_pScreen); \ if (_rect) \ @@ -274,7 +274,7 @@ extern RegDataRec miBrokenData; } -#define REGION_UNINIT(_pScreen, _pReg) \ +#define RegionUninit(_pReg) \ { \ REGION_SCREEN(_pScreen); \ if ((_pReg)->data && (_pReg)->data->size) { \ @@ -283,32 +283,32 @@ extern RegDataRec miBrokenData; } \ } -#define REGION_RESET(_pScreen, _pReg, _pBox) \ +#define RegionReset(_pReg, _pBox) \ { \ REGION_SCREEN(_pScreen); \ (_pReg)->extents = *(_pBox); \ - REGION_UNINIT(_pScreen, _pReg); \ + RegionUninit(_pReg); \ (_pReg)->data = (RegDataPtr)NULL; \ } -#define REGION_NOTEMPTY(_pScreen, _pReg) \ +#define RegionNotEmpty(_pReg) \ (REGION_SCREEN(_pScreen), !REGION_NIL(_pReg)) -#define REGION_BROKEN(_pScreen, _pReg) \ +#define RegionBroken(_pReg) \ (REGION_SCREEN(_pScreen), REGION_NAR(_pReg)) -#define REGION_EMPTY(_pScreen, _pReg) \ +#define RegionEmpty(_pReg) \ { \ - REGION_UNINIT(_pScreen, _pReg); \ + RegionUninit(_pReg); \ (_pReg)->extents.x2 = (_pReg)->extents.x1; \ (_pReg)->extents.y2 = (_pReg)->extents.y1; \ (_pReg)->data = &miEmptyData; \ } -#define REGION_EXTENTS(_pScreen, _pReg) \ +#define RegionExtents(_pReg) \ (REGION_SCREEN(_pScreen), &(_pReg)->extents) -#define REGION_NULL(_pScreen, _pReg) \ +#define RegionNull(_pReg) \ { \ REGION_SCREEN(_pScreen); \ (_pReg)->extents = miEmptyBox; \ @@ -319,9 +319,9 @@ extern RegDataRec miBrokenData; #endif /* NEED_SCREEN_REGIONS */ -#ifndef REGION_NULL -#define REGION_NULL(_pScreen, _pReg) \ - REGION_INIT(_pScreen, _pReg, NullBox, 1) +#ifndef RegionNull +#define RegionNull(_pReg) \ + RegionInit(_pReg, NullBox, 1) #endif /* moved from mi.h */ diff --git a/nx-X11/programs/Xserver/mi/mibank.c b/nx-X11/programs/Xserver/mi/mibank.c index b5da2267f..24e202094 100644 --- a/nx-X11/programs/Xserver/mi/mibank.c +++ b/nx-X11/programs/Xserver/mi/mibank.c @@ -607,8 +607,8 @@ miBankCopy( if (!pScreenPriv->pBanks[ns]) continue; - nBox = REGION_NUM_RECTS(pScreenPriv->pBanks[ns]); - pBox = REGION_RECTS(pScreenPriv->pBanks[ns]); + nBox = RegionNumRects(pScreenPriv->pBanks[ns]); + pBox = RegionRects(pScreenPriv->pBanks[ns]); for (; nBox--; pBox++) { @@ -668,8 +668,8 @@ miBankCopy( * It's faster to let the lower-level CopyArea do the clipping * within each bank. */ - nBox = REGION_NUM_RECTS(pScreenPriv->pBanks[nd]); - pBox = REGION_RECTS(pScreenPriv->pBanks[nd]); + nBox = RegionNumRects(pScreenPriv->pBanks[nd]); + pBox = RegionRects(pScreenPriv->pBanks[nd]); for (; nBox--; pBox++) { @@ -775,10 +775,10 @@ miBankCopy( } else { - REGION_INIT(pScreen, &rgnDst, &fastBox, 1); - REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrcClip); - pBox = REGION_RECTS(&rgnDst); - nBox = REGION_NUM_RECTS(&rgnDst); + RegionInit(&rgnDst, &fastBox, 1); + RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip); + pBox = RegionRects(&rgnDst); + nBox = RegionNumRects(&rgnDst); } /* @@ -804,8 +804,8 @@ miBankCopy( if (!pScreenPriv->pBanks[ns]) continue; - nBoxClipSrc = REGION_NUM_RECTS(pScreenPriv->pBanks[ns]); - pBoxClipSrc = REGION_RECTS(pScreenPriv->pBanks[ns]); + nBoxClipSrc = RegionNumRects(pScreenPriv->pBanks[ns]); + pBoxClipSrc = RegionRects(pScreenPriv->pBanks[ns]); for (; nBoxClipSrc--; pBoxClipSrc++) { @@ -836,9 +836,9 @@ miBankCopy( * so use the bank clips here instead. */ nBoxClipDst = - REGION_NUM_RECTS(pScreenPriv->pBanks[nd]); + RegionNumRects(pScreenPriv->pBanks[nd]); pBoxClipDst = - REGION_RECTS(pScreenPriv->pBanks[nd]); + RegionRects(pScreenPriv->pBanks[nd]); for (; nBoxClipDst--; pBoxClipDst++) { @@ -878,7 +878,7 @@ miBankCopy( pScreenPriv->nPixelsPerScanlinePadUnit) || (ccBox.x2 % pScreenPriv->nPixelsPerScanlinePadUnit) || - (RECT_IN_REGION(pScreen, + (RegionContainsRect( pGCPriv->pBankedClips[nd], &ccBox) != rgnIN))) pQueue->fastBlit = FALSE; @@ -892,9 +892,9 @@ miBankCopy( if (!fastClip) { - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); if (freeSrcClip) - REGION_DESTROY(pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); } pQueueNew = pQueue; @@ -1405,16 +1405,16 @@ miBankValidateGC( continue; if (!(prgnClip = pGCPriv->pBankedClips[i])) - prgnClip = REGION_CREATE(pScreen, NULL, 1); + prgnClip = RegionCreate(NULL, 1); - REGION_INTERSECT(pScreen, prgnClip, + RegionIntersect(prgnClip, pScreenPriv->pBanks[i], pGC->pCompositeClip); - if ((REGION_NUM_RECTS(prgnClip) <= 1) && + if ((RegionNumRects(prgnClip) <= 1) && ((prgnClip->extents.x1 == prgnClip->extents.x2) || (prgnClip->extents.y1 == prgnClip->extents.y2))) { - REGION_DESTROY(pScreen, prgnClip); + RegionDestroy(prgnClip); pGCPriv->pBankedClips[i] = NULL; } else @@ -1469,7 +1469,7 @@ miBankValidateGC( if (!pGCPriv->pBankedClips[i]) continue; - REGION_DESTROY(pScreen, pGCPriv->pBankedClips[i]); + RegionDestroy(pGCPriv->pBankedClips[i]); pGCPriv->pBankedClips[i] = NULL; } } @@ -1528,7 +1528,7 @@ miBankDestroyGC( if (!pGCPriv->pBankedClips[i]) continue; - REGION_DESTROY(pScreen, pGCPriv->pBankedClips[i]); + RegionDestroy(pGCPriv->pBankedClips[i]); pGCPriv->pBankedClips[i] = NULL; } @@ -1707,7 +1707,7 @@ miBankCloseScreen( /* Delete bank clips */ for (i = 0; i < pScreenPriv->nBanks; i++) if (pScreenPriv->pBanks[i]) - REGION_DESTROY(pScreen, pScreenPriv->pBanks[i]); + RegionDestroy(pScreenPriv->pBanks[i]); Xfree(pScreenPriv->pBanks); @@ -1915,17 +1915,17 @@ miBankPaintWindow( } else { - REGION_NULL(pScreen, &tmpReg); + RegionNull(&tmpReg); for (i = 0; i < pScreenPriv->nBanks; i++) { if (!pScreenPriv->pBanks[i]) continue; - REGION_INTERSECT(pScreen, &tmpReg, pRegion, + RegionIntersect(&tmpReg, pRegion, pScreenPriv->pBanks[i]); - if (REGION_NIL(&tmpReg)) + if (RegionNil(&tmpReg)) continue; SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i); @@ -1933,7 +1933,7 @@ miBankPaintWindow( (*PaintWindow)(pWin, &tmpReg, what); } - REGION_UNINIT(pScreen, &tmpReg); + RegionUninit(&tmpReg); } if (what == PW_BORDER) @@ -1968,15 +1968,15 @@ miBankCopyWindow( ChangeGC(pGC, GCSubwindowMode, &subWindowMode); ValidateGC(pDrawable, pGC); - pRgnDst = REGION_CREATE(pScreen, NULL, 1); + pRgnDst = RegionCreate(NULL, 1); dx = ptOldOrg.x - pWindow->drawable.x; dy = ptOldOrg.y - pWindow->drawable.y; - REGION_TRANSLATE(pScreen, pRgnSrc, -dx, -dy); - REGION_INTERSECT(pScreen, pRgnDst, &pWindow->borderClip, pRgnSrc); + RegionTranslate(pRgnSrc, -dx, -dy); + RegionIntersect(pRgnDst, &pWindow->borderClip, pRgnSrc); - pBox = REGION_RECTS(pRgnDst); - nBox = REGION_NUM_RECTS(pRgnDst); + pBox = RegionRects(pRgnDst); + nBox = RegionNumRects(pRgnDst); pBoxNew1 = NULL; pBoxNew2 = NULL; @@ -2052,7 +2052,7 @@ miBankCopyWindow( FreeScratchGC(pGC); - REGION_DESTROY(pScreen, pRgnDst); + RegionDestroy(pRgnDst); DEALLOCATE_LOCAL(pBoxNew2); DEALLOCATE_LOCAL(pBoxNew1); @@ -2086,30 +2086,30 @@ miBankSaveAreas( } else { - REGION_NULL(pScreen, &rgnClipped); - REGION_TRANSLATE(pScreen, prgnSave, xorg, yorg); + RegionNull(&rgnClipped); + RegionTranslate(prgnSave, xorg, yorg); for (i = 0; i < pScreenPriv->nBanks; i++) { if (!pScreenPriv->pBanks[i]) continue; - REGION_INTERSECT(pScreen, &rgnClipped, + RegionIntersect(&rgnClipped, prgnSave, pScreenPriv->pBanks[i]); - if (REGION_NIL(&rgnClipped)) + if (RegionNil(&rgnClipped)) continue; SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i); - REGION_TRANSLATE(pScreen, &rgnClipped, -xorg, -yorg); + RegionTranslate(&rgnClipped, -xorg, -yorg); (*pScreen->BackingStoreFuncs.SaveAreas)(pPixmap, &rgnClipped, xorg, yorg, pWin); } - REGION_TRANSLATE(pScreen, prgnSave, -xorg, -yorg); - REGION_UNINIT(pScreen, &rgnClipped); + RegionTranslate(prgnSave, -xorg, -yorg); + RegionUninit(&rgnClipped); } SCREEN_WRAP(BackingStoreFuncs.SaveAreas, miBankSaveAreas); @@ -2140,17 +2140,17 @@ miBankRestoreAreas( } else { - REGION_NULL(pScreen, &rgnClipped); + RegionNull(&rgnClipped); for (i = 0; i < pScreenPriv->nBanks; i++) { if (!pScreenPriv->pBanks[i]) continue; - REGION_INTERSECT(pScreen, &rgnClipped, + RegionIntersect(&rgnClipped, prgnRestore, pScreenPriv->pBanks[i]); - if (REGION_NIL(&rgnClipped)) + if (RegionNil(&rgnClipped)) continue; SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i); @@ -2159,7 +2159,7 @@ miBankRestoreAreas( xorg, yorg, pWin); } - REGION_UNINIT(pScreen, &rgnClipped); + RegionUninit(&rgnClipped); } SCREEN_WRAP(BackingStoreFuncs.RestoreAreas, miBankRestoreAreas); @@ -2345,9 +2345,9 @@ miInitializeBanking( } pScreenPriv->pBanks[iBank] = - RECTS_TO_REGION(pScreen, pRect - pRects, pRects, 0); + RegionFromRects(pRect - pRects, pRects, 0); if (!pScreenPriv->pBanks[iBank] || - REGION_NAR(pScreenPriv->pBanks[iBank])) + RegionNar(pScreenPriv->pBanks[iBank])) { we = 1; break; @@ -2358,7 +2358,7 @@ miInitializeBanking( { for (i = iBank; i >= 0; i--) if (pScreenPriv->pBanks[i]) - REGION_DESTROY(pScreen, pScreenPriv->pBanks[i]); + RegionDestroy(pScreenPriv->pBanks[i]); Xfree(pScreenPriv->pBanks); Xfree(pScreenPriv); diff --git a/nx-X11/programs/Xserver/mi/mibitblt.c b/nx-X11/programs/Xserver/mi/mibitblt.c index 60318a046..b19a15900 100644 --- a/nx-X11/programs/Xserver/mi/mibitblt.c +++ b/nx-X11/programs/Xserver/mi/mibitblt.c @@ -117,7 +117,7 @@ miCopyArea(pSrcDrawable, pDstDrawable, box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; - prgnSrcClip = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrcClip = RegionCreate(&box, 1); realSrcClip = 1; } else @@ -148,8 +148,8 @@ miCopyArea(pSrcDrawable, pDstDrawable, ALLOCATE_LOCAL(heightSrc * sizeof(DDXPointRec)); pwidthFirst = pwidth = (unsigned int *) ALLOCATE_LOCAL(heightSrc * sizeof(unsigned int)); - numRects = REGION_NUM_RECTS(prgnSrcClip); - boxes = REGION_RECTS(prgnSrcClip); + numRects = RegionNumRects(prgnSrcClip); + boxes = RegionRects(prgnSrcClip); ordering = (unsigned int *) ALLOCATE_LOCAL(numRects * sizeof(unsigned int)); if(!pptFirst || !pwidthFirst || !ordering) @@ -264,7 +264,7 @@ miCopyArea(pSrcDrawable, pDstDrawable, prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, (unsigned long)0); if(realSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); DEALLOCATE_LOCAL(ordering); DEALLOCATE_LOCAL(pwidthFirst); @@ -452,9 +452,9 @@ miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty) to destroy what it's sent. note that this means we don't have to free prgnSrcClip ourselves. */ - prgnSrcClip = REGION_CREATE(pGCT->pScreen, NULL, 0); - REGION_COPY(pGCT->pScreen, prgnSrcClip, prgnSrc); - REGION_TRANSLATE(pGCT->pScreen, prgnSrcClip, srcx, 0); + prgnSrcClip = RegionCreate(NULL, 0); + RegionCopy(prgnSrcClip, prgnSrc); + RegionTranslate(prgnSrcClip, srcx, 0); (*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0); ValidateGC((DrawablePtr)pPixmap, pGCT); @@ -587,7 +587,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable, box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrc = RegionCreate(&box, 1); if (pSrcDrawable->type != DRAWABLE_PIXMAP) { /* clip to visible drawable */ @@ -595,15 +595,15 @@ miCopyPlane(pSrcDrawable, pDstDrawable, if (pGC->subWindowMode == IncludeInferiors) { RegionPtr clipList = NotClippedByChildren ((WindowPtr) pSrcDrawable); - REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc, clipList); - REGION_DESTROY(pGC->pScreen, clipList); + RegionIntersect(prgnSrc, prgnSrc, clipList); + RegionDestroy(clipList); } else - REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc, + RegionIntersect(prgnSrc, prgnSrc, &((WindowPtr)pSrcDrawable)->clipList); } - box = *REGION_EXTENTS(pGC->pScreen, prgnSrc); - REGION_TRANSLATE(pGC->pScreen, prgnSrc, -box.x1, -box.y1); + box = *RegionExtents(prgnSrc); + RegionTranslate(prgnSrc, -box.x1, -box.y1); if ((box.x2 > box.x1) && (box.y2 > box.y1)) { @@ -627,7 +627,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable, } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - REGION_DESTROY(pGC->pScreen, prgnSrc); + RegionDestroy(prgnSrc); return prgnExposed; } @@ -776,11 +776,11 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) box.y1 = 0; box.x2 = w; box.y2 = h; - prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrc = RegionCreate(&box, 1); miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage, leftPad, w, h, x, y); - REGION_DESTROY(pGC->pScreen, prgnSrc); + RegionDestroy(prgnSrc); break; case XYPixmap: diff --git a/nx-X11/programs/Xserver/mi/mibstore.c b/nx-X11/programs/Xserver/mi/mibstore.c index 875ec87f3..a24e2cbcd 100644 --- a/nx-X11/programs/Xserver/mi/mibstore.c +++ b/nx-X11/programs/Xserver/mi/mibstore.c @@ -477,7 +477,7 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) bounds.y1 = sy + pDrawable->y; bounds.x2 = bounds.x1 + w; bounds.y2 = bounds.y1 + h; - REGION_INIT(pScreen, &Remaining, &bounds, 0); + RegionInit(&Remaining, &bounds, 0); for (;;) { bounds.x1 = sx + pDrawable->x - pWin->drawable.x; @@ -486,11 +486,11 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) bounds.y2 = bounds.y1 + h; if (pWin->viewable && pWin->backStorage && pWin->drawable.depth == depth && - (RECT_IN_REGION(pScreen, &(pWindowPriv = + (RegionContainsRect(&(pWindowPriv = (miBSWindowPtr) pWin->backStorage)->SavedRegion, &bounds) != rgnOUT || - RECT_IN_REGION(pScreen, &Remaining, - REGION_EXTENTS(pScreen, &pWin->borderSize)) != rgnOUT)) + RegionContainsRect(&Remaining, + RegionExtents(&pWin->borderSize)) != rgnOUT)) { if (!pPixmap) { @@ -508,8 +508,8 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) } ChangeGC (pGC, GCSubwindowMode, &subWindowMode); ValidateGC ((DrawablePtr)pPixmap, pGC); - REGION_NULL(pScreen, &Border); - REGION_NULL(pScreen, &Inside); + RegionNull(&Border); + RegionNull(&Inside); pSrcWin = (WindowPtr) pDrawable; x = sx; y = sy; @@ -523,28 +523,28 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) (DrawablePtr)pPixmap, pGC, x, y, w, h, 0, 0); - REGION_SUBTRACT(pScreen, &Remaining, &Remaining, + RegionSubtract(&Remaining, &Remaining, &((WindowPtr) pDrawable)->borderClip); } - REGION_INTERSECT(pScreen, &Inside, &Remaining, &pWin->winSize); - REGION_TRANSLATE(pScreen, &Inside, + RegionIntersect(&Inside, &Remaining, &pWin->winSize); + RegionTranslate(&Inside, -pWin->drawable.x, -pWin->drawable.y); - REGION_INTERSECT(pScreen, &Inside, &Inside, + RegionIntersect(&Inside, &Inside, &pWindowPriv->SavedRegion); /* offset of sub-window in GetImage pixmap */ xoff = pWin->drawable.x - pDrawable->x - sx; yoff = pWin->drawable.y - pDrawable->y - sy; - if (REGION_NUM_RECTS(&Inside) > 0) + if (RegionNumRects(&Inside) > 0) { switch (pWindowPriv->status) { case StatusContents: - pBox = REGION_RECTS(&Inside); - for (n = REGION_NUM_RECTS(&Inside); --n >= 0;) + pBox = RegionRects(&Inside); + for (n = RegionNumRects(&Inside); --n >= 0;) { (*pGC->ops->CopyArea) ( (DrawablePtr)pWindowPriv->pBackingPixmap, @@ -569,12 +569,12 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) break; } } - REGION_SUBTRACT(pScreen, &Border, &pWin->borderSize, + RegionSubtract(&Border, &pWin->borderSize, &pWin->winSize); - REGION_INTERSECT(pScreen, &Border, &Border, &Remaining); - if (REGION_NUM_RECTS(&Border) > 0) + RegionIntersect(&Border, &Border, &Remaining); + if (RegionNumRects(&Border) > 0) { - REGION_TRANSLATE(pScreen, &Border, -pWin->drawable.x, + RegionTranslate(&Border, -pWin->drawable.x, -pWin->drawable.y); miBSFillVirtualBits ((DrawablePtr) pPixmap, pGC, &Border, xoff, yoff, @@ -595,12 +595,12 @@ miBSGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) } } - REGION_UNINIT(pScreen, &Remaining); + RegionUninit(&Remaining); if (pPixmap) { - REGION_UNINIT(pScreen, &Border); - REGION_UNINIT(pScreen, &Inside); + RegionUninit(&Border); + RegionUninit(&Inside); (*pScreen->GetImage) ((DrawablePtr) pPixmap, 0, 0, w, h, format, planemask, pdstLine); (*pScreen->DestroyPixmap) (pPixmap); @@ -664,7 +664,7 @@ miBSGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart) bounds.y2 = ppt[i].y; } - switch (RECT_IN_REGION(pScreen, &pWindowPriv->SavedRegion, &bounds)) + switch (RegionContainsRect(&pWindowPriv->SavedRegion, &bounds)) { case rgnPART: if (!pPixmap) @@ -1177,39 +1177,39 @@ miBSDoCopy( box.y1 = srcy + pWin->drawable.y; box.y2 = box.y1 + h; - pRgnExp = REGION_CREATE(pGC->pScreen, &box, 1); - REGION_INTERSECT(pGC->pScreen, pRgnExp, pRgnExp, &pWin->clipList); - pRgnObs = REGION_CREATE(pGC->pScreen, NULL, 1); - REGION_INVERSE( pGC->pScreen, pRgnObs, pRgnExp, &box); + pRgnExp = RegionCreate(&box, 1); + RegionIntersect(pRgnExp, pRgnExp, &pWin->clipList); + pRgnObs = RegionCreate(NULL, 1); + RegionInverse(pRgnObs, pRgnExp, &box); /* * Translate regions into window coordinates for proper calls * to the copyProc, then make sure none of the obscured region sticks * into invalid areas of the backing pixmap. */ - REGION_TRANSLATE(pGC->pScreen, pRgnExp, + RegionTranslate(pRgnExp, -pWin->drawable.x, -pWin->drawable.y); - REGION_TRANSLATE(pGC->pScreen, pRgnObs, + RegionTranslate(pRgnObs, -pWin->drawable.x, -pWin->drawable.y); - REGION_INTERSECT(pGC->pScreen, pRgnObs, pRgnObs, &pBackingStore->SavedRegion); + RegionIntersect(pRgnObs, pRgnObs, &pBackingStore->SavedRegion); /* * If the obscured region is empty, there's no point being fancy. */ - if (!REGION_NOTEMPTY(pGC->pScreen, pRgnObs)) + if (!RegionNotEmpty(pRgnObs)) { - REGION_DESTROY(pGC->pScreen, pRgnExp); - REGION_DESTROY(pGC->pScreen, pRgnObs); + RegionDestroy(pRgnExp); + RegionDestroy(pRgnObs); return (FALSE); } - numRectsExp = REGION_NUM_RECTS(pRgnExp); - pBoxExp = REGION_RECTS(pRgnExp); - pBoxObs = REGION_RECTS(pRgnObs); - numRectsObs = REGION_NUM_RECTS(pRgnObs); + numRectsExp = RegionNumRects(pRgnExp); + pBoxExp = RegionRects(pRgnExp); + pBoxObs = RegionRects(pRgnObs); + numRectsObs = RegionNumRects(pRgnObs); nrects = numRectsExp + numRectsObs; boxes = (struct BoxDraw *)ALLOCATE_LOCAL(nrects * sizeof(struct BoxDraw)); @@ -1220,8 +1220,8 @@ miBSDoCopy( { if (sequence) DEALLOCATE_LOCAL(sequence); if (boxes) DEALLOCATE_LOCAL(boxes); - REGION_DESTROY(pGC->pScreen, pRgnExp); - REGION_DESTROY(pGC->pScreen, pRgnObs); + RegionDestroy(pRgnExp); + RegionDestroy(pRgnObs); return(TRUE); } @@ -1437,25 +1437,25 @@ miBSDoCopy( * to return to dispatch which will send the appropriate expose * events. */ - REGION_UNION(pGC->pScreen, pRgnExp, pRgnExp, pRgnObs); + RegionUnion(pRgnExp, pRgnExp, pRgnObs); box.x1 = srcx; box.x2 = srcx + w; box.y1 = srcy; box.y2 = srcy + h; - if (RECT_IN_REGION(pGC->pScreen, pRgnExp, &box) == rgnIN) + if (RegionContainsRect(pRgnExp, &box) == rgnIN) { - REGION_EMPTY(pGC->pScreen, pRgnExp); + RegionEmpty(pRgnExp); } else { - REGION_INVERSE( pGC->pScreen, pRgnExp, pRgnExp, &box); - REGION_TRANSLATE( pGC->pScreen, pRgnExp, + RegionInverse(pRgnExp, pRgnExp, &box); + RegionTranslate(pRgnExp, dx + pWin->drawable.x, dy + pWin->drawable.y); - REGION_INTERSECT( pGC->pScreen, pRgnObs, pRgnExp, &pWin->clipList); + RegionIntersect(pRgnObs, pRgnExp, &pWin->clipList); (*pWin->drawable.pScreen->PaintWindowBackground) (pWin, pRgnObs, PW_BACKGROUND); - REGION_TRANSLATE( pGC->pScreen, pRgnExp, + RegionTranslate(pRgnExp, -pWin->drawable.x, -pWin->drawable.y); miBSClearBackingRegion (pWin, pRgnExp); @@ -1463,8 +1463,8 @@ miBSDoCopy( if (graphicsExposures) *ppRgn = pRgnExp; else - REGION_DESTROY(pGC->pScreen, pRgnExp); - REGION_DESTROY(pGC->pScreen, pRgnObs); + RegionDestroy(pRgnExp); + RegionDestroy(pRgnObs); return (TRUE); } @@ -1524,7 +1524,7 @@ miBSCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty) * the backing store. An unnecessary optimisation, * but a useful one when GetSpans is slow. */ - pExtents = REGION_EXTENTS(pDst->pScreen, + pExtents = RegionExtents( (RegionPtr)pBackingGC->clientClip); bsrcx = srcx; bsrcy = srcy; @@ -1573,8 +1573,8 @@ miBSCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty) if (winExposed) { if (pixExposed){ - REGION_UNION(pDst->pScreen, winExposed, winExposed, pixExposed); - REGION_DESTROY(pDst->pScreen, pixExposed); + RegionUnion(winExposed, winExposed, pixExposed); + RegionDestroy(pixExposed); } } else winExposed = pixExposed; @@ -1633,7 +1633,7 @@ miBSCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane) * the backing store. An unnecessary optimisation, * but a useful one when GetSpans is slow. */ - pExtents = REGION_EXTENTS(pDst->pScreen, + pExtents = RegionExtents( (RegionPtr)pBackingGC->clientClip); bsrcx = srcx; bsrcy = srcy; @@ -1687,8 +1687,8 @@ miBSCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane) { if (pixExposed) { - REGION_UNION(pDst->pScreen, winExposed, winExposed, pixExposed); - REGION_DESTROY(pDst->pScreen, pixExposed); + RegionUnion(winExposed, winExposed, pixExposed); + RegionDestroy(pixExposed); } } else winExposed = pixExposed; @@ -2312,12 +2312,12 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) box.y1 = y; box.x2 = x + w; box.y2 = y + h; - pRgn = REGION_CREATE(pWin->drawable.pScreen, &box, 1); + pRgn = RegionCreate(&box, 1); if (!pRgn) return NullRegion; - REGION_INTERSECT( pScreen, pRgn, pRgn, &pBackingStore->SavedRegion); + RegionIntersect(pRgn, pRgn, &pBackingStore->SavedRegion); - if (REGION_NOTEMPTY( pScreen, pRgn)) + if (RegionNotEmpty(pRgn)) { /* * if clearing entire window, simply make new virtual @@ -2393,12 +2393,12 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) * Figure out the array of rectangles to fill and fill them with * PolyFillRect in the proper mode, as set in the GC above. */ - numRects = REGION_NUM_RECTS(pRgn); + numRects = RegionNumRects(pRgn); rects = (xRectangle *)ALLOCATE_LOCAL(numRects*sizeof(xRectangle)); if (rects) { - for (i = 0, pBox = REGION_RECTS(pRgn); + for (i = 0, pBox = RegionRects(pRgn); i < numRects; i++, pBox++) { @@ -2418,7 +2418,7 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) if (!generateExposures) { - REGION_DESTROY(pScreen, pRgn); + RegionDestroy(pRgn); pRgn = NULL; } else @@ -2427,13 +2427,13 @@ miBSClearBackingStore(pWin, x, y, w, h, generateExposures) * result must be screen relative, but is currently * drawable relative. */ - REGION_TRANSLATE(pScreen, pRgn, pWin->drawable.x, + RegionTranslate(pRgn, pWin->drawable.x, pWin->drawable.y); } } else { - REGION_DESTROY( pScreen, pRgn); + RegionDestroy(pRgn); pRgn = NULL; } return pRgn; @@ -2447,8 +2447,8 @@ miBSClearBackingRegion (pWin, pRgn) BoxPtr pBox; int i; - i = REGION_NUM_RECTS(pRgn); - pBox = REGION_RECTS(pRgn); + i = RegionNumRects(pRgn); + pBox = RegionRects(pRgn); while (i--) { (void) miBSClearBackingStore(pWin, pBox->x1, pBox->y1, @@ -2485,7 +2485,7 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) if (state == None) return; - numRects = REGION_NUM_RECTS(pRgn); + numRects = RegionNumRects(pRgn); pRect = (xRectangle *)ALLOCATE_LOCAL(numRects * sizeof(xRectangle)); if (!pRect) return; @@ -2545,7 +2545,7 @@ miBSFillVirtualBits (pDrawable, pGC, pRgn, x, y, state, pixunion, planeMask) if (pDrawable->serialNumber != pGC->serialNumber) ValidateGC (pDrawable, pGC); - pBox = REGION_RECTS(pRgn); + pBox = RegionRects(pRgn); for (i = numRects; --i >= 0; pBox++, pRect++) { pRect->x = pBox->x1 + x; @@ -2588,7 +2588,7 @@ miBSAllocate(pWin) pBackingStore->pBackingPixmap = NullPixmap; pBackingStore->x = 0; pBackingStore->y = 0; - REGION_NULL( pScreen, &pBackingStore->SavedRegion); + RegionNull(&pBackingStore->SavedRegion); pBackingStore->viewable = (char)pWin->viewable; pBackingStore->status = StatusNoPixmap; pBackingStore->backgroundState = None; @@ -2617,16 +2617,16 @@ miBSAllocate(pWin) box.y1 = pWin->drawable.y; box.y2 = pWin->drawable.y + (int) pWin->drawable.height; - REGION_INVERSE( pScreen, pSavedRegion, &pWin->clipList, &box); - REGION_TRANSLATE( pScreen, pSavedRegion, + RegionInverse(pSavedRegion, &pWin->clipList, &box); + RegionTranslate(pSavedRegion, -pWin->drawable.x, -pWin->drawable.y); #ifdef SHAPE if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, pSavedRegion, pSavedRegion, + RegionIntersect(pSavedRegion, pSavedRegion, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, pSavedRegion, pSavedRegion, + RegionIntersect(pSavedRegion, pSavedRegion, wClipShape (pWin)); #endif /* if window is already on-screen, assume it has been drawn to */ @@ -2649,7 +2649,7 @@ miBSAllocate(pWin) */ if (pBackingStore->status != StatusNoPixmap) { - REGION_EMPTY( pScreen, &pBackingStore->SavedRegion); + RegionEmpty(&pBackingStore->SavedRegion); miDestroyBSPixmap (pWin); } } @@ -2683,7 +2683,7 @@ miBSFree(pWin) { miDestroyBSPixmap (pWin); - REGION_UNINIT( pScreen, &pBackingStore->SavedRegion); + RegionUninit(&pBackingStore->SavedRegion); xfree(pBackingStore); pWin->backStorage = NULL; @@ -2726,7 +2726,7 @@ miResizeBackingStore( if (!pBackingPixmap) return; pScreen = pWin->drawable.pScreen; - extents = REGION_EXTENTS(pScreen, &pBackingStore->SavedRegion); + extents = RegionExtents(&pBackingStore->SavedRegion); pNewPixmap = pBackingPixmap; nw = extents->x2 - extents->x1; @@ -2838,7 +2838,7 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) pBackingStore->viewable = (char)pWin->viewable; if (pWin->backingStore != Always) { - REGION_EMPTY( pScreen, &pBackingStore->SavedRegion); + RegionEmpty(&pBackingStore->SavedRegion); miDestroyBSPixmap (pWin); return; } @@ -2851,14 +2851,14 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) (pBackingStore->backgroundState == None)) return; - if (REGION_NOTEMPTY(pScreen, pObscured)) + if (RegionNotEmpty(pObscured)) { BoxRec oldExtents; x = pWin->drawable.x; y = pWin->drawable.y; - REGION_TRANSLATE(pScreen, pObscured, -x, -y); - oldExtents = *REGION_EXTENTS(pScreen, &pBackingStore->SavedRegion); - REGION_UNION( pScreen, &pBackingStore->SavedRegion, + RegionTranslate(pObscured, -x, -y); + oldExtents = *RegionExtents(&pBackingStore->SavedRegion); + RegionUnion(&pBackingStore->SavedRegion, &pBackingStore->SavedRegion, pObscured); /* @@ -2875,7 +2875,7 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) if (pBackingStore->pBackingPixmap) { if (pBackingStore->x | pBackingStore->y) { - REGION_TRANSLATE( pScreen, pObscured, + RegionTranslate(pObscured, -pBackingStore->x, -pBackingStore->y); x += pBackingStore->x; @@ -2886,13 +2886,13 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) x - dx, y - dy, pWin); } } - REGION_TRANSLATE(pScreen, pObscured, x, y); + RegionTranslate(pObscured, x, y); } else { - if (REGION_BROKEN (pScreen, pObscured)) + if (RegionBroken(pObscured)) { - REGION_EMPTY( pScreen, &pBackingStore->SavedRegion); + RegionEmpty(&pBackingStore->SavedRegion); miDestroyBSPixmap (pWin); return; } @@ -2943,11 +2943,11 @@ miBSRestoreAreas(pWin, prgnExposed) if (pBackingStore->status == StatusContents) { - REGION_TRANSLATE(pScreen, prgnSaved, pWin->drawable.x, + RegionTranslate(prgnSaved, pWin->drawable.x, pWin->drawable.y); - prgnRestored = REGION_CREATE( pScreen, (BoxPtr)NULL, 1); - REGION_INTERSECT( pScreen, prgnRestored, prgnExposed, prgnSaved); + prgnRestored = RegionCreate((BoxPtr)NULL, 1); + RegionIntersect(prgnRestored, prgnExposed, prgnSaved); /* * Since prgnExposed is no longer obscured, we no longer @@ -2956,10 +2956,10 @@ miBSRestoreAreas(pWin, prgnExposed) * from the area to be exposed. */ - if (REGION_NOTEMPTY( pScreen, prgnRestored)) + if (RegionNotEmpty(prgnRestored)) { - REGION_SUBTRACT( pScreen, prgnSaved, prgnSaved, prgnExposed); - REGION_SUBTRACT( pScreen, prgnExposed, prgnExposed, prgnRestored); + RegionSubtract(prgnSaved, prgnSaved, prgnExposed); + RegionSubtract(prgnExposed, prgnExposed, prgnRestored); /* * Do the actual restoration @@ -2975,9 +2975,9 @@ miBSRestoreAreas(pWin, prgnExposed) * region to window relative */ - if (REGION_NOTEMPTY(pScreen, prgnSaved)) + if (RegionNotEmpty(prgnSaved)) { - REGION_TRANSLATE(pScreen, prgnSaved, + RegionTranslate(prgnSaved, -pWin->drawable.x, -pWin->drawable.y); miResizeBackingStore(pWin, 0, 0, TRUE); @@ -2986,33 +2986,33 @@ miBSRestoreAreas(pWin, prgnExposed) miDestroyBSPixmap (pWin); } else - REGION_TRANSLATE(pScreen, prgnSaved, + RegionTranslate(prgnSaved, -pWin->drawable.x, -pWin->drawable.y); - REGION_DESTROY( pScreen, prgnRestored); + RegionDestroy(prgnRestored); } else if ((pBackingStore->status == StatusVirtual) || (pBackingStore->status == StatusVDirty)) { - REGION_TRANSLATE(pScreen, prgnSaved, + RegionTranslate(prgnSaved, pWin->drawable.x, pWin->drawable.y); - exposures = REGION_CREATE( pScreen, NullBox, 1); + exposures = RegionCreate(NullBox, 1); if (SameBackground (pBackingStore->backgroundState, pBackingStore->background, pWin->backgroundState, pWin->background)) { - REGION_SUBTRACT( pScreen, exposures, prgnExposed, prgnSaved); + RegionSubtract(exposures, prgnExposed, prgnSaved); } else { miTileVirtualBS(pWin); /* we need to expose all we have (virtually) retiled */ - REGION_UNION( pScreen, exposures, prgnExposed, prgnSaved); + RegionUnion(exposures, prgnExposed, prgnSaved); } - REGION_SUBTRACT( pScreen, prgnSaved, prgnSaved, prgnExposed); - REGION_TRANSLATE(pScreen, prgnSaved, + RegionSubtract(prgnSaved, prgnSaved, prgnExposed); + RegionTranslate(prgnSaved, -pWin->drawable.x, -pWin->drawable.y); } else if (pWin->viewable && !pBackingStore->viewable && @@ -3034,21 +3034,21 @@ miBSRestoreAreas(pWin, prgnExposed) box.y1 = pWin->drawable.y; box.y2 = box.y1 + (int) pWin->drawable.height; - REGION_INVERSE( pScreen, prgnSaved, &pWin->clipList, &box); - REGION_TRANSLATE( pScreen, prgnSaved, + RegionInverse(prgnSaved, &pWin->clipList, &box); + RegionTranslate(prgnSaved, -pWin->drawable.x, -pWin->drawable.y); #ifdef SHAPE if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, prgnSaved, prgnSaved, + RegionIntersect(prgnSaved, prgnSaved, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, prgnSaved, prgnSaved, + RegionIntersect(prgnSaved, prgnSaved, wClipShape (pWin)); #endif miTileVirtualBS(pWin); - exposures = REGION_CREATE( pScreen, &box, 1); + exposures = RegionCreate(&box, 1); } pBackingStore->viewable = (char)pWin->viewable; return exposures; @@ -3143,22 +3143,22 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) * Compute the new saved region */ - newSaved = REGION_CREATE( pScreen, NullBox, 1); + newSaved = RegionCreate(NullBox, 1); extents.x1 = pWin->drawable.x; extents.x2 = pWin->drawable.x + (int) pWin->drawable.width; extents.y1 = pWin->drawable.y; extents.y2 = pWin->drawable.y + (int) pWin->drawable.height; - REGION_INVERSE( pScreen, newSaved, &pWin->clipList, &extents); + RegionInverse(newSaved, &pWin->clipList, &extents); - REGION_TRANSLATE( pScreen, newSaved, + RegionTranslate(newSaved, -pWin->drawable.x, -pWin->drawable.y); #ifdef SHAPE if (wBoundingShape (pWin) || wClipShape (pWin)) { if (wBoundingShape (pWin)) - REGION_INTERSECT( pScreen, newSaved, newSaved, + RegionIntersect(newSaved, newSaved, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT( pScreen, newSaved, newSaved, wClipShape (pWin)); + RegionIntersect(newSaved, newSaved, wClipShape (pWin)); } #endif @@ -3191,23 +3191,23 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) * bits on the screen which can be put into the * new backing store */ - REGION_TRANSLATE( pScreen, oldClip, windx - oldx, windy - oldy); - doomed = REGION_CREATE( pScreen, NullBox, 1); - REGION_INTERSECT( pScreen, doomed, oldClip, newSaved); - REGION_TRANSLATE( pScreen, oldClip, oldx - windx, oldy - windy); + RegionTranslate(oldClip, windx - oldx, windy - oldy); + doomed = RegionCreate(NullBox, 1); + RegionIntersect(doomed, oldClip, newSaved); + RegionTranslate(oldClip, oldx - windx, oldy - windy); /* * Translate the old saved region to the position in the * window where it will appear to be */ - REGION_TRANSLATE( pScreen, pSavedRegion, windx, windy); + RegionTranslate(pSavedRegion, windx, windy); /* * Add the old saved region to the new saved region, so * that calls to RestoreAreas will be able to fetch those * bits back */ - REGION_UNION( pScreen, newSaved, newSaved, pSavedRegion); + RegionUnion(newSaved, newSaved, pSavedRegion); /* * Swap the new saved region into the window @@ -3227,47 +3227,47 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) * set to background in the backing pixmap and * sent as exposure events to the client. */ - REGION_SUBTRACT( pScreen, newSaved, pSavedRegion, newSaved); + RegionSubtract(newSaved, pSavedRegion, newSaved); /* * Fetch bits which will be obscured from * the screen */ - if (REGION_NOTEMPTY( pScreen, doomed)) + if (RegionNotEmpty(doomed)) { /* * Don't clear regions which have bits on the * screen */ - REGION_SUBTRACT( pScreen, newSaved, newSaved, doomed); + RegionSubtract(newSaved, newSaved, doomed); /* * Make the region to SaveDoomedAreas absolute, instead * of window relative. */ - REGION_TRANSLATE( pScreen, doomed, + RegionTranslate(doomed, pWin->drawable.x, pWin->drawable.y); (* pScreen->SaveDoomedAreas) (pWin, doomed, scrdx, scrdy); } - REGION_DESTROY(pScreen, doomed); + RegionDestroy(doomed); /* * and clear whatever there is that's new */ - if (REGION_NOTEMPTY( pScreen, newSaved)) + if (RegionNotEmpty(newSaved)) { miBSClearBackingRegion (pWin, newSaved); /* * Make the exposed region absolute */ - REGION_TRANSLATE(pScreen, newSaved, + RegionTranslate(newSaved, pWin->drawable.x, pWin->drawable.y); } else { - REGION_DESTROY(pScreen, newSaved); + RegionDestroy(newSaved); newSaved = NullRegion; } } @@ -3277,8 +3277,8 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) * ForgetGravity: just reset backing store and * expose the whole mess */ - REGION_COPY( pScreen, pSavedRegion, newSaved); - REGION_TRANSLATE( pScreen, newSaved, + RegionCopy(pSavedRegion, newSaved); + RegionTranslate(newSaved, pWin->drawable.x, pWin->drawable.y); miResizeBackingStore (pWin, 0, 0, FALSE); @@ -3409,13 +3409,13 @@ miBSValidateGC (pGC, stateChanges, pDrawable) ((pDrawable->serialNumber != pPriv->serialNumber) || (stateChanges&(GCClipXOrigin|GCClipYOrigin|GCClipMask|GCSubwindowMode)))) { - if (REGION_NOTEMPTY(pGC->pScreen, &pWindowPriv->SavedRegion)) + if (RegionNotEmpty(&pWindowPriv->SavedRegion)) { - backingCompositeClip = REGION_CREATE(pGC->pScreen, NULL, 1); + backingCompositeClip = RegionCreate(NULL, 1); if ((pGC->clientClipType == CT_NONE) || (pGC->clientClipType == CT_PIXMAP)) { - REGION_COPY(pGC->pScreen, backingCompositeClip, + RegionCopy(backingCompositeClip, &pWindowPriv->SavedRegion); } else @@ -3425,12 +3425,12 @@ miBSValidateGC (pGC, stateChanges, pDrawable) * its proper origin. */ - REGION_COPY(pGC->pScreen, backingCompositeClip, + RegionCopy(backingCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pGC->pScreen, backingCompositeClip, + RegionTranslate(backingCompositeClip, pGC->clipOrg.x, pGC->clipOrg.y); - REGION_INTERSECT(pGC->pScreen, backingCompositeClip, + RegionIntersect(backingCompositeClip, backingCompositeClip, &pWindowPriv->SavedRegion); } @@ -3444,14 +3444,14 @@ miBSValidateGC (pGC, stateChanges, pDrawable) * can be fixed only at great cost to the shadow routines. */ translatedClip = NotClippedByChildren (pWin); - REGION_TRANSLATE(pGC->pScreen, translatedClip, + RegionTranslate(translatedClip, -pDrawable->x, -pDrawable->y); - REGION_SUBTRACT(pGC->pScreen, backingCompositeClip, + RegionSubtract(backingCompositeClip, backingCompositeClip, translatedClip); - REGION_DESTROY(pGC->pScreen, translatedClip); + RegionDestroy(translatedClip); } - if (!REGION_NOTEMPTY(pGC->pScreen, backingCompositeClip)) + if (!RegionNotEmpty(backingCompositeClip)) lift_functions = TRUE; } else @@ -3508,7 +3508,7 @@ miBSValidateGC (pGC, stateChanges, pDrawable) if (lift_functions) { if (backingCompositeClip) - REGION_DESTROY( pGC->pScreen, backingCompositeClip); + RegionDestroy(backingCompositeClip); /* unwrap the GC again */ miBSDestroyGCPrivate (pGC); @@ -3541,14 +3541,14 @@ miBSValidateGC (pGC, stateChanges, pDrawable) if (pGC->clientClipType == CT_PIXMAP) { (*pBackingGC->funcs->CopyClip)(pBackingGC, pGC); - REGION_TRANSLATE(pGC->pScreen, backingCompositeClip, + RegionTranslate(backingCompositeClip, -pGC->clipOrg.x, -pGC->clipOrg.y); vals[0] = pGC->clipOrg.x - pWindowPriv->x; vals[1] = pGC->clipOrg.y - pWindowPriv->y; DoChangeGC(pBackingGC, GCClipXOrigin|GCClipYOrigin, vals, 0); (* pGC->pScreen->BackingStoreFuncs.SetClipmaskRgn) (pBackingGC, backingCompositeClip); - REGION_DESTROY( pGC->pScreen, backingCompositeClip); + RegionDestroy(backingCompositeClip); } else { @@ -3732,7 +3732,7 @@ miCreateBSPixmap (pWin, pExtents) backSet = ((pBackingStore->status == StatusVirtual) || (pBackingStore->status == StatusVDirty)); - extents = REGION_EXTENTS( pScreen, &pBackingStore->SavedRegion); + extents = RegionExtents(&pBackingStore->SavedRegion); if (!pBackingStore->pBackingPixmap && extents->x2 != extents->x1 && @@ -3797,7 +3797,7 @@ miCreateBSPixmap (pWin, pExtents) if (exposed) { miSendExposures(pWin, exposed, pWin->drawable.x, pWin->drawable.y); - REGION_DESTROY( pScreen, exposed); + RegionDestroy(exposed); } } @@ -3846,7 +3846,7 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) register int dx, dy; BITS32 gcMask; - if (!REGION_NOTEMPTY(pGC->pScreen, prgnExposed)) + if (!RegionNotEmpty(prgnExposed)) return; pBackingStore = (miBSWindowPtr)pSrc->backStorage; @@ -3854,10 +3854,10 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) (pBackingStore->status == StatusBadAlloc)) return; - REGION_NULL( pGC->pScreen, &tempRgn); - REGION_INTERSECT( pGC->pScreen, &tempRgn, prgnExposed, + RegionNull(&tempRgn); + RegionIntersect(&tempRgn, prgnExposed, &pBackingStore->SavedRegion); - REGION_SUBTRACT( pGC->pScreen, prgnExposed, prgnExposed, &tempRgn); + RegionSubtract(prgnExposed, prgnExposed, &tempRgn); if (plane != 0) { copyProc = pGC->ops->CopyPlane; @@ -3889,7 +3889,7 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) } break; case StatusContents: - for (i = REGION_NUM_RECTS(&tempRgn), pBox = REGION_RECTS(&tempRgn); + for (i = RegionNumRects(&tempRgn), pBox = RegionRects(&tempRgn); --i >= 0; pBox++) { @@ -3901,5 +3901,5 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) } break; } - REGION_UNINIT( pGC->pScreen, &tempRgn); + RegionUninit(&tempRgn); } diff --git a/nx-X11/programs/Xserver/mi/miexpose.c b/nx-X11/programs/Xserver/mi/miexpose.c index 782ddad49..379dd380f 100644 --- a/nx-X11/programs/Xserver/mi/miexpose.c +++ b/nx-X11/programs/Xserver/mi/miexpose.c @@ -185,21 +185,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 @@ -216,7 +216,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; } @@ -233,11 +233,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 @@ -249,14 +249,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) { @@ -274,10 +274,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 @@ -287,7 +287,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) @@ -300,7 +300,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 @@ -308,8 +308,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)( @@ -326,53 +326,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; } } @@ -387,7 +387,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; @@ -395,8 +395,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; @@ -442,8 +442,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)); @@ -513,8 +513,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; @@ -527,15 +527,15 @@ 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; } - if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT)) + if (clientInterested && exposures && (RegionNumRects(exposures) > RECTLIMIT)) { /* * If we have LOTS of rectangles, we decide to take the extents @@ -545,17 +545,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)( @@ -566,22 +566,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); } @@ -706,7 +706,7 @@ int what; } } - prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) * + prect = (xRectangle *)ALLOCATE_LOCAL(RegionNumRects(prgn) * sizeof(xRectangle)); if (!prect) return; @@ -749,7 +749,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; @@ -852,8 +852,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; @@ -872,7 +872,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/mi/migc.c b/nx-X11/programs/Xserver/mi/migc.c index 2b38b257d..167e63d0a 100644 --- a/nx-X11/programs/Xserver/mi/migc.c +++ b/nx-X11/programs/Xserver/mi/migc.c @@ -55,7 +55,7 @@ miDestroyGC(pGC) if (pGC->pRotatedPixmap) (*pGC->pScreen->DestroyPixmap) (pGC->pRotatedPixmap); if (pGC->freeCompClip) - REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); miDestroyGCOps(pGC->ops); } @@ -104,7 +104,7 @@ miDestroyClip(pGC) * we know we'll never have a list of rectangles, since ChangeClip * immediately turns them into a region */ - REGION_DESTROY(pGC->pScreen, pGC->clientClip); + RegionDestroy(pGC->clientClip); } pGC->clientClip = NULL; pGC->clientClipType = CT_NONE; @@ -121,7 +121,7 @@ miChangeClip(pGC, type, pvalue, nrects) if (type == CT_PIXMAP) { /* convert the pixmap to a region */ - pGC->clientClip = (void *) BITMAP_TO_REGION(pGC->pScreen, + pGC->clientClip = (void *) BitmapToRegion(pGC->pScreen, (PixmapPtr) pvalue); (*pGC->pScreen->DestroyPixmap) (pvalue); } @@ -132,7 +132,7 @@ miChangeClip(pGC, type, pvalue, nrects) } else if (type != CT_NONE) { - pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nrects, + pGC->clientClip = (void *) RegionFromRects(nrects, (xRectangle *) pvalue, type); xfree(pvalue); @@ -157,8 +157,8 @@ miCopyClip(pgcDst, pgcSrc) pgcSrc->clientClip, 0); break; case CT_REGION: - prgnNew = REGION_CREATE(pgcSrc->pScreen, NULL, 1); - REGION_COPY(pgcDst->pScreen, prgnNew, + prgnNew = RegionCreate(NULL, 1); + RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip)); (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (void *) prgnNew, 0); break; @@ -213,7 +213,7 @@ miComputeCompositeClip(pGC, pDrawable) if (pGC->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; pGC->freeCompClip = freeTmpClip; } @@ -228,30 +228,30 @@ miComputeCompositeClip(pGC, pDrawable) * clip. if neither is real, create a new region. */ - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); if (freeCompClip) { - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip); + RegionIntersect(pregWin, pregWin, pGC->clientClip); pGC->pCompositeClip = pregWin; } else { - pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + pGC->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); } pGC->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pDrawable->x + pGC->clipOrg.x), -(pDrawable->y + pGC->clipOrg.y)); } @@ -269,31 +269,31 @@ miComputeCompositeClip(pGC, pDrawable) if (pGC->freeCompClip) { - REGION_RESET(pScreen, pGC->pCompositeClip, &pixbounds); + RegionReset(pGC->pCompositeClip, &pixbounds); } else { pGC->freeCompClip = TRUE; - pGC->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1); + pGC->pCompositeClip = RegionCreate(&pixbounds, 1); } if (pGC->clientClipType == CT_REGION) { if(pDrawable->x || pDrawable->y) { - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pGC->pCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pDrawable->x + pGC->clipOrg.x), -(pDrawable->y + pGC->clipOrg.y)); } else { - REGION_TRANSLATE(pScreen, pGC->pCompositeClip, + RegionTranslate(pGC->pCompositeClip, -pGC->clipOrg.x, -pGC->clipOrg.y); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pGC->pCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pScreen, pGC->pCompositeClip, + RegionTranslate(pGC->pCompositeClip, pGC->clipOrg.x, pGC->clipOrg.y); } } diff --git a/nx-X11/programs/Xserver/mi/mioverlay.c b/nx-X11/programs/Xserver/mi/mioverlay.c index f67704e11..96d5cc4f0 100644 --- a/nx-X11/programs/Xserver/mi/mioverlay.c +++ b/nx-X11/programs/Xserver/mi/mioverlay.c @@ -212,8 +212,8 @@ miOverlayCreateWindow(WindowPtr pWin) pTree->visibility = VisibilityNotViewable; pWinPriv->tree = pTree; if(pWin->parent) { - REGION_NULL(pScreen, &(pTree->borderClip)); - REGION_NULL(pScreen, &(pTree->clipList)); + RegionNull(&(pTree->borderClip)); + RegionNull(&(pTree->clipList)); RebuildTree(pWin); } else { BoxRec fullBox; @@ -221,8 +221,8 @@ miOverlayCreateWindow(WindowPtr pWin) fullBox.y1 = 0; fullBox.x2 = pScreen->width; fullBox.y2 = pScreen->height; - REGION_INIT(pScreen, &(pTree->borderClip), &fullBox, 1); - REGION_INIT(pScreen, &(pTree->clipList), &fullBox, 1); + RegionInit(&(pTree->borderClip), &fullBox, 1); + RegionInit(&(pTree->clipList), &fullBox, 1); } } else xfree(pTree); } @@ -250,8 +250,8 @@ miOverlayDestroyWindow(WindowPtr pWin) else if(pTree->parent) pTree->parent->lastChild = pTree->prevSib; - REGION_UNINIT(pScreen, &(pTree->borderClip)); - REGION_UNINIT(pScreen, &(pTree->clipList)); + RegionUninit(&(pTree->borderClip)); + RegionUninit(&(pTree->clipList)); xfree(pTree); } @@ -349,7 +349,7 @@ miOverlayMarkOverlappedWindows( doUnderlay = (IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)); - box = REGION_EXTENTS(pScreen, &pWin->borderSize); + box = RegionExtents(&pWin->borderSize); if((pChild = pFirst)) { pLast = pChild->parent->lastChild; @@ -360,13 +360,13 @@ miOverlayMarkOverlappedWindows( pTree = MIOVERLAY_GET_WINDOW_TREE(pChild); 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 (markAll || - RECT_IN_REGION(pScreen, &pChild->borderSize, box)) + RegionContainsRect(&pChild->borderSize, box)) { MARK_OVERLAY(pChild); overMarked = TRUE; @@ -421,12 +421,12 @@ miOverlayMarkOverlappedWindows( while(1) { if(tChild->pWin->viewable) { - if (REGION_BROKEN (pScreen, &tChild->pWin->winSize)) + if (RegionBroken(&tChild->pWin->winSize)) SetWinSize (tChild->pWin); - if (REGION_BROKEN (pScreen, &tChild->pWin->borderSize)) + if (RegionBroken(&tChild->pWin->borderSize)) SetBorderSize (tChild->pWin); - if(RECT_IN_REGION(pScreen, &(tChild->pWin->borderSize), box)) + if(RegionContainsRect(&(tChild->pWin->borderSize), box)) { MARK_UNDERLAY(tChild->pWin); underMarked = TRUE; @@ -484,7 +484,7 @@ miOverlayComputeClips( borderSize.y2 = dy; oldVis = tParent->visibility; - switch (RECT_IN_REGION( pScreen, universe, &borderSize)) { + switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; break; @@ -534,8 +534,8 @@ miOverlayComputeClips( while (1) { if (tChild->pWin->viewable) { if (tChild->visibility != VisibilityFullyObscured) { - REGION_TRANSLATE( pScreen, &tChild->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &tChild->clipList, dx, dy); + RegionTranslate(&tChild->borderClip, dx, dy); + RegionTranslate(&tChild->clipList, dx, dy); tChild->pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -543,14 +543,14 @@ miOverlayComputeClips( (* pScreen->ClipNotify) (tChild->pWin, dx, dy); } if (tChild->valdata) { - REGION_NULL(pScreen, &tChild->valdata->borderExposed); + RegionNull(&tChild->valdata->borderExposed); if (HasParentRelativeBorder(tChild->pWin)){ - REGION_SUBTRACT(pScreen, + RegionSubtract( &tChild->valdata->borderExposed, &tChild->borderClip, &tChild->pWin->winSize); } - REGION_NULL(pScreen, &tChild->valdata->exposed); + RegionNull(&tChild->valdata->exposed); } if (tChild->firstChild) { tChild = tChild->firstChild; @@ -568,50 +568,50 @@ miOverlayComputeClips( /* fall through */ default: if (dx || dy) { - REGION_TRANSLATE( pScreen, &tParent->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &tParent->clipList, dx, dy); + RegionTranslate(&tParent->borderClip, dx, dy); + RegionTranslate(&tParent->clipList, dx, dy); } break; case VTBroken: - REGION_EMPTY (pScreen, &tParent->borderClip); - REGION_EMPTY (pScreen, &tParent->clipList); + RegionEmpty(&tParent->borderClip); + RegionEmpty(&tParent->clipList); break; } borderVisible = tParent->valdata->borderVisible; - REGION_NULL(pScreen, &tParent->valdata->borderExposed); - REGION_NULL(pScreen, &tParent->valdata->exposed); + RegionNull(&tParent->valdata->borderExposed); + RegionNull(&tParent->valdata->exposed); if (HasBorder (pParent)) { if (borderVisible) { - REGION_SUBTRACT( pScreen, exposed, universe, borderVisible); - REGION_DESTROY( pScreen, borderVisible); + RegionSubtract(exposed, universe, borderVisible); + RegionDestroy(borderVisible); } else - REGION_SUBTRACT( pScreen, exposed, universe, &tParent->borderClip); + RegionSubtract(exposed, universe, &tParent->borderClip); if (HasParentRelativeBorder(pParent) && (dx || dy)) - REGION_SUBTRACT( pScreen, &tParent->valdata->borderExposed, + RegionSubtract(&tParent->valdata->borderExposed, universe, &pParent->winSize); else - REGION_SUBTRACT( pScreen, &tParent->valdata->borderExposed, + RegionSubtract(&tParent->valdata->borderExposed, exposed, &pParent->winSize); - REGION_COPY( pScreen, &tParent->borderClip, universe); - REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize); + RegionCopy(&tParent->borderClip, universe); + RegionIntersect(universe, universe, &pParent->winSize); } else - REGION_COPY( pScreen, &tParent->borderClip, universe); + RegionCopy(&tParent->borderClip, universe); if ((tChild = tParent->firstChild) && pParent->mapped) { - REGION_NULL(pScreen, &childUniverse); - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUniverse); + RegionNull(&childUnion); for (; tChild; tChild = tChild->nextSib) { if (tChild->pWin->viewable) - REGION_APPEND( pScreen, &childUnion, &tChild->pWin->borderSize); + RegionAppend(&childUnion, &tChild->pWin->borderSize); } - REGION_VALIDATE( pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); for (tChild = tParent->firstChild; tChild; @@ -619,31 +619,31 @@ miOverlayComputeClips( { if (tChild->pWin->viewable) { if (tChild->valdata) { - REGION_INTERSECT( pScreen, &childUniverse, universe, + RegionIntersect(&childUniverse, universe, &tChild->pWin->borderSize); miOverlayComputeClips (tChild->pWin, &childUniverse, kind, exposed); } if (overlap) - REGION_SUBTRACT( pScreen, universe, universe, + RegionSubtract(universe, universe, &tChild->pWin->borderSize); } } if (!overlap) - REGION_SUBTRACT( pScreen, universe, universe, &childUnion); - REGION_UNINIT( pScreen, &childUnion); - REGION_UNINIT( pScreen, &childUniverse); + RegionSubtract(universe, universe, &childUnion); + RegionUninit(&childUnion); + RegionUninit(&childUniverse); } if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { - REGION_COPY( pScreen, &tParent->valdata->exposed, universe); + RegionCopy(&tParent->valdata->exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { - REGION_SUBTRACT( pScreen, &tParent->valdata->exposed, + RegionSubtract(&tParent->valdata->exposed, universe, &tParent->clipList); } @@ -721,14 +721,14 @@ miOverlayMarkUnrealizedWindow( if ((pChild != pWin) || fromConfigure) { miOverlayTreePtr pTree; - 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); if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) { if(pTree->valdata != (miOverlayValDataPtr)UnmapValData) { - REGION_EMPTY(pChild->drawable.pScreen, &pTree->clipList); - REGION_EMPTY(pChild->drawable.pScreen, &pTree->borderClip); + RegionEmpty(&pTree->clipList); + RegionEmpty(&pTree->borderClip); } } } @@ -753,9 +753,9 @@ miOverlayValidateTree( if (!pChild) pChild = pParent->firstChild; - REGION_NULL(pScreen, &totalClip); - REGION_NULL(pScreen, &childClip); - REGION_NULL(pScreen, &exposed); + RegionNull(&totalClip); + RegionNull(&childClip); + RegionNull(&exposed); newParent = pParent; @@ -769,52 +769,52 @@ miOverlayValidateTree( else tChild = tParent->firstChild; - if (REGION_BROKEN (pScreen, &tParent->clipList) && - !REGION_BROKEN (pScreen, &tParent->borderClip)) + if (RegionBroken(&tParent->clipList) && + !RegionBroken(&tParent->borderClip)) { kind = VTBroken; - REGION_COPY (pScreen, &totalClip, &tParent->borderClip); - REGION_INTERSECT (pScreen, &totalClip, &totalClip, + RegionCopy(&totalClip, &tParent->borderClip); + RegionIntersect(&totalClip, &totalClip, &tParent->pWin->winSize); for (tWin = tParent->firstChild; tWin != tChild; tWin = tWin->nextSib) { if (tWin->pWin->viewable) - REGION_SUBTRACT (pScreen, &totalClip, &totalClip, + RegionSubtract(&totalClip, &totalClip, &tWin->pWin->borderSize); } - REGION_EMPTY (pScreen, &tParent->clipList); + RegionEmpty(&tParent->clipList); } else { for(tWin = tChild; tWin; tWin = tWin->nextSib) { if(tWin->valdata) - REGION_APPEND(pScreen, &totalClip, &tWin->borderClip); + RegionAppend(&totalClip, &tWin->borderClip); } - REGION_VALIDATE(pScreen, &totalClip, &overlap); + RegionValidate(&totalClip, &overlap); } if(kind != VTStack) - REGION_UNION(pScreen, &totalClip, &totalClip, &tParent->clipList); + RegionUnion(&totalClip, &totalClip, &tParent->clipList); for(tWin = tChild; tWin; tWin = tWin->nextSib) { if(tWin->valdata) { if(tWin->pWin->viewable) { - REGION_INTERSECT(pScreen, &childClip, &totalClip, + RegionIntersect(&childClip, &totalClip, &tWin->pWin->borderSize); miOverlayComputeClips(tWin->pWin, &childClip, kind, &exposed); - REGION_SUBTRACT(pScreen, &totalClip, &totalClip, + RegionSubtract(&totalClip, &totalClip, &tWin->pWin->borderSize); } else { /* Means we are unmapping */ - REGION_EMPTY(pScreen, &tWin->clipList); - REGION_EMPTY( pScreen, &tWin->borderClip); + RegionEmpty(&tWin->clipList); + RegionEmpty(&tWin->borderClip); tWin->valdata = NULL; } } } - REGION_UNINIT(pScreen, &childClip); + RegionUninit(&childClip); if(!((*pPriv->InOverlay)(newParent))) { - REGION_NULL(pScreen, &tParent->valdata->exposed); - REGION_NULL(pScreen, &tParent->valdata->borderExposed); + RegionNull(&tParent->valdata->exposed); + RegionNull(&tParent->valdata->borderExposed); } switch (kind) { @@ -822,18 +822,18 @@ miOverlayValidateTree( break; default: if(!((*pPriv->InOverlay)(newParent))) - REGION_SUBTRACT(pScreen, &tParent->valdata->exposed, &totalClip, + RegionSubtract(&tParent->valdata->exposed, &totalClip, &tParent->clipList); /* fall through */ case VTMap: - REGION_COPY( pScreen, &tParent->clipList, &totalClip); + RegionCopy(&tParent->clipList, &totalClip); if(!((*pPriv->InOverlay)(newParent))) newParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; break; } - REGION_UNINIT( pScreen, &totalClip); - REGION_UNINIT( pScreen, &exposed); + RegionUninit(&totalClip); + RegionUninit(&exposed); SKIP_UNDERLAY: @@ -866,13 +866,13 @@ miOverlayHandleExposures(WindowPtr pWin) while (1) { if((mival = pTree->valdata)) { if(!((*pPriv->InOverlay)(pTree->pWin))) { - if (REGION_NOTEMPTY(pScreen, &mival->borderExposed)) + if (RegionNotEmpty(&mival->borderExposed)) (*pWin->drawable.pScreen->PaintWindowBorder)( pTree->pWin, &mival->borderExposed, PW_BORDER); - REGION_UNINIT(pScreen, &mival->borderExposed); + RegionUninit(&mival->borderExposed); (*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion); - REGION_UNINIT(pScreen, &mival->exposed); + RegionUninit(&mival->exposed); } xfree(mival); pTree->valdata = NULL; @@ -894,24 +894,24 @@ miOverlayHandleExposures(WindowPtr pWin) while (1) { if ( (val = pChild->valdata) ) { if(!((*pPriv->InOverlay)(pChild))) { - REGION_UNION(pScreen, &val->after.exposed, &val->after.exposed, + RegionUnion(&val->after.exposed, &val->after.exposed, &val->after.borderExposed); - if (REGION_NOTEMPTY(pScreen, &val->after.exposed)) { + if (RegionNotEmpty(&val->after.exposed)) { (*(MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->MakeTransparent))( pScreen, - REGION_NUM_RECTS(&val->after.exposed), - REGION_RECTS(&val->after.exposed)); + RegionNumRects(&val->after.exposed), + RegionRects(&val->after.exposed)); } } else { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) + if (RegionNotEmpty(&val->after.borderExposed)) (*pChild->drawable.pScreen->PaintWindowBorder)(pChild, &val->after.borderExposed, PW_BORDER); (*WindowExposures)(pChild, &val->after.exposed, NullRegion); } - REGION_UNINIT(pScreen, &val->after.borderExposed); - REGION_UNINIT(pScreen, &val->after.exposed); + RegionUninit(&val->after.borderExposed); + RegionUninit(&val->after.exposed); xfree(val); pChild->valdata = (ValidatePtr)NULL; if (pChild->firstChild) @@ -955,13 +955,13 @@ miOverlayMoveWindow( oldpt.x = pWin->drawable.x; oldpt.y = pWin->drawable.y; if (WasViewable) { - REGION_NULL(pScreen, &overReg); - REGION_NULL(pScreen, &underReg); + RegionNull(&overReg); + RegionNull(&underReg); if(pTree) { - REGION_COPY(pScreen, &overReg, &pWin->borderClip); - REGION_COPY(pScreen, &underReg, &pTree->borderClip); + RegionCopy(&overReg, &pWin->borderClip); + RegionCopy(&underReg, &pTree->borderClip); } else { - REGION_COPY(pScreen, &overReg, &pWin->borderClip); + RegionCopy(&overReg, &pWin->borderClip); CollectUnderlayChildrenRegions(pWin, &underReg); } (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); @@ -990,16 +990,16 @@ miOverlayMoveWindow( #endif /* DO_SAVE_UNDERS */ (*pScreen->ValidateTree)(pWin->parent, NullWindow, kind); - if(REGION_NOTEMPTY(pScreen, &underReg)) { + if(RegionNotEmpty(&underReg)) { pPriv->copyUnderlay = TRUE; (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, &underReg); } - REGION_UNINIT(pScreen, &underReg); - if(REGION_NOTEMPTY(pScreen, &overReg)) { + RegionUninit(&underReg); + if(RegionNotEmpty(&overReg)) { pPriv->copyUnderlay = FALSE; (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, &overReg); } - REGION_UNINIT(pScreen, &overReg); + RegionUninit(&overReg); (*pScreen->HandleExposures)(pWin->parent); #ifdef DO_SAVE_UNDERS @@ -1028,8 +1028,8 @@ miOverlayWindowExposures( if (pWin->backStorage && prgn) exposures = (*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; @@ -1038,35 +1038,35 @@ miOverlayWindowExposures( ExposureMask; if (other_exposed) { if (exposures) { - REGION_UNION(pScreen, other_exposed, exposures, other_exposed); + RegionUnion(other_exposed, exposures, other_exposed); if (exposures != prgn) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); } exposures = other_exposed; } if (clientInterested && exposures && - (REGION_NUM_RECTS(exposures) > RECTLIMIT)) + (RegionNumRects(exposures) > RECTLIMIT)) { miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); BoxRec box; - box = *REGION_EXTENTS(pScreen, exposures); + box = *RegionExtents(exposures); if (exposures == prgn) { exposures = &expRec; - REGION_INIT(pScreen, exposures, &box, 1); - REGION_RESET(pScreen, prgn, &box); + RegionInit(exposures, &box, 1); + RegionReset(prgn, &box); } else { - REGION_RESET(pScreen, exposures, &box); - REGION_UNION(pScreen, prgn, prgn, exposures); + RegionReset(exposures, &box); + RegionUnion(prgn, prgn, exposures); } /* This is the only reason why we are replacing mi's version of this file */ if(!((*pPriv->InOverlay)(pWin))) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); - REGION_INTERSECT(pScreen, prgn, prgn, &pTree->clipList); + RegionIntersect(prgn, prgn, &pTree->clipList); } else - REGION_INTERSECT(pScreen, prgn, prgn, &pWin->clipList); + RegionIntersect(prgn, prgn, &pWin->clipList); /* need to clear out new areas of backing store, too */ if (pWin->backStorage) @@ -1078,22 +1078,22 @@ miOverlayWindowExposures( box.y2 - box.y1, FALSE); } - if (prgn && !REGION_NIL(prgn)) + if (prgn && !RegionNil(prgn)) (*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(pScreen, exposures); + RegionUninit(exposures); } else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); if (prgn) - REGION_EMPTY(pScreen, prgn); + RegionEmpty(prgn); } else if (exposures && exposures != prgn) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); } @@ -1118,23 +1118,23 @@ miOverlayRecomputeExposures ( /* * compute exposed regions of this window */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->clipList, pValid->over); /* * 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->over); } if(pTree && pTree->valdata) { - REGION_SUBTRACT(pScreen, &pTree->valdata->exposed, + RegionSubtract(&pTree->valdata->exposed, &pTree->clipList, pValid->under); - REGION_SUBTRACT(pScreen, &pTree->valdata->borderExposed, + RegionSubtract(&pTree->valdata->borderExposed, &pTree->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pTree->valdata->borderExposed, + RegionSubtract(&pTree->valdata->borderExposed, &pTree->valdata->borderExposed, pValid->under); } else if (!pWin->valdata) return WT_NOMATCH; @@ -1194,11 +1194,11 @@ miOverlayResizeWindow( /* * 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); if(doUnderlay) { - oldRegion2 = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion2, &pWin->winSize); + oldRegion2 = RegionCreate(NullBox, 1); + RegionCopy(oldRegion2, &pWin->winSize); } /* @@ -1210,16 +1210,16 @@ miOverlayResizeWindow( g = pChild->winGravity; 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); if(doUnderlay) { if (!gravitate2[g]) - gravitate2[g] = REGION_CREATE(pScreen, NullBox, 0); + gravitate2[g] = RegionCreate(NullBox, 0); if((tChild = MIOVERLAY_GET_WINDOW_TREE(pChild))) { - REGION_UNION(pScreen, gravitate2[g], + RegionUnion(gravitate2[g], gravitate2[g], &tChild->borderClip); } else CollectUnderlayChildrenRegions(pChild, gravitate2[g]); @@ -1233,11 +1233,11 @@ miOverlayResizeWindow( oldWinClip = oldWinClip2 = 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(pTree) { - oldWinClip2 = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip2, &pTree->clipList); + oldWinClip2 = RegionCreate(NullBox, 1); + RegionCopy(oldWinClip2, &pTree->clipList); } } /* @@ -1253,26 +1253,26 @@ miOverlayResizeWindow( if ((pWin->drawable.height != h || pWin->drawable.width != w) && HasBorder (pWin)) { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); + borderVisible = RegionCreate(NullBox, 1); if(pTree) - borderVisible2 = REGION_CREATE(pScreen, NullBox, 1); + borderVisible2 = 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); if(pTree) { if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, + RegionSubtract(borderVisible, &pTree->borderClip, &pWin->winSize); else - REGION_COPY(pScreen, borderVisible, + RegionCopy(borderVisible, &pTree->borderClip); } } @@ -1299,9 +1299,9 @@ miOverlayResizeWindow( pFirstChange = MoveWindowInStack(pWin, 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); (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, NULL); @@ -1320,9 +1320,9 @@ miOverlayResizeWindow( * 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); if(pTree) - REGION_COPY(pScreen, &pTree->valdata->exposed, &pTree->clipList); + RegionCopy(&pTree->valdata->exposed, &pTree->clipList); } GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); @@ -1361,20 +1361,20 @@ miOverlayResizeWindow( dx = (oldx - nx) - offx; dy = (oldy - ny) - offy; if (dx || dy) { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); + RegionTranslate(&pWin->winSize, dx, dy); offx += dx; offy += dy; } if(gravitate[g]) - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], + RegionIntersect(gravitate[g], gravitate[g], &pWin->winSize); if(gravitate2[g]) - REGION_INTERSECT(pScreen, gravitate2[g], gravitate2[g], + RegionIntersect(gravitate2[g], gravitate2[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 @@ -1382,22 +1382,22 @@ miOverlayResizeWindow( if (oldWinClip2) { - REGION_COPY(pScreen, pRegion, oldWinClip2); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip2, pRegion, &pTree->clipList); + RegionCopy(pRegion, oldWinClip2); + RegionTranslate(pRegion, nx - oldx, ny - oldy); + RegionIntersect(oldWinClip2, pRegion, &pTree->clipList); for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate2[g]) - REGION_SUBTRACT(pScreen, oldWinClip2, oldWinClip2, + RegionSubtract(oldWinClip2, oldWinClip2, gravitate2[g]); } - REGION_TRANSLATE(pScreen, oldWinClip2, oldx - nx, oldy - ny); + RegionTranslate(oldWinClip2, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate2[g]) gravitate2[g] = oldWinClip2; else { - REGION_UNION(pScreen,gravitate2[g],gravitate2[g],oldWinClip2); - REGION_DESTROY(pScreen, oldWinClip2); + RegionUnion(gravitate2[g],gravitate2[g],oldWinClip2); + RegionDestroy(oldWinClip2); } } @@ -1406,9 +1406,9 @@ miOverlayResizeWindow( /* * 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 @@ -1416,16 +1416,16 @@ miOverlayResizeWindow( */ 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); } } @@ -1449,23 +1449,23 @@ miOverlayResizeWindow( /* only copy the remaining useful bits */ if(gravitate[g]) - REGION_INTERSECT(pScreen, gravitate[g], + RegionIntersect(gravitate[g], gravitate[g], oldRegion); if(gravitate2[g]) - REGION_INTERSECT(pScreen, gravitate2[g], + RegionIntersect(gravitate2[g], gravitate2[g], oldRegion2); /* clip to not overwrite already copied areas */ if (destClip && gravitate[g]) { - 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); } if (destClip2 && gravitate2[g]) { - REGION_TRANSLATE(pScreen, destClip2, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen,gravitate2[g],gravitate2[g],destClip2); - REGION_TRANSLATE(pScreen, destClip2, x - oldpt.x, y - oldpt.y); + RegionTranslate(destClip2, oldpt.x - x, oldpt.y - y); + RegionSubtract(gravitate2[g],gravitate2[g],destClip2); + RegionTranslate(destClip2, x - oldpt.x, y - oldpt.y); } /* and move those bits */ @@ -1486,9 +1486,9 @@ miOverlayResizeWindow( /* remove any overwritten bits from the remaining useful bits */ if(gravitate[g]) - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); + RegionSubtract(oldRegion, oldRegion, gravitate[g]); if(gravitate2[g]) - REGION_SUBTRACT(pScreen, oldRegion2, oldRegion2, gravitate2[g]); + RegionSubtract(oldRegion2, oldRegion2, gravitate2[g]); /* * recompute exposed regions of child windows @@ -1513,38 +1513,38 @@ miOverlayResizeWindow( if (g == pWin->bitGravity) { if(gravitate[g]) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->valdata->after.exposed, gravitate[g]); if(gravitate2[g] && pTree) - REGION_SUBTRACT(pScreen, &pTree->valdata->exposed, + RegionSubtract(&pTree->valdata->exposed, &pTree->valdata->exposed, gravitate2[g]); } if(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]); } } if(gravitate2[g]) { if (!destClip2) destClip2 = gravitate2[g]; else { - REGION_UNION(pScreen, destClip2, destClip2, gravitate2[g]); - REGION_DESTROY(pScreen, gravitate2[g]); + RegionUnion(destClip2, destClip2, gravitate2[g]); + RegionDestroy(gravitate2[g]); } } } - REGION_DESTROY(pScreen, pRegion); - REGION_DESTROY(pScreen, oldRegion); + RegionDestroy(pRegion); + RegionDestroy(oldRegion); if(doUnderlay) - REGION_DESTROY(pScreen, oldRegion2); + RegionDestroy(oldRegion2); if (destClip) - REGION_DESTROY(pScreen, destClip); + RegionDestroy(destClip); if (destClip2) - REGION_DESTROY(pScreen, destClip2); + RegionDestroy(destClip2); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -1552,8 +1552,8 @@ miOverlayResizeWindow( valExposed = &pWin->valdata->after.exposed; (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionEmpty(valExposed); + RegionDestroy(bsExposed); } (*pScreen->HandleExposures)(pWin->parent); #ifdef DO_SAVE_UNDERS @@ -1565,7 +1565,7 @@ miOverlayResizeWindow( } else if (bsExposed) { (*pScreen->WindowExposures) (pWin, NullRegion, bsExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionDestroy(bsExposed); } if (pWin->realized) WindowsRestructured (); @@ -1589,8 +1589,8 @@ miOverlaySetShape(WindowPtr pWin) if (HasBorder (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; pWin->valdata->before.resized = TRUE; @@ -1598,8 +1598,8 @@ miOverlaySetShape(WindowPtr pWin) miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr borderVisible2; - borderVisible2 = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible2, + borderVisible2 = RegionCreate(NULL, 1); + RegionSubtract(borderVisible2, &pTree->borderClip, &pWin->winSize); pTree->valdata->borderVisible = borderVisible2; } @@ -1613,8 +1613,8 @@ miOverlaySetShape(WindowPtr pWin) if (WasViewable) { if (pWin->backStorage) { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); + pOldClip = RegionCreate(NullBox, 1); + RegionCopy(pOldClip, &pWin->clipList); } (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); @@ -1634,7 +1634,7 @@ miOverlaySetShape(WindowPtr pWin) (pWin, 0, 0, pOldClip, pWin->drawable.x, pWin->drawable.y); if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); + RegionDestroy(pOldClip); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -1643,8 +1643,8 @@ miOverlaySetShape(WindowPtr 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) { @@ -1694,16 +1694,16 @@ miOverlayChangeBorderWidth( if (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; if(IN_UNDERLAY(pWin)) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr borderVisible2; - borderVisible2 = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible2, + borderVisible2 = RegionCreate(NULL, 1); + RegionSubtract(borderVisible2, &pTree->borderClip, &pWin->winSize); pTree->valdata->borderVisible = borderVisible2; } @@ -1746,11 +1746,11 @@ miOverlaySetRootClip(ScreenPtr pScreen, Bool enable) box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_RESET(pScreen, &pTree->borderClip, &box); + RegionReset(&pTree->borderClip, &box); } else - REGION_EMPTY(pScreen, &pTree->borderClip); + RegionEmpty(&pTree->borderClip); - REGION_BREAK(pScreen, &pTree->clipList); + RegionBreak(&pTree->clipList); } static void @@ -1785,7 +1785,7 @@ miOverlayClearToBackground( clipList = ((*pScreenPriv->InOverlay)(pWin)) ? &pWin->clipList : &pTree->clipList; - extents = REGION_EXTENTS(pScreen, clipList); + extents = RegionExtents(clipList); if (x1 < extents->x1) x1 = extents->x1; if (x2 > extents->x2) x2 = extents->x2; @@ -1798,20 +1798,20 @@ miOverlayClearToBackground( box.x1 = x1; box.x2 = x2; box.y1 = y1; box.y2 = y2; - REGION_INIT(pScreen, ®, &box, 1); + RegionInit(®, &box, 1); if (pWin->backStorage) { pBSReg = (* pScreen->ClearBackingStore)(pWin, x, y, w, h, generateExposures); } - REGION_INTERSECT(pScreen, ®, ®, clipList); + RegionIntersect(®, ®, 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); } @@ -1865,12 +1865,12 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) } if (pGC->subWindowMode == IncludeInferiors) { - pregWin = REGION_CREATE(pScreen, NullBox, 1); + pregWin = RegionCreate(NullBox, 1); freeTmpClip = TRUE; if (pWin->parent || (screenIsSaved != SCREEN_SAVER_ON) || !HasSaverWindow (pScreen->myNum)) { - REGION_INTERSECT(pScreen,pregWin,&pTree->borderClip,&pWin->winSize); + RegionIntersect(pregWin,&pTree->borderClip,&pWin->winSize); } } else { pregWin = &pTree->clipList; @@ -1879,29 +1879,29 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) freeCompClip = pGC->freeCompClip; if (pGC->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; pGC->freeCompClip = freeTmpClip; } else { - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pWin->drawable.x + pGC->clipOrg.x, pWin->drawable.y + pGC->clipOrg.y); if (freeCompClip) { - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip); + RegionIntersect(pregWin, pregWin, pGC->clientClip); pGC->pCompositeClip = pregWin; } else { - pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + pGC->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); } pGC->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pWin->drawable.x + pGC->clipOrg.x), -(pWin->drawable.y + pGC->clipOrg.y)); } @@ -1919,7 +1919,7 @@ miOverlayCollectUnderlayRegions( return FALSE; } - *region = REGION_CREATE(pWin->drawable.pScreen, NullBox, 0); + *region = RegionCreate(NullBox, 0); CollectUnderlayChildrenRegions(pWin, *region); @@ -2041,7 +2041,7 @@ CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg) while(1) { if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) { - REGION_APPEND(pScreen, pReg, &pTree->borderClip); + RegionAppend(pReg, &pTree->borderClip); hasUnderlay = TRUE; } else if(pChild->firstChild) { @@ -2059,7 +2059,7 @@ CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg) if(hasUnderlay) { Bool overlap; - REGION_VALIDATE(pScreen, pReg, &overlap); + RegionValidate(pReg, &overlap); } return hasUnderlay; diff --git a/nx-X11/programs/Xserver/mi/miregion.c b/nx-X11/programs/Xserver/mi/miregion.c index 1df0dcc46..b8216e1bb 100644 --- a/nx-X11/programs/Xserver/mi/miregion.c +++ b/nx-X11/programs/Xserver/mi/miregion.c @@ -197,7 +197,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ { \ if (!miRectAlloc(pReg, 1)) \ return FALSE; \ - pNextRect = REGION_TOP(pReg); \ + pNextRect = RegionTop(pReg); \ } \ ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \ pReg->data->numRects++; \ @@ -208,7 +208,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ #define DOWNSIZE(reg,numRects) \ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ { \ - size_t NewSize = REGION_SZOF(numRects); \ + size_t NewSize = RegionSizeof(numRects); \ RegDataPtr NewData = \ (NewSize > 0) ? (RegDataPtr)xrealloc((reg)->data, NewSize) : NULL; \ if (NewData) \ @@ -234,9 +234,9 @@ miPrintRegion(rgn) register int i; BoxPtr rects; - num = REGION_NUM_RECTS(rgn); - size = REGION_SIZE(rgn); - rects = REGION_RECTS(rgn); + num = RegionNumRects(rgn); + size = RegionSize(rgn); + rects = RegionRects(rgn); ErrorF("num: %d size: %d\n", num, size); ErrorF("extents: %d %d %d %d\n", rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2); @@ -261,11 +261,11 @@ miRegionEqual(reg1, reg2) if (reg1->extents.y1 != reg2->extents.y1) return FALSE; if (reg1->extents.y2 != reg2->extents.y2) return FALSE; - num = REGION_NUM_RECTS(reg1); - if (num != REGION_NUM_RECTS(reg2)) return FALSE; + num = RegionNumRects(reg1); + if (num != RegionNumRects(reg2)) return FALSE; - rects1 = REGION_RECTS(reg1); - rects2 = REGION_RECTS(reg2); + rects1 = RegionRects(reg1); + rects2 = RegionRects(reg2); for (i = 0; i != num; i++) { if (rects1[i].x1 != rects2[i].x1) return FALSE; if (rects1[i].x2 != rects2[i].x2) return FALSE; @@ -285,7 +285,7 @@ miValidRegion(reg) if ((reg->extents.x1 > reg->extents.x2) || (reg->extents.y1 > reg->extents.y2)) return FALSE; - numRects = REGION_NUM_RECTS(reg); + numRects = RegionNumRects(reg); if (!numRects) return ((reg->extents.x1 == reg->extents.x2) && (reg->extents.y1 == reg->extents.y2) && @@ -297,7 +297,7 @@ miValidRegion(reg) register BoxPtr pboxP, pboxN; BoxRec box; - pboxP = REGION_RECTS(reg); + pboxP = RegionRects(reg); box = *pboxP; box.y2 = pboxP[numRects-1].y2; pboxN = pboxP + 1; @@ -349,7 +349,7 @@ miRegionCreate(rect, size) else { pReg->extents = miEmptyBox; - newSize = REGION_SZOF(size); + newSize = RegionSizeof(size); if ((size > 1) && (newSize > 0) && (pReg->data = xalloc(newSize))) { @@ -383,7 +383,7 @@ miRegionInit(pReg, rect, size) else { pReg->extents = miEmptyBox; - newSize = REGION_SZOF(size); + newSize = RegionSizeof(size); if ((size > 1) && (newSize > 0) && (pReg->data = xalloc(newSize))) { @@ -434,16 +434,16 @@ miRectAlloc( if (!pRgn->data) { n++; - rgnSize = REGION_SZOF(n); + rgnSize = RegionSizeof(n); pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL; if (!pRgn->data) return miRegionBreak (pRgn); pRgn->data->numRects = 1; - *REGION_BOXPTR(pRgn) = pRgn->extents; + *RegionBoxptr(pRgn) = pRgn->extents; } else if (!pRgn->data->size) { - rgnSize = REGION_SZOF(n); + rgnSize = RegionSizeof(n); pRgn->data = (rgnSize > 0) ? xalloc(rgnSize) : NULL; if (!pRgn->data) return miRegionBreak (pRgn); @@ -458,7 +458,7 @@ miRectAlloc( n = 250; } n += pRgn->data->numRects; - rgnSize = REGION_SZOF(n); + rgnSize = RegionSizeof(n); data = (rgnSize > 0) ? xrealloc(pRgn->data, rgnSize) : NULL; if (!data) return miRegionBreak (pRgn); @@ -486,7 +486,7 @@ miRegionCopy(dst, src) } if (!dst->data || (dst->data->size < src->data->numRects)) { - size_t newSize = REGION_SZOF(src->data->numRects); + size_t newSize = RegionSizeof(src->data->numRects); xfreeData(dst); dst->data = newSize > 0 ? xalloc(newSize) : NULL; @@ -495,7 +495,7 @@ miRegionCopy(dst, src) dst->data->size = src->data->numRects; } dst->data->numRects = src->data->numRects; - memmove((char *)REGION_BOXPTR(dst),(char *)REGION_BOXPTR(src), + memmove((char *)RegionBoxptr(dst),(char *)RegionBoxptr(src), dst->data->numRects * sizeof(BoxRec)); return TRUE; } @@ -545,8 +545,8 @@ miCoalesce ( * The bands may only be coalesced if the bottom of the previous * matches the top scanline of the current. */ - pPrevBox = REGION_BOX(pReg, prevStart); - pCurBox = REGION_BOX(pReg, curStart); + pPrevBox = RegionBox(pReg, prevStart); + pCurBox = RegionBox(pReg, curStart); if (pPrevBox->y2 != pCurBox->y1) return curStart; /* @@ -625,7 +625,7 @@ miAppendNonO ( /* Make sure we have enough space for all rectangles to be added */ RECTALLOC(pReg, newRects); - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); pReg->data->numRects += newRects; do { assert(r->x1 < r->x2); @@ -650,7 +650,7 @@ miAppendNonO ( int newRects; \ if ((newRects = rEnd - r)) { \ RECTALLOC(newReg, newRects); \ - memmove((char *)REGION_TOP(newReg),(char *)r, \ + memmove((char *)RegionTop(newReg),(char *)r, \ newRects * sizeof(BoxRec)); \ newReg->data->numRects += newRects; \ } \ @@ -731,7 +731,7 @@ miRegionOp( /* * Break any region computed from a broken region */ - if (REGION_NAR (reg1) || REGION_NAR(reg2)) + if (RegionNar (reg1) || RegionNar(reg2)) return miRegionBreak (newReg); /* @@ -742,11 +742,11 @@ miRegionOp( * another array of rectangles for it to use. */ - r1 = REGION_RECTS(reg1); - newSize = REGION_NUM_RECTS(reg1); + r1 = RegionRects(reg1); + newSize = RegionNumRects(reg1); r1End = r1 + newSize; - numRects = REGION_NUM_RECTS(reg2); - r2 = REGION_RECTS(reg2); + numRects = RegionNumRects(reg2); + r2 = RegionRects(reg2); r2End = r2 + numRects; assert(r1 != r1End); assert(r2 != r2End); @@ -903,7 +903,7 @@ miRegionOp( } else if (numRects == 1) { - newReg->extents = *REGION_BOXPTR(newReg); + newReg->extents = *RegionBoxptr(newReg); xfreeData(newReg); newReg->data = (RegDataPtr)NULL; } @@ -945,8 +945,8 @@ miSetExtents (pReg) return; } - pBox = REGION_BOXPTR(pReg); - pBoxEnd = REGION_END(pReg); + pBox = RegionBoxptr(pReg); + pBoxEnd = RegionEnd(pReg); /* * Since pBox is the first rectangle in the region, it must have the @@ -1004,7 +1004,7 @@ miIntersectO ( register int x2; register BoxPtr pNextRect; - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); assert(y1 < y2); assert(r1 != r1End && r2 != r2End); @@ -1047,14 +1047,14 @@ miIntersect(newReg, reg1, reg2) good(reg2); good(newReg); /* check for trivial reject */ - if (REGION_NIL(reg1) || REGION_NIL(reg2) || + if (RegionNil(reg1) || RegionNil(reg2) || !EXTENTCHECK(®1->extents, ®2->extents)) { /* Covers about 20% of all cases */ xfreeData(newReg); newReg->extents.x2 = newReg->extents.x1; newReg->extents.y2 = newReg->extents.y1; - if (REGION_NAR(reg1) || REGION_NAR(reg2)) + if (RegionNar(reg1) || RegionNar(reg2)) { newReg->data = &miBrokenData; return FALSE; @@ -1150,7 +1150,7 @@ miUnionO ( assert (y1 < y2); assert(r1 != r1End && r2 != r2End); - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); /* Start off current rectangle */ if (r1->x1 < r2->x1) @@ -1217,9 +1217,9 @@ miUnion(newReg, reg1, reg2) /* * Region 1 is empty */ - if (REGION_NIL(reg1)) + if (RegionNil(reg1)) { - if (REGION_NAR(reg1)) + if (RegionNar(reg1)) return miRegionBreak (newReg); if (newReg != reg2) return miRegionCopy(newReg, reg2); @@ -1229,9 +1229,9 @@ miUnion(newReg, reg1, reg2) /* * Region 2 is empty */ - if (REGION_NIL(reg2)) + if (RegionNil(reg2)) { - if (REGION_NAR(reg2)) + if (RegionNar(reg2)) return miRegionBreak (newReg); if (newReg != reg1) return miRegionCopy(newReg, reg1); @@ -1300,7 +1300,7 @@ miRegionAppend(dstrgn, rgn) BoxPtr new, old; Bool prepend; - if (REGION_NAR(rgn)) + if (RegionNar(rgn)) return miRegionBreak (dstrgn); if (!rgn->data && (dstrgn->data == &miEmptyData)) @@ -1310,16 +1310,16 @@ miRegionAppend(dstrgn, rgn) return TRUE; } - numRects = REGION_NUM_RECTS(rgn); + numRects = RegionNumRects(rgn); if (!numRects) return TRUE; prepend = FALSE; size = numRects; - dnumRects = REGION_NUM_RECTS(dstrgn); + dnumRects = RegionNumRects(dstrgn); if (!dnumRects && (size < 200)) size = 200; /* XXX pick numbers out of a hat */ RECTALLOC(dstrgn, size); - old = REGION_RECTS(rgn); + old = RegionRects(rgn); if (!dnumRects) dstrgn->extents = rgn->extents; else if (dstrgn->extents.x2 > dstrgn->extents.x1) @@ -1327,7 +1327,7 @@ miRegionAppend(dstrgn, rgn) register BoxPtr first, last; first = old; - last = REGION_BOXPTR(dstrgn) + (dnumRects - 1); + last = RegionBoxptr(dstrgn) + (dnumRects - 1); if ((first->y1 > last->y2) || ((first->y1 == last->y1) && (first->y2 == last->y2) && (first->x1 > last->x2))) @@ -1340,7 +1340,7 @@ miRegionAppend(dstrgn, rgn) } else { - first = REGION_BOXPTR(dstrgn); + first = RegionBoxptr(dstrgn); last = old + (numRects - 1); if ((first->y1 > last->y2) || ((first->y1 == last->y1) && (first->y2 == last->y2) && @@ -1359,16 +1359,16 @@ miRegionAppend(dstrgn, rgn) } if (prepend) { - new = REGION_BOX(dstrgn, numRects); + new = RegionBox(dstrgn, numRects); if (dnumRects == 1) - *new = *REGION_BOXPTR(dstrgn); + *new = *RegionBoxptr(dstrgn); else - memmove((char *)new,(char *)REGION_BOXPTR(dstrgn), + memmove((char *)new,(char *)RegionBoxptr(dstrgn), dnumRects * sizeof(BoxRec)); - new = REGION_BOXPTR(dstrgn); + new = RegionBoxptr(dstrgn); } else - new = REGION_BOXPTR(dstrgn) + dnumRects; + new = RegionBoxptr(dstrgn) + dnumRects; if (numRects == 1) *new = *old; else @@ -1511,7 +1511,7 @@ miRegionValidate(badreg, pOverlap) numRects = badreg->data->numRects; if (!numRects) { - if (REGION_NAR(badreg)) + if (RegionNar(badreg)) return FALSE; good(badreg); return TRUE; @@ -1532,7 +1532,7 @@ miRegionValidate(badreg, pOverlap) } /* Step 1: Sort the rects array into ascending (y1, x1) order */ - QuickSortRects(REGION_BOXPTR(badreg), numRects); + QuickSortRects(RegionBoxptr(badreg), numRects); /* Step 2: Scatter the sorted array into the minimum number of regions */ @@ -1546,7 +1546,7 @@ miRegionValidate(badreg, pOverlap) ri[0].prevBand = 0; ri[0].curBand = 0; ri[0].reg = *badreg; - box = REGION_BOXPTR(&ri[0].reg); + box = RegionBoxptr(&ri[0].reg); ri[0].reg.extents = *box; ri[0].reg.data->numRects = 1; @@ -1563,7 +1563,7 @@ miRegionValidate(badreg, pOverlap) for (j = numRI, rit = ri; --j >= 0; rit++) { reg = &rit->reg; - riBox = REGION_END(reg); + riBox = RegionEnd(reg); if (box->y1 == riBox->y1 && box->y2 == riBox->y2) { @@ -1577,7 +1577,7 @@ miRegionValidate(badreg, pOverlap) else { RECTALLOC_BAIL(reg, 1, bail); - *REGION_TOP(reg) = *box; + *RegionTop(reg) = *box; reg->data->numRects++; } goto NextRect; /* So sue me */ @@ -1590,7 +1590,7 @@ miRegionValidate(badreg, pOverlap) Coalesce(reg, rit->prevBand, rit->curBand); rit->curBand = reg->data->numRects; RECTALLOC_BAIL(reg, 1, bail); - *REGION_TOP(reg) = *box; + *RegionTop(reg) = *box; reg->data->numRects++; goto NextRect; } @@ -1624,7 +1624,7 @@ NextRect: ; for (j = numRI, rit = ri; --j >= 0; rit++) { reg = &rit->reg; - riBox = REGION_END(reg); + riBox = RegionEnd(reg); reg->extents.y2 = riBox->y2; if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; Coalesce(reg, rit->prevBand, rit->curBand); @@ -1682,7 +1682,7 @@ miRectsToRegion(nrects, prect, ctype) size_t newSize; pRgn = miRegionCreate(NullBox, 0); - if (REGION_NAR (pRgn)) + if (RegionNar (pRgn)) return pRgn; if (!nrects) return pRgn; @@ -1704,7 +1704,7 @@ miRectsToRegion(nrects, prect, ctype) } return pRgn; } - newSize = REGION_SZOF(nrects); + newSize = RegionSizeof(nrects); pData = newSize > 0 ? xalloc(newSize) : NULL; if (!pData) { @@ -1790,7 +1790,7 @@ miSubtractO ( assert(y1extents, ®S->extents)) { - if (REGION_NAR (regS)) + if (RegionNar (regS)) return miRegionBreak (regD); return miRegionCopy(regD, regM); } @@ -1973,9 +1973,9 @@ miInverse(newReg, reg1, invRect) good(reg1); good(newReg); /* check for trivial rejects */ - if (REGION_NIL(reg1) || !EXTENTCHECK(invRect, ®1->extents)) + if (RegionNil(reg1) || !EXTENTCHECK(invRect, ®1->extents)) { - if (REGION_NAR(reg1)) + if (RegionNar(reg1)) return miRegionBreak (newReg); newReg->extents = *invRect; xfreeData(newReg); @@ -2033,7 +2033,7 @@ miRectIn(region, prect) int numRects; good(region); - numRects = REGION_NUM_RECTS(region); + numRects = RegionNumRects(region); /* useful optimization */ if (!numRects || !EXTENTCHECK(®ion->extents, prect)) return(rgnOUT); @@ -2055,7 +2055,7 @@ miRectIn(region, prect) y = prect->y1; /* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */ - for (pbox = REGION_BOXPTR(region), pboxEnd = pbox + numRects; + for (pbox = RegionBoxptr(region), pboxEnd = pbox + numRects; pbox != pboxEnd; pbox++) { @@ -2135,7 +2135,7 @@ miTranslateRegion(pReg, x, y) { if (pReg->data && (nbox = pReg->data->numRects)) { - for (pbox = REGION_BOXPTR(pReg); nbox--; pbox++) + for (pbox = RegionBoxptr(pReg); nbox--; pbox++) { pbox->x1 += x; pbox->y1 += y; @@ -2165,7 +2165,7 @@ miTranslateRegion(pReg, x, y) { register BoxPtr pboxout; - for (pboxout = pbox = REGION_BOXPTR(pReg); nbox--; pbox++) + for (pboxout = pbox = RegionBoxptr(pReg); nbox--; pbox++) { pboxout->x1 = x1 = pbox->x1 + x; pboxout->y1 = y1 = pbox->y1 + y; @@ -2191,7 +2191,7 @@ miTranslateRegion(pReg, x, y) { if (pReg->data->numRects == 1) { - pReg->extents = *REGION_BOXPTR(pReg); + pReg->extents = *RegionBoxptr(pReg); xfreeData(pReg); pReg->data = (RegDataPtr)NULL; } @@ -2220,7 +2220,7 @@ miRegionDataCopy( } if (!dst->data || (dst->data->size < src->data->numRects)) { - size_t newSize = REGION_SZOF(src->data->numRects); + size_t newSize = RegionSizeof(src->data->numRects); xfreeData(dst); dst->data = newSize > 0 ? xalloc(newSize) : NULL; if (!dst->data) @@ -2254,7 +2254,7 @@ miPointInRegion(pReg, x, y, box) int numRects; good(pReg); - numRects = REGION_NUM_RECTS(pReg); + numRects = RegionNumRects(pReg); if (!numRects || !INBOX(&pReg->extents, x, y)) return(FALSE); if (numRects == 1) @@ -2262,7 +2262,7 @@ miPointInRegion(pReg, x, y, box) *box = pReg->extents; return(TRUE); } - for (pbox = REGION_BOXPTR(pReg), pboxEnd = pbox + numRects; + for (pbox = RegionBoxptr(pReg), pboxEnd = pbox + numRects; pbox != pboxEnd; pbox++) { @@ -2283,14 +2283,14 @@ miRegionNotEmpty(pReg) RegionPtr pReg; { good(pReg); - return(!REGION_NIL(pReg)); + return(!RegionNil(pReg)); } Bool miRegionBroken(RegionPtr pReg) { good(pReg); - return (REGION_NAR(pReg)); + return (RegionNar(pReg)); } void @@ -2497,7 +2497,7 @@ miClipSpans( if ((! fSorted) && (nspans > 1)) QuickSortSpans(ppt, pwidth, nspans); - pboxBandStart = REGION_BOXPTR(prgnDst); + pboxBandStart = RegionBoxptr(prgnDst); pboxLast = pboxBandStart + numRects; NextBand(); @@ -2558,8 +2558,8 @@ miFindMaxBand(prgn) short yThisBand; good(prgn); - nbox = REGION_NUM_RECTS(prgn); - pbox = REGION_RECTS(prgn); + nbox = RegionNumRects(prgn); + pbox = RegionRects(prgn); while(nbox > 0) { diff --git a/nx-X11/programs/Xserver/mi/misprite.c b/nx-X11/programs/Xserver/mi/misprite.c index a5e3f9ccf..c854984fc 100644 --- a/nx-X11/programs/Xserver/mi/misprite.c +++ b/nx-X11/programs/Xserver/mi/misprite.c @@ -136,7 +136,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; if (pScreenPriv->isUp && - RECT_IN_REGION (pScreen, pRegion, &pScreenPriv->saved) != rgnOUT) + RegionContainsRect(pRegion, &pScreenPriv->saved) != rgnOUT) { SPRITE_DEBUG(("Damage remove\n")); miSpriteRemoveCursor (pScreen); @@ -389,7 +389,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) * Damage will take care of destination check */ if (pScreenPriv->isUp && - RECT_IN_REGION (pScreen, prgnSrc, &pScreenPriv->saved) != rgnOUT) + RegionContainsRect(prgnSrc, &pScreenPriv->saved) != rgnOUT) { SPRITE_DEBUG (("CopyWindow remove\n")); miSpriteRemoveCursor (pScreen); @@ -589,7 +589,7 @@ miSpriteSaveDoomedAreas (pWin, pObscured, dx, dy) cursorBox.x2 += dx; cursorBox.y2 += dy; } - if (RECT_IN_REGION( pScreen, pObscured, &cursorBox) != rgnOUT) + if (RegionContainsRect(pObscured, &cursorBox) != rgnOUT) miSpriteRemoveCursor (pScreen); } diff --git a/nx-X11/programs/Xserver/mi/mivaltree.c b/nx-X11/programs/Xserver/mi/mivaltree.c index b9a42472f..73028a074 100644 --- a/nx-X11/programs/Xserver/mi/mivaltree.c +++ b/nx-X11/programs/Xserver/mi/mivaltree.c @@ -123,8 +123,8 @@ miShapedWindowIn (pScreen, universe, bounding, rect, x, y) Bool someIn, someOut; register int t, x1, y1, x2, y2; - nbox = REGION_NUM_RECTS (bounding); - boundBox = REGION_RECTS (bounding); + nbox = RegionNumRects (bounding); + boundBox = RegionRects (bounding); someIn = someOut = FALSE; x1 = rect->x1; y1 = rect->y1; @@ -148,7 +148,7 @@ miShapedWindowIn (pScreen, universe, bounding, rect, x, y) box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - switch (RECT_IN_REGION(pScreen, universe, &box)) + switch (RegionContainsRect(universe, &box)) { case rgnIN: if (someOut) @@ -241,7 +241,7 @@ miComputeClips ( borderSize.y2 = dy; oldVis = pParent->visibility; - switch (RECT_IN_REGION( pScreen, universe, &borderSize)) + switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; @@ -287,7 +287,7 @@ miComputeClips ( { if (miSetRedirectBorderClipProc) (*miSetRedirectBorderClipProc) (pParent, universe); - REGION_COPY(pScreen, universe, &pParent->borderSize); + RegionCopy(universe, &pParent->borderSize); } #endif @@ -315,9 +315,9 @@ miComputeClips ( { if (pChild->visibility != VisibilityFullyObscured) { - REGION_TRANSLATE( pScreen, &pChild->borderClip, + RegionTranslate(&pChild->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pChild->clipList, + RegionTranslate(&pChild->clipList, dx, dy); pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) @@ -326,16 +326,16 @@ miComputeClips ( } if (pChild->valdata) { - REGION_NULL(pScreen, + RegionNull( &pChild->valdata->after.borderExposed); if (HasParentRelativeBorder(pChild)) { - REGION_SUBTRACT(pScreen, + RegionSubtract( &pChild->valdata->after.borderExposed, &pChild->borderClip, &pChild->winSize); } - REGION_NULL(pScreen, &pChild->valdata->after.exposed); + RegionNull(&pChild->valdata->after.exposed); } if (pChild->firstChild) { @@ -364,20 +364,20 @@ miComputeClips ( * We translate the old clipList because that will be exposed or copied * if gravity is right. */ - REGION_TRANSLATE( pScreen, &pParent->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pParent->clipList, dx, dy); + RegionTranslate(&pParent->borderClip, dx, dy); + RegionTranslate(&pParent->clipList, dx, dy); } break; case VTBroken: - REGION_EMPTY (pScreen, &pParent->borderClip); - REGION_EMPTY (pScreen, &pParent->clipList); + RegionEmpty(&pParent->borderClip); + RegionEmpty(&pParent->clipList); break; } borderVisible = pParent->valdata->before.borderVisible; resized = pParent->valdata->before.resized; - REGION_NULL(pScreen, &pParent->valdata->after.borderExposed); - REGION_NULL(pScreen, &pParent->valdata->after.exposed); + RegionNull(&pParent->valdata->after.borderExposed); + RegionNull(&pParent->valdata->after.exposed); /* * Since the borderClip must not be clipped by the children, we do @@ -397,22 +397,22 @@ miComputeClips ( * of the border will be saved by DIX in borderVisible -- * use that region and destroy it */ - REGION_SUBTRACT( pScreen, exposed, universe, borderVisible); - REGION_DESTROY( pScreen, borderVisible); + RegionSubtract(exposed, universe, borderVisible); + RegionDestroy(borderVisible); } else { - REGION_SUBTRACT( pScreen, exposed, universe, &pParent->borderClip); + RegionSubtract(exposed, universe, &pParent->borderClip); } if (HasParentRelativeBorder(pParent) && (dx || dy)) - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, + RegionSubtract(&pParent->valdata->after.borderExposed, universe, &pParent->winSize); else - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, + RegionSubtract(&pParent->valdata->after.borderExposed, exposed, &pParent->winSize); - REGION_COPY( pScreen, &pParent->borderClip, universe); + RegionCopy(&pParent->borderClip, universe); /* * To get the right clipList for the parent, and to make doubly sure @@ -420,15 +420,15 @@ miComputeClips ( * border from the universe before proceeding. */ - REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize); + RegionIntersect(universe, universe, &pParent->winSize); } else - REGION_COPY( pScreen, &pParent->borderClip, universe); + RegionCopy(&pParent->borderClip, universe); if ((pChild = pParent->firstChild) && pParent->mapped) { - REGION_NULL(pScreen, &childUniverse); - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUniverse); + RegionNull(&childUnion); if ((pChild->drawable.y < pParent->lastChild->drawable.y) || ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) @@ -436,7 +436,7 @@ miComputeClips ( for (; pChild; pChild = pChild->nextSib) { if (pChild->viewable) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); + RegionAppend(&childUnion, &pChild->borderSize); } } else @@ -444,10 +444,10 @@ miComputeClips ( for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib) { if (pChild->viewable) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); + RegionAppend(&childUnion, &pChild->borderSize); } } - REGION_VALIDATE( pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); for (pChild = pParent->firstChild; pChild; @@ -464,7 +464,7 @@ miComputeClips ( * Figure out the new universe from the child's * perspective and recurse. */ - REGION_INTERSECT( pScreen, &childUniverse, + RegionIntersect(&childUniverse, universe, &pChild->borderSize); miComputeClips (pChild, pScreen, &childUniverse, kind, @@ -476,14 +476,14 @@ miComputeClips ( * other sibling. */ if (overlap) - REGION_SUBTRACT( pScreen, universe, universe, + RegionSubtract(universe, universe, &pChild->borderSize); } } if (!overlap) - REGION_SUBTRACT( pScreen, universe, universe, &childUnion); - REGION_UNINIT( pScreen, &childUnion); - REGION_UNINIT( pScreen, &childUniverse); + RegionSubtract(universe, universe, &childUnion); + RegionUninit(&childUnion); + RegionUninit(&childUniverse); } /* if any children */ /* @@ -496,12 +496,12 @@ miComputeClips ( if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { - REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe); + RegionCopy(&pParent->valdata->after.exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed, + RegionSubtract(&pParent->valdata->after.exposed, universe, &pParent->clipList); } @@ -513,7 +513,7 @@ miComputeClips ( */ if (pParent->backStorage && !resized) { - REGION_SUBTRACT( pScreen, exposed, &pParent->clipList, universe); + RegionSubtract(exposed, &pParent->clipList, universe); (* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy); } @@ -527,7 +527,7 @@ miComputeClips ( } #ifdef NOTDEF - REGION_COPY( pScreen, &pParent->clipList, universe); + RegionCopy(&pParent->clipList, universe); #endif pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -622,8 +622,8 @@ miValidateTree (pParent, pChild, kind) if (pChild == NullWindow) pChild = pParent->firstChild; - REGION_NULL(pScreen, &childClip); - REGION_NULL(pScreen, &exposed); + RegionNull(&childClip); + RegionNull(&exposed); /* * compute the area of the parent window occupied @@ -631,10 +631,10 @@ miValidateTree (pParent, pChild, kind) * is the area which can be divied up among the marked * children in their new configuration. */ - REGION_NULL(pScreen, &totalClip); + RegionNull(&totalClip); viewvals = 0; - if (REGION_BROKEN (pScreen, &pParent->clipList) && - !REGION_BROKEN (pScreen, &pParent->borderClip)) + if (RegionBroken(&pParent->clipList) && + !RegionBroken(&pParent->borderClip)) { kind = VTBroken; /* @@ -642,19 +642,19 @@ miValidateTree (pParent, pChild, kind) * assume everything is busted. */ forward = TRUE; - REGION_COPY (pScreen, &totalClip, &pParent->borderClip); - REGION_INTERSECT (pScreen, &totalClip, &totalClip, &pParent->winSize); + RegionCopy(&totalClip, &pParent->borderClip); + RegionIntersect(&totalClip, &totalClip, &pParent->winSize); for (pWin = pParent->firstChild; pWin != pChild; pWin = pWin->nextSib) { if (pWin->viewable) - REGION_SUBTRACT (pScreen, &totalClip, &totalClip, &pWin->borderSize); + RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } for (pWin = pChild; pWin; pWin = pWin->nextSib) if (pWin->valdata && pWin->viewable) viewvals++; - REGION_EMPTY (pScreen, &pParent->clipList); + RegionEmpty(&pParent->clipList); } else { @@ -672,7 +672,7 @@ miValidateTree (pParent, pChild, kind) if (pWin->redirectDraw && miGetRedirectBorderClipProc) pBorderClip = (*miGetRedirectBorderClipProc)(pWin); #endif - REGION_APPEND( pScreen, &totalClip, pBorderClip ); + RegionAppend(&totalClip, pBorderClip ); if (pWin->viewable) viewvals++; } @@ -691,7 +691,7 @@ miValidateTree (pParent, pChild, kind) if (pWin->redirectDraw && miGetRedirectBorderClipProc) pBorderClip = (*miGetRedirectBorderClipProc)(pWin); #endif - REGION_APPEND( pScreen, &totalClip, pBorderClip ); + RegionAppend(&totalClip, pBorderClip ); if (pWin->viewable) viewvals++; } @@ -700,7 +700,7 @@ miValidateTree (pParent, pChild, kind) pWin = pWin->prevSib; } } - REGION_VALIDATE( pScreen, &totalClip, &overlap); + RegionValidate(&totalClip, &overlap); } /* @@ -713,7 +713,7 @@ miValidateTree (pParent, pChild, kind) overlap = TRUE; if (kind != VTStack) { - REGION_UNION( pScreen, &totalClip, &totalClip, &pParent->clipList); + RegionUnion(&totalClip, &totalClip, &pParent->clipList); if (viewvals > 1) { /* @@ -723,12 +723,12 @@ miValidateTree (pParent, pChild, kind) * lower than the cost of multiple Subtracts in the * loop below. */ - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUnion); if (forward) { for (pWin = pChild; pWin; pWin = pWin->nextSib) if (pWin->valdata && pWin->viewable) - REGION_APPEND( pScreen, &childUnion, + RegionAppend(&childUnion, &pWin->borderSize); } else @@ -737,16 +737,16 @@ miValidateTree (pParent, pChild, kind) while (1) { if (pWin->valdata && pWin->viewable) - REGION_APPEND( pScreen, &childUnion, + RegionAppend(&childUnion, &pWin->borderSize); if (pWin == pChild) break; pWin = pWin->prevSib; } } - REGION_VALIDATE(pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); if (overlap) - REGION_UNINIT(pScreen, &childUnion); + RegionUninit(&childUnion); } } @@ -756,13 +756,13 @@ miValidateTree (pParent, pChild, kind) { if (pWin->viewable) { if (pWin->valdata) { - REGION_INTERSECT( pScreen, &childClip, + RegionIntersect(&childClip, &totalClip, &pWin->borderSize); miComputeClips (pWin, pScreen, &childClip, kind, &exposed); if (overlap) { - REGION_SUBTRACT( pScreen, &totalClip, + RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } @@ -771,24 +771,24 @@ miValidateTree (pParent, pChild, kind) } } else { if (pWin->valdata) { - REGION_EMPTY( pScreen, &pWin->clipList); + RegionEmpty(&pWin->clipList); if (pScreen->ClipNotify) (* pScreen->ClipNotify) (pWin, 0, 0); - REGION_EMPTY( pScreen, &pWin->borderClip); + RegionEmpty(&pWin->borderClip); pWin->valdata = (ValidatePtr)NULL; } } } - REGION_UNINIT( pScreen, &childClip); + RegionUninit(&childClip); if (!overlap) { - REGION_SUBTRACT(pScreen, &totalClip, &totalClip, &childUnion); - REGION_UNINIT(pScreen, &childUnion); + RegionSubtract(&totalClip, &totalClip, &childUnion); + RegionUninit(&childUnion); } - REGION_NULL(pScreen, &pParent->valdata->after.exposed); - REGION_NULL(pScreen, &pParent->valdata->after.borderExposed); + RegionNull(&pParent->valdata->after.exposed); + RegionNull(&pParent->valdata->after.borderExposed); /* * each case below is responsible for updating the @@ -804,22 +804,22 @@ miValidateTree (pParent, pChild, kind) * exposures and obscures as per miComputeClips and reset the parent's * clipList. */ - REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed, + RegionSubtract(&pParent->valdata->after.exposed, &totalClip, &pParent->clipList); /* fall through */ case VTMap: if (pParent->backStorage) { - REGION_SUBTRACT( pScreen, &exposed, &pParent->clipList, &totalClip); + RegionSubtract(&exposed, &pParent->clipList, &totalClip); (* pScreen->SaveDoomedAreas)(pParent, &exposed, 0, 0); } - REGION_COPY( pScreen, &pParent->clipList, &totalClip); + RegionCopy(&pParent->clipList, &totalClip); pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; break; } - REGION_UNINIT( pScreen, &totalClip); - REGION_UNINIT( pScreen, &exposed); + RegionUninit(&totalClip); + RegionUninit(&exposed); if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pParent, 0, 0); return (1); diff --git a/nx-X11/programs/Xserver/mi/miwindow.c b/nx-X11/programs/Xserver/mi/miwindow.c index 44b7ada60..198f765dd 100644 --- a/nx-X11/programs/Xserver/mi/miwindow.c +++ b/nx-X11/programs/Xserver/mi/miwindow.c @@ -114,7 +114,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) { /* @@ -128,14 +128,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); } /* @@ -181,7 +181,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 @@ -200,10 +200,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); } @@ -214,12 +214,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); } /* @@ -230,8 +230,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) @@ -283,11 +283,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; } @@ -386,9 +386,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) @@ -408,17 +408,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; @@ -464,13 +464,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) @@ -517,8 +517,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; @@ -555,7 +555,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); } @@ -590,14 +590,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; } @@ -654,8 +654,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 @@ -668,8 +668,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 @@ -684,8 +684,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 @@ -700,16 +700,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); } } @@ -736,9 +736,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, @@ -766,7 +766,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); @@ -810,16 +810,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 @@ -830,9 +830,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 @@ -841,17 +841,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); } } @@ -875,14 +875,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 */ @@ -898,7 +898,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 @@ -908,7 +908,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); } @@ -919,21 +919,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; @@ -942,8 +942,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); @@ -960,7 +960,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 (); @@ -1004,8 +1004,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; } @@ -1022,8 +1022,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, @@ -1049,7 +1049,7 @@ miSetShape(pWin) (pWin, 0, 0, pOldClip, pWin->drawable.x, pWin->drawable.y); if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); + RegionDestroy(pOldClip); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -1058,8 +1058,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) @@ -1120,8 +1120,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; } @@ -1158,10 +1158,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); } } @@ -1176,7 +1176,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/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, ®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); @@ -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 diff --git a/nx-X11/programs/Xserver/render/mipict.c b/nx-X11/programs/Xserver/render/mipict.c index cf9c27f01..ae7cf5a6d 100644 --- a/nx-X11/programs/Xserver/render/mipict.c +++ b/nx-X11/programs/Xserver/render/mipict.c @@ -48,7 +48,7 @@ void miDestroyPicture (PicturePtr pPicture) { if (pPicture->freeCompClip) - REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->pCompositeClip); + RegionDestroy(pPicture->pCompositeClip); } void @@ -65,7 +65,7 @@ miDestroyPictureClip (PicturePtr pPicture) * we know we'll never have a list of rectangles, since ChangeClip * immediately turns them into a region */ - REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->clientClip); + RegionDestroy(pPicture->clientClip); break; } pPicture->clientClip = NULL; @@ -86,7 +86,7 @@ miChangePictureClip (PicturePtr pPicture, switch (type) { case CT_PIXMAP: /* convert the pixmap to a region */ - clientClip = (void *) BITMAP_TO_REGION(pScreen, (PixmapPtr) value); + clientClip = (void *) BitmapToRegion(pScreen, (PixmapPtr) value); if (!clientClip) return BadAlloc; clientClipType = CT_REGION; @@ -101,7 +101,7 @@ miChangePictureClip (PicturePtr pPicture, clientClipType = CT_NONE; break; default: - clientClip = (void *) RECTS_TO_REGION(pScreen, n, + clientClip = (void *) RegionFromRects(n, (xRectangle *) value, type); if (!clientClip) @@ -162,7 +162,7 @@ miValidatePicture (PicturePtr pPicture, if (pPicture->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pPicture->pCompositeClip); + RegionDestroy(pPicture->pCompositeClip); pPicture->pCompositeClip = pregWin; pPicture->freeCompClip = freeTmpClip; } @@ -177,30 +177,30 @@ miValidatePicture (PicturePtr pPicture, * clip. if neither is real, create a new region. */ - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, pDrawable->y + pPicture->clipOrigin.y); if (freeCompClip) { - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pregWin, pPicture->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pPicture->clientClip); + RegionIntersect(pregWin, pregWin, pPicture->clientClip); pPicture->pCompositeClip = pregWin; } else { - pPicture->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + pPicture->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pPicture->pCompositeClip, pregWin, pPicture->clientClip); } pPicture->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, -(pDrawable->x + pPicture->clipOrigin.x), -(pDrawable->y + pPicture->clipOrigin.y)); } @@ -218,31 +218,31 @@ miValidatePicture (PicturePtr pPicture, if (pPicture->freeCompClip) { - REGION_RESET(pScreen, pPicture->pCompositeClip, &pixbounds); + RegionReset(pPicture->pCompositeClip, &pixbounds); } else { pPicture->freeCompClip = TRUE; - pPicture->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1); + pPicture->pCompositeClip = RegionCreate(&pixbounds, 1); } if (pPicture->clientClipType == CT_REGION) { if(pDrawable->x || pDrawable->y) { - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, pDrawable->y + pPicture->clipOrigin.y); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pPicture->pCompositeClip, pPicture->clientClip); - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, -(pDrawable->x + pPicture->clipOrigin.x), -(pDrawable->y + pPicture->clipOrigin.y)); } else { - REGION_TRANSLATE(pScreen, pPicture->pCompositeClip, + RegionTranslate(pPicture->pCompositeClip, -pPicture->clipOrigin.x, -pPicture->clipOrigin.y); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pPicture->pCompositeClip, pPicture->clientClip); - REGION_TRANSLATE(pScreen, pPicture->pCompositeClip, + RegionTranslate(pPicture->pCompositeClip, pPicture->clipOrigin.x, pPicture->clipOrigin.y); } } @@ -274,11 +274,11 @@ miClipPictureReg (RegionPtr pRegion, int dx, int dy) { - if (REGION_NUM_RECTS(pRegion) == 1 && - REGION_NUM_RECTS(pClip) == 1) + if (RegionNumRects(pRegion) == 1 && + RegionNumRects(pClip) == 1) { - BoxPtr pRbox = REGION_RECTS(pRegion); - BoxPtr pCbox = REGION_RECTS(pClip); + BoxPtr pRbox = RegionRects(pRegion); + BoxPtr pCbox = RegionRects(pClip); int v; if (pRbox->x1 < (v = pCbox->x1 + dx)) @@ -292,21 +292,21 @@ miClipPictureReg (RegionPtr pRegion, if (pRbox->x1 >= pRbox->x2 || pRbox->y1 >= pRbox->y2) { - REGION_EMPTY(pScreen, pRegion); + RegionEmpty(pRegion); } } - else if (!REGION_NOTEMPTY (pScreen, pClip)) + else if (!RegionNotEmpty(pClip)) return FALSE; else { if (dx || dy) - REGION_TRANSLATE(pScreen, pRegion, -dx, -dy); - if (!REGION_INTERSECT (pScreen, pRegion, pRegion, pClip)) + RegionTranslate(pRegion, -dx, -dy); + if (!RegionIntersect(pRegion, pRegion, pClip)) return FALSE; if (dx || dy) - REGION_TRANSLATE(pScreen, pRegion, dx, dy); + RegionTranslate(pRegion, dx, dy); } - return REGION_NOTEMPTY(pScreen, pRegion); + return RegionNotEmpty(pRegion); } static __inline Bool @@ -322,13 +322,13 @@ miClipPictureSrc (RegionPtr pRegion, { if (pPicture->clientClipType != CT_NONE) { - REGION_TRANSLATE(pScreen, pRegion, + RegionTranslate(pRegion, dx - pPicture->clipOrigin.x, dy - pPicture->clipOrigin.y); - if (!REGION_INTERSECT (pScreen, pRegion, pRegion, + if (!RegionIntersect(pRegion, pRegion, (RegionPtr) pPicture->clientClip)) return FALSE; - REGION_TRANSLATE(pScreen, pRegion, + RegionTranslate(pRegion, - (dx - pPicture->clipOrigin.x), - (dy - pPicture->clipOrigin.y)); } @@ -432,13 +432,13 @@ miComputeCompositeRegion (RegionPtr pRegion, if (pRegion->extents.x1 >= pRegion->extents.x2 || pRegion->extents.y1 >= pRegion->extents.y2) { - REGION_EMPTY (pDst->pDrawable->pScreen, pRegion); + RegionEmpty(pRegion); return FALSE; } /* clip against dst */ if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0)) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } if (pDst->alphaMap) @@ -447,14 +447,14 @@ miComputeCompositeRegion (RegionPtr pRegion, -pDst->alphaOrigin.x, -pDst->alphaOrigin.y)) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } } /* clip against src */ if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc)) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } if (pSrc->alphaMap) @@ -463,7 +463,7 @@ miComputeCompositeRegion (RegionPtr pRegion, xDst - (xSrc + pSrc->alphaOrigin.x), yDst - (ySrc + pSrc->alphaOrigin.y))) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } } @@ -472,7 +472,7 @@ miComputeCompositeRegion (RegionPtr pRegion, { if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask)) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } if (pMask->alphaMap) @@ -481,7 +481,7 @@ miComputeCompositeRegion (RegionPtr pRegion, xDst - (xMask + pMask->alphaOrigin.x), yDst - (yMask + pMask->alphaOrigin.y))) { - REGION_UNINIT (pScreen, pRegion); + RegionUninit(pRegion); return FALSE; } } diff --git a/nx-X11/programs/Xserver/render/mirect.c b/nx-X11/programs/Xserver/render/mirect.c index c4aeb9aba..3ce7a7f4c 100644 --- a/nx-X11/programs/Xserver/render/mirect.c +++ b/nx-X11/programs/Xserver/render/mirect.c @@ -65,8 +65,8 @@ miColorRects (PicturePtr pDst, tmpval[4] = pDst->clipOrigin.y - yoff; mask |= GCClipXOrigin|GCClipYOrigin; - pClip = REGION_CREATE (pScreen, NULL, 1); - REGION_COPY (pScreen, pClip, + pClip = RegionCreate(NULL, 1); + RegionCopy(pClip, (RegionPtr) pClipPict->clientClip); (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0); } diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 754d468bb..5d8496610 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1390,7 +1390,7 @@ SetPictureClipRects (PicturePtr pPicture, RegionPtr clientClip; int result; - clientClip = RECTS_TO_REGION(pScreen, + clientClip = RegionFromRects( nRect, rects, CT_UNSORTED); if (!clientClip) return BadAlloc; @@ -1421,14 +1421,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; } } @@ -1538,9 +1538,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/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index cb9e0de9a..0b1865cf0 100755 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -43,20 +43,20 @@ RegionResFree (void * 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; @@ -84,7 +84,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, (void *) pRegion)) @@ -127,7 +127,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; @@ -229,7 +229,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; @@ -278,7 +278,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; @@ -353,15 +353,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(client->noClientException); } @@ -387,7 +387,7 @@ ProcXFixesCopyRegion (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); - if (!REGION_COPY(pScreen, pDestination, pSource)) + if (!RegionCopy(pDestination, pSource)) return BadAlloc; return(client->noClientException); @@ -420,15 +420,15 @@ ProcXFixesCombineRegion (ClientPtr client) switch (stuff->xfixesReqType) { case X_XFixesUnionRegion: - if (!REGION_UNION (0, pDestination, pSource1, pSource2)) + if (!RegionUnion(pDestination, pSource1, pSource2)) ret = BadAlloc; break; case X_XFixesIntersectRegion: - if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2)) + if (!RegionIntersect(pDestination, pSource1, pSource2)) ret = BadAlloc; break; case X_XFixesSubtractRegion: - if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2)) + if (!RegionSubtract(pDestination, pSource1, pSource2)) ret = BadAlloc; break; } @@ -477,7 +477,7 @@ ProcXFixesInvertRegion (ClientPtr client) else bounds.y2 = stuff->y + stuff->height; - if (!REGION_INVERSE(0, pDestination, pSource, &bounds)) + if (!RegionInverse(pDestination, pSource, &bounds)) ret = BadAlloc; if (ret == Success) @@ -511,7 +511,7 @@ ProcXFixesTranslateRegion (ClientPtr client) REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); - REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy); + RegionTranslate(pRegion, stuff->dx, stuff->dy); return (client->noClientException); } @@ -539,7 +539,7 @@ ProcXFixesRegionExtents (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); - REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource)); + RegionReset(pDestination, RegionExtents(pSource)); return (client->noClientException); } @@ -571,9 +571,9 @@ ProcXFixesFetchRegion (ClientPtr client) REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); VERIFY_REGION(pRegion, stuff->region, client, SecurityReadAccess); - pExtent = REGION_EXTENTS (0, pRegion); - pBox = REGION_RECTS (pRegion); - nBox = REGION_NUM_RECTS (pRegion); + pExtent = RegionExtents(pRegion); + pBox = RegionRects (pRegion); + nBox = RegionNumRects (pRegion); reply = xalloc (sizeof (xXFixesFetchRegionReply) + nBox * sizeof (xRectangle)); @@ -716,7 +716,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 { @@ -739,7 +739,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) pDestRegion = &pRegion; /* a NULL region pointer */ } if (*pDestRegion) - REGION_DESTROY(pScreen, *pDestRegion); + RegionDestroy(*pDestRegion); *pDestRegion = pRegion; (*pScreen->SetShape) (pWin); SendShapeNotify (pWin, stuff->destKind); @@ -818,8 +818,8 @@ ProcXFixesExpandRegion (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); - nBoxes = REGION_NUM_RECTS(pSource); - pSrc = REGION_RECTS(pSource); + nBoxes = RegionNumRects(pSource); + pSrc = RegionRects(pSource); if (nBoxes) { pTmp = xalloc (nBoxes * sizeof (BoxRec)); @@ -832,12 +832,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); } } if (ret == Success) diff --git a/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c b/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c index 33fa49ae7..7f096683b 100644 --- a/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c +++ b/nx-X11/programs/Xserver/xkb/ddxFakeMtn.c @@ -64,12 +64,12 @@ ScreenPtr pScreen, oldScreen; BoxRec box; int i; - if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], + if(!RegionContainsPoint(&XineramaScreenRegions[pScreen->myNum], oldX, oldY, &box)) { FOR_NSCREENS(i) { if(i == pScreen->myNum) continue; - if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], + if(RegionContainsPoint(&XineramaScreenRegions[i], oldX, oldY, &box)) { pScreen = screenInfo.screens[i]; break; @@ -85,12 +85,12 @@ ScreenPtr pScreen, oldScreen; oldY= y; else oldY+= y; - if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum], + if(!RegionContainsPoint(&XineramaScreenRegions[pScreen->myNum], oldX, oldY, &box)) { FOR_NSCREENS(i) { if(i == pScreen->myNum) continue; - if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], + if(RegionContainsPoint(&XineramaScreenRegions[i], oldX, oldY, &box)) { pScreen = screenInfo.screens[i]; break; -- cgit v1.2.3 From be824bc8d78260d4c7ac64f298cb8b528564a4fb Mon Sep 17 00:00:00 2001 From: Mihai Moldovan <ïonic@ionic.de> Date: Sat, 9 Apr 2016 19:40:24 +0000 Subject: misc nx-X11/{programs/Xserver/composite,include/extensions}: update to Composite 0.4 - with changes where neccessary and rough edges. --- nx-X11/include/extensions/composite.h | 8 +- nx-X11/include/extensions/compositeproto.h | 37 + nx-X11/programs/Xserver/composite/compalloc.c | 295 ++++++-- nx-X11/programs/Xserver/composite/compext.c | 741 ++++++++++++++++++++- nx-X11/programs/Xserver/composite/compinit.c | 466 ++++++++----- nx-X11/programs/Xserver/composite/compint.h | 156 ++++- nx-X11/programs/Xserver/composite/compositeext.h | 44 ++ nx-X11/programs/Xserver/composite/compoverlay.c | 178 +++++ nx-X11/programs/Xserver/composite/compwindow.c | 316 ++++++--- .../programs/Xserver/hw/nxagent/NXcompositeext.h | 8 +- 10 files changed, 1857 insertions(+), 392 deletions(-) create mode 100644 nx-X11/programs/Xserver/composite/compositeext.h create mode 100644 nx-X11/programs/Xserver/composite/compoverlay.c (limited to 'nx-X11/programs/Xserver/composite/compwindow.c') diff --git a/nx-X11/include/extensions/composite.h b/nx-X11/include/extensions/composite.h index d1901750a..fd6375199 100644 --- a/nx-X11/include/extensions/composite.h +++ b/nx-X11/include/extensions/composite.h @@ -29,7 +29,7 @@ #define COMPOSITE_NAME "Composite" #define COMPOSITE_MAJOR 0 -#define COMPOSITE_MINOR 2 +#define COMPOSITE_MINOR 4 #define CompositeRedirectAutomatic 0 #define CompositeRedirectManual 1 @@ -41,7 +41,11 @@ #define X_CompositeUnredirectSubwindows 4 #define X_CompositeCreateRegionFromBorderClip 5 #define X_CompositeNameWindowPixmap 6 +#define X_CompositeGetOverlayWindow 7 +#define X_CompositeReleaseOverlayWindow 8 -#define CompositeNumberRequests (X_CompositeNameWindowPixmap + 1) +#define CompositeNumberRequests (X_CompositeReleaseOverlayWindow + 1) + +#define CompositeNumberEvents 0 #endif /* _COMPOSITE_H_ */ diff --git a/nx-X11/include/extensions/compositeproto.h b/nx-X11/include/extensions/compositeproto.h index a851c727e..51103f389 100644 --- a/nx-X11/include/extensions/compositeproto.h +++ b/nx-X11/include/extensions/compositeproto.h @@ -30,6 +30,7 @@ #define Window CARD32 #define Region CARD32 +#define Pixmap CARD32 /* * requests and replies @@ -129,7 +130,43 @@ typedef struct { #define sz_xCompositeNameWindowPixmapReq 12 +/* Version 0.3 additions */ + +typedef struct { + CARD8 reqType; + CARD8 compositeReqType; + CARD16 length B16; + Window window B32; +} xCompositeGetOverlayWindowReq; + +#define sz_xCompositeGetOverlayWindowReq sizeof(xCompositeGetOverlayWindowReq) + +typedef struct { + BYTE type; /* X_Reply */ + BYTE pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + Window overlayWin B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xCompositeGetOverlayWindowReply; + +#define sz_xCompositeGetOverlayWindowReply sizeof(xCompositeGetOverlayWindowReply) + +typedef struct { + CARD8 reqType; + CARD8 compositeReqType; + CARD16 length B16; + Window window B32; +} xCompositeReleaseOverlayWindowReq; + +#define sz_xCompositeReleaseOverlayWindowReq sizeof(xCompositeReleaseOverlayWindowReq) + #undef Window #undef Region +#undef Pixmap #endif /* _COMPOSITEPROTO_H_ */ diff --git a/nx-X11/programs/Xserver/composite/compalloc.c b/nx-X11/programs/Xserver/composite/compalloc.c index f66a90989..9279a5248 100644 --- a/nx-X11/programs/Xserver/composite/compalloc.c +++ b/nx-X11/programs/Xserver/composite/compalloc.c @@ -28,36 +28,110 @@ #include "compint.h" -void -compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) +static void +compScreenUpdate(ScreenPtr pScreen) { - WindowPtr pWin = (WindowPtr) closure; - ScreenPtr pScreen = pWin->drawable.pScreen; - CompScreenPtr cs = GetCompScreen (pScreen); - CompWindowPtr cw = GetCompWindow (pWin); + compCheckTree(pScreen); + compPaintChildrenToWindow(pScreen, WindowTable[pScreen->myNum]); +} + +static void +compBlockHandler(int i, void *blockData, void *pTimeout, void *pReadmask) +{ + ScreenPtr pScreen = screenInfo.screens[i]; + CompScreenPtr cs = GetCompScreen(pScreen); + pScreen->BlockHandler = cs->BlockHandler; + compScreenUpdate(pScreen); + (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + + /* Next damage will restore the block handler */ + cs->BlockHandler = NULL; +} + +static void +compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure) +{ + WindowPtr pWin = (WindowPtr) closure; + ScreenPtr pScreen = pWin->drawable.pScreen; + CompScreenPtr cs = GetCompScreen(pScreen); + CompWindowPtr cw = GetCompWindow(pWin); + + if (!cs->BlockHandler) { + cs->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = compBlockHandler; + } cs->damaged = TRUE; cw->damaged = TRUE; + + /* Mark the ancestors */ + /* We can't do this, Dave. No damagedDescendants support. */ + /* + pWin = pWin->parent; + while (pWin) { + if (pWin->damagedDescendants) + break; + pWin->damagedDescendants = TRUE; + pWin = pWin->parent; + } + */ } static void -compDestroyDamage (DamagePtr pDamage, void *closure) +compDestroyDamage(DamagePtr pDamage, void *closure) { - WindowPtr pWin = (WindowPtr) closure; - CompWindowPtr cw = GetCompWindow (pWin); + WindowPtr pWin = (WindowPtr) closure; + CompWindowPtr cw = GetCompWindow(pWin); cw->damage = 0; } +static Bool +compMarkWindows(WindowPtr pWin, WindowPtr *ppLayerWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + WindowPtr pLayerWin = pWin; + + if (!pWin->viewable) + return FALSE; + + (*pScreen->MarkOverlappedWindows) (pWin, pWin, &pLayerWin); + (*pScreen->MarkWindow) (pLayerWin->parent); + + *ppLayerWin = pLayerWin; + + return TRUE; +} + +static void +compHandleMarkedWindows(WindowPtr pWin, WindowPtr pLayerWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + + (*pScreen->ValidateTree) (pLayerWin->parent, pLayerWin, VTOther); + (*pScreen->HandleExposures) (pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree) (pLayerWin->parent, pLayerWin, VTOther); +} + /* * Redirect one window for one client */ int -compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) +compRedirectWindow(ClientPtr pClient, WindowPtr pWin, int update) { - CompWindowPtr cw = GetCompWindow (pWin); - CompClientWindowPtr ccw; - Bool wasMapped = pWin->mapped; + CompWindowPtr cw = GetCompWindow(pWin); + CompClientWindowPtr ccw; + CompScreenPtr cs = GetCompScreen(pWin->drawable.pScreen); + WindowPtr pLayerWin; + Bool anyMarked = FALSE; + + if (pWin == cs->pOverlayWin) { + return Success; + } + + if (!pWin->parent) + return BadMatch; /* * Only one Manual update is allowed @@ -100,8 +174,8 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) xfree (cw); return BadAlloc; } - if (wasMapped) - UnmapWindow (pWin, FALSE); + + anyMarked = compMarkWindows(pWin, &pLayerWin); RegionNull(&cw->borderClip); cw->update = CompositeRedirectAutomatic; @@ -110,7 +184,8 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) cw->oldy = COMP_ORIGIN_INVALID; cw->damageRegistered = FALSE; cw->damaged = FALSE; - pWin->devPrivates[CompWindowPrivateIndex].ptr = cw; + cw->pOldPixmap = NullPixmap; + FAKE_DIX_SET_WINDOW_PRIVATE(pWin, cw); } ccw->next = cw->clients; cw->clients = ccw; @@ -118,30 +193,59 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) return BadAlloc; if (ccw->update == CompositeRedirectManual) { - if (cw->damageRegistered) - { + if (!anyMarked) + anyMarked = compMarkWindows(pWin, &pLayerWin); + + if (cw->damageRegistered) { DamageUnregister (&pWin->drawable, cw->damage); cw->damageRegistered = FALSE; } cw->update = CompositeRedirectManual; } + else if (cw->update == CompositeRedirectAutomatic && !cw->damageRegistered) { + if (!anyMarked) + anyMarked = compMarkWindows(pWin, &pLayerWin); + } if (!compCheckRedirect (pWin)) { FreeResource (ccw->id, RT_NONE); return BadAlloc; } - if (wasMapped && !pWin->mapped) - { - Bool overrideRedirect = pWin->overrideRedirect; - pWin->overrideRedirect = TRUE; - MapWindow (pWin, pClient); - pWin->overrideRedirect = overrideRedirect; - } + + if (anyMarked) + compHandleMarkedWindows(pWin, pLayerWin); return Success; } +void +compRestoreWindow(WindowPtr pWin, PixmapPtr pPixmap) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + WindowPtr pParent = pWin->parent; + + if (pParent->drawable.depth == pWin->drawable.depth) { + GCPtr pGC = GetScratchGC(pWin->drawable.depth, pScreen); + int bw = (int) pWin->borderWidth; + int x = bw; + int y = bw; + int w = pWin->drawable.width; + int h = pWin->drawable.height; + + if (pGC) { + ChangeGCVal val; + + val.val = IncludeInferiors; + dixChangeGC(NullClient, pGC, GCSubwindowMode, NULL, &val); + ValidateGC(&pWin->drawable, pGC); + (*pGC->ops->CopyArea) (&pPixmap->drawable, + &pWin->drawable, pGC, x, y, w, h, 0, 0); + FreeScratchGC(pGC); + } + } +} + /* * Free one of the per-client per-window resources, clearing * redirect and the per-window pointer as appropriate @@ -149,9 +253,12 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) void compFreeClientWindow (WindowPtr pWin, XID id) { + ScreenPtr pScreen = pWin->drawable.pScreen; CompWindowPtr cw = GetCompWindow (pWin); CompClientWindowPtr ccw, *prev; - Bool wasMapped = pWin->mapped; + Bool anyMarked = FALSE; + WindowPtr pLayerWin; + PixmapPtr pPixmap = NULL; if (!cw) return; @@ -168,33 +275,38 @@ compFreeClientWindow (WindowPtr pWin, XID id) } if (!cw->clients) { - if (wasMapped) - UnmapWindow (pWin, FALSE); - - if (pWin->redirectDraw) - compFreePixmap (pWin); + anyMarked = compMarkWindows(pWin, &pLayerWin); + + if (pWin->redirectDraw != RedirectDrawNone) { + pPixmap = (*pScreen->GetWindowPixmap) (pWin); + compSetParentPixmap(pWin); + } if (cw->damage) DamageDestroy (cw->damage); RegionUninit(&cw->borderClip); - pWin->devPrivates[CompWindowPrivateIndex].ptr = 0; + FAKE_DIX_SET_WINDOW_PRIVATE(pWin, NULL); xfree (cw); } else if (cw->update == CompositeRedirectAutomatic && - !cw->damageRegistered && pWin->redirectDraw) + !cw->damageRegistered && pWin->redirectDraw != RedirectDrawNone) { + anyMarked = compMarkWindows(pWin, &pLayerWin); + DamageRegister (&pWin->drawable, cw->damage); cw->damageRegistered = TRUE; + pWin->redirectDraw = RedirectDrawAutomatic; DamageDamageRegion (&pWin->drawable, &pWin->borderSize); } - if (wasMapped && !pWin->mapped) - { - Bool overrideRedirect = pWin->overrideRedirect; - pWin->overrideRedirect = TRUE; - MapWindow (pWin, clients[CLIENT_ID(id)]); - pWin->overrideRedirect = overrideRedirect; + + if (anyMarked) + compHandleMarkedWindows(pWin, pLayerWin); + + if (pPixmap) { + compRestoreWindow(pWin, pPixmap); + (*pScreen->DestroyPixmap) (pPixmap); } } @@ -261,7 +373,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update) } csw->update = CompositeRedirectAutomatic; csw->clients = 0; - pWin->devPrivates[CompSubwindowsPrivateIndex].ptr = csw; + FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, csw); } /* * Redirect all existing windows @@ -276,7 +388,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update) if (!csw->clients) { xfree (csw); - pWin->devPrivates[CompSubwindowsPrivateIndex].ptr = 0; + FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, NULL); } xfree (ccw); return ret; @@ -349,7 +461,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id) */ if (!csw->clients) { - pWin->devPrivates[CompSubwindowsPrivateIndex].ptr = 0; + FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, NULL); xfree (csw); } } @@ -425,9 +537,10 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pParent = pWin->parent; PixmapPtr pPixmap; - GCPtr pGC; - pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth); + /* usage_hint unsupported by our old server infrastructure. */ + pPixmap = (*pScreen->CreatePixmap) (pScreen, w, h, pWin->drawable.depth /*, + CREATE_PIXMAP_USAGE_BACKING_PIXMAP */); if (!pPixmap) return 0; @@ -435,25 +548,60 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) pPixmap->screen_x = x; pPixmap->screen_y = y; - pGC = GetScratchGC (pWin->drawable.depth, pScreen); + if (pParent->drawable.depth == pWin->drawable.depth) { + GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); - /* - * Copy bits from the parent into the new pixmap so that it will - * have "reasonable" contents in case for background None areas. - */ - if (pGC) - { - XID val = IncludeInferiors; - - ValidateGC(&pPixmap->drawable, pGC); - dixChangeGC (serverClient, pGC, GCSubwindowMode, &val, NULL); - (*pGC->ops->CopyArea) (&pParent->drawable, - &pPixmap->drawable, - pGC, - x - pParent->drawable.x, - y - pParent->drawable.y, - w, h, 0, 0); - FreeScratchGC (pGC); + /* + * Copy bits from the parent into the new pixmap so that it will + * have "reasonable" contents in case for background None areas. + */ + if (pGC) + { + ChangeGCVal val; + + val.val = IncludeInferiors; + dixChangeGC(NullClient, pGC, GCSubwindowMode, NULL, &val); + ValidateGC(&pPixmap->drawable, pGC); + (*pGC->ops->CopyArea) (&pParent->drawable, + &pPixmap->drawable, + pGC, + x - pParent->drawable.x, + y - pParent->drawable.y, + w, h, 0, 0); + FreeScratchGC (pGC); + } + } + else { + PictFormatPtr pSrcFormat = compWindowFormat (pParent); + PictFormatPtr pDstFormat = compWindowFormat (pWin); + XID inferiors = IncludeInferiors; + int error; + + PicturePtr pSrcPicture = CreatePicture(None, + &pParent->drawable, + pSrcFormat, + CPSubwindowMode, + &inferiors, + serverClient, &error); + + PicturePtr pDstPicture = CreatePicture(None, + &pPixmap->drawable, + pDstFormat, + 0, 0, + serverClient, &error); + + if (pSrcPicture && pDstPicture) { + CompositePicture(PictOpSrc, + pSrcPicture, + NULL, + pDstPicture, + x - pParent->drawable.x, + y - pParent->drawable.y, 0, 0, 0, 0, w, h); + } + if (pSrcPicture) + FreePicture(pSrcPicture, 0); + if (pDstPicture) + FreePicture(pDstPicture, 0); } return pPixmap; } @@ -471,7 +619,11 @@ compAllocPixmap (WindowPtr pWin) if (!pPixmap) return FALSE; - pWin->redirectDraw = TRUE; + if (cw->update == CompositeRedirectAutomatic) + pWin->redirectDraw = RedirectDrawAutomatic; + else + pWin->redirectDraw = RedirectDrawManual; + compSetPixmap (pWin, pPixmap); cw->oldx = COMP_ORIGIN_INVALID; cw->oldy = COMP_ORIGIN_INVALID; @@ -481,14 +633,21 @@ compAllocPixmap (WindowPtr pWin) DamageRegister (&pWin->drawable, cw->damage); cw->damageRegistered = TRUE; } + + /* Make sure our borderClip is up to date */ + RegionUninit(&cw->borderClip); + RegionCopy(&cw->borderClip, &pWin->borderClip); + cw->borderClipX = pWin->drawable.x; + cw->borderClipY = pWin->drawable.y; + return TRUE; } void -compFreePixmap (WindowPtr pWin) +compSetParentPixmap (WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; - PixmapPtr pRedirectPixmap, pParentPixmap; + PixmapPtr pParentPixmap; CompWindowPtr cw = GetCompWindow (pWin); if (cw->damageRegistered) @@ -504,11 +663,9 @@ compFreePixmap (WindowPtr pWin) * parent exposed area; regions beyond the parent cause crashes */ RegionCopy(&pWin->borderClip, &cw->borderClip); - pRedirectPixmap = (*pScreen->GetWindowPixmap) (pWin); pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent); - pWin->redirectDraw = FALSE; + pWin->redirectDraw = RedirectDrawNone; compSetPixmap (pWin, pParentPixmap); - (*pScreen->DestroyPixmap) (pRedirectPixmap); } /* @@ -527,7 +684,7 @@ compReallocPixmap (WindowPtr pWin, int draw_x, int draw_y, int pix_x, pix_y; int pix_w, pix_h; - assert (cw && pWin->redirectDraw); + assert (cw && pWin->redirectDraw != RedirectDrawNone); cw->oldx = pOld->screen_x; cw->oldy = pOld->screen_y; pix_x = draw_x - bw; diff --git a/nx-X11/programs/Xserver/composite/compext.c b/nx-X11/programs/Xserver/composite/compext.c index f57235d46..d5f8fd6d4 100644 --- a/nx-X11/programs/Xserver/composite/compext.c +++ b/nx-X11/programs/Xserver/composite/compext.c @@ -27,18 +27,44 @@ #endif #include "compint.h" +#include "XI.h" +#include "XIproto.h" +#include "extinit.h" + +#ifndef SERVER_COMPOSITE_MAJOR_VERSION +#define SERVER_COMPOSITE_MAJOR_VERSION 0 +#endif + +#ifndef SERVER_COMPOSITE_MINOR_VERSION +#define SERVER_COMPOSITE_MINOR_VERSION 4 +#endif static CARD8 CompositeReqCode; -int CompositeClientPrivateIndex; + +#ifndef NXAGENT_SERVER +static DevPrivateKeyRec CompositeClientPrivateKeyRec; + +#define CompositeClientPrivateKey (&CompositeClientPrivateKeyRec) +#else /* !defined(NXAGENT_SERVER) */ +static int CompositeClientPrivIndex = -1; +#endif /* !defined(NXAGENT_SERVER) */ + RESTYPE CompositeClientWindowType; RESTYPE CompositeClientSubwindowsType; +RESTYPE CompositeClientOverlayType; typedef struct _CompositeClient { int major_version; int minor_version; } CompositeClientRec, *CompositeClientPtr; -#define GetCompositeClient(pClient) ((CompositeClientPtr) (pClient)->devPrivates[CompositeClientPrivateIndex].ptr) +#ifndef NXAGENT_SERVER +#define GetCompositeClient(pClient) ((CompositeClientPtr) \ + dixLookupPrivate(&(pClient)->devPrivates, CompositeClientPrivateKey)) +#else /* !defined(NXAGENT_SERVER) */ +#define GetCompositeClient(pClient) ((CompositeClientPtr) \ + (pClient)->devPrivates[CompositeClientPrivIndex].ptr) +#endif /* !edefined(NXAGENT_SERVER) */ static void CompositeClientCallback (CallbackListPtr *list, @@ -57,22 +83,31 @@ static void CompositeResetProc (ExtensionEntry *extEntry) { } + +static int +FreeCompositeClientWindow(void *value, XID ccwid) +{ + WindowPtr pWin = value; + + compFreeClientWindow(pWin, ccwid); + return Success; +} static int -FreeCompositeClientWindow (void * value, XID ccwid) +FreeCompositeClientSubwindows(void *value, XID ccwid) { WindowPtr pWin = value; - compFreeClientWindow (pWin, ccwid); + compFreeClientSubwindows(pWin, ccwid); return Success; } static int -FreeCompositeClientSubwindows (void * value, XID ccwid) +FreeCompositeClientOverlay(void *value, XID ccwid) { - WindowPtr pWin = value; + CompOverlayClientPtr pOc = (CompOverlayClientPtr) value; - compFreeClientSubwindows (pWin, ccwid); + compFreeOverlayClient(pOc); return Success; } @@ -80,24 +115,22 @@ static int ProcCompositeQueryVersion (ClientPtr client) { CompositeClientPtr pCompositeClient = GetCompositeClient (client); - xCompositeQueryVersionReply rep; + xCompositeQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; register int n; + REQUEST(xCompositeQueryVersionReq); REQUEST_SIZE_MATCH(xCompositeQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (stuff->majorVersion < COMPOSITE_MAJOR) { + if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } else { - rep.majorVersion = COMPOSITE_MAJOR; - if (stuff->majorVersion == COMPOSITE_MAJOR && - stuff->minorVersion < COMPOSITE_MINOR) - rep.minorVersion = stuff->minorVersion; - else - rep.minorVersion = COMPOSITE_MINOR; + rep.majorVersion = SERVER_COMPOSITE_MAJOR_VERSION; + rep.minorVersion = SERVER_COMPOSITE_MINOR_VERSION; } pCompositeClient->major_version = rep.majorVersion; pCompositeClient->minor_version = rep.minorVersion; @@ -108,9 +141,23 @@ ProcCompositeQueryVersion (ClientPtr client) swapl(&rep.minorVersion, n); } WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep); - return(client->noClientException); + return Success; } +/* Unsupported by current architecture and porting is too much effort. */ +#if 0 +#define VERIFY_WINDOW(pWindow, wid, client, mode) \ + do { \ + int err; \ + err = dixLookupResourceByType((void **) &pWindow, wid, \ + RT_WINDOW, client, mode); \ + if (err != Success) { \ + client->errorValue = wid; \ + return err; \ + } \ + } while (0) +#endif /* 0 */ + static int ProcCompositeRedirectWindow (ClientPtr client) { @@ -118,12 +165,18 @@ ProcCompositeRedirectWindow (ClientPtr client) REQUEST(xCompositeRedirectWindowReq); REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq); + /* Unsupported by current architecture and porting is too much effort. */ + /* + VERIFY_WINDOW(pWin, stuff->window, client, + DixSetAttrAccess | DixManageAccess | DixBlendAccess); + */ pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); if (!pWin) { client->errorValue = stuff->window; return BadWindow; } + return compRedirectWindow (client, pWin, stuff->update); } @@ -134,12 +187,18 @@ ProcCompositeRedirectSubwindows (ClientPtr client) REQUEST(xCompositeRedirectSubwindowsReq); REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq); + /* Unsupported by current architecture and porting is too much effort. */ + /* + VERIFY_WINDOW(pWin, stuff->window, client, + DixSetAttrAccess | DixManageAccess | DixBlendAccess); + */ pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); if (!pWin) { client->errorValue = stuff->window; return BadWindow; } + return compRedirectSubwindows (client, pWin, stuff->update); } @@ -150,12 +209,18 @@ ProcCompositeUnredirectWindow (ClientPtr client) REQUEST(xCompositeUnredirectWindowReq); REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq); + /* Unsupported by current architecture and porting is too much effort. */ + /* + VERIFY_WINDOW(pWin, stuff->window, client, + DixSetAttrAccess | DixManageAccess | DixBlendAccess); + */ pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); if (!pWin) { client->errorValue = stuff->window; return BadWindow; } + return compUnredirectWindow (client, pWin, stuff->update); } @@ -166,12 +231,18 @@ ProcCompositeUnredirectSubwindows (ClientPtr client) REQUEST(xCompositeUnredirectSubwindowsReq); REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq); + /* Unsupported by current architecture and porting is too much effort. */ + /* + VERIFY_WINDOW(pWin, stuff->window, client, + DixSetAttrAccess | DixManageAccess | DixBlendAccess); + */ pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); if (!pWin) { client->errorValue = stuff->window; return BadWindow; } + return compUnredirectSubwindows (client, pWin, stuff->update); } @@ -184,13 +255,16 @@ ProcCompositeCreateRegionFromBorderClip (ClientPtr client) REQUEST(xCompositeCreateRegionFromBorderClipReq); REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq); + /* Unsupported by current architecture and porting is too much effort. */ + /* + VERIFY_WINDOW(pWin, stuff->window, client, DixGetAttrAccess); + */ pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); if (!pWin) { client->errorValue = stuff->window; return BadWindow; } - LEGAL_NEW_RESOURCE (stuff->region, client); cw = GetCompWindow (pWin); @@ -206,7 +280,7 @@ ProcCompositeCreateRegionFromBorderClip (ClientPtr client) if (!AddResource (stuff->region, RegionResType, (void *) pRegion)) return BadAlloc; - return(client->noClientException); + return Success; } static int @@ -215,35 +289,170 @@ ProcCompositeNameWindowPixmap (ClientPtr client) WindowPtr pWin; CompWindowPtr cw; PixmapPtr pPixmap; + ScreenPtr pScreen; + int rc; + REQUEST(xCompositeNameWindowPixmapReq); REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq); + /* Unsupported by current architecture and porting is too much effort. */ + /* + VERIFY_WINDOW(pWin, stuff->window, client, DixGetAttrAccess); + */ pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); if (!pWin) { client->errorValue = stuff->window; return BadWindow; } - + + pScreen = pWin->drawable.pScreen; + + if (!pWin->viewable) + return BadMatch; + LEGAL_NEW_RESOURCE (stuff->pixmap, client); cw = GetCompWindow (pWin); if (!cw) return BadMatch; - pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin); + pPixmap = (*pScreen->GetWindowPixmap) (pWin); if (!pPixmap) return BadMatch; + /* security creation/labeling check */ + /* + rc = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pixmap, RT_PIXMAP, + pPixmap, RT_WINDOW, pWin, DixCreateAccess); + */ + rc = Success; + if (rc != Success) + return rc; + ++pPixmap->refcnt; if (!AddResource (stuff->pixmap, RT_PIXMAP, (void *) pPixmap)) return BadAlloc; - return(client->noClientException); + /* Unsupported by current architecture. */ + /* + if (pScreen->NameWindowPixmap) { + rc = pScreen->NameWindowPixmap(pWin, pPixmap, stuff->pixmap); + if (rc != Success) { + FreeResource(stuff->pixmap, RT_NONE); + return rc; + } + } + */ + + return Success; +} + +static int +ProcCompositeGetOverlayWindow(ClientPtr client) +{ + REQUEST(xCompositeGetOverlayWindowReq); + xCompositeGetOverlayWindowReply rep; + WindowPtr pWin; + ScreenPtr pScreen; + CompScreenPtr cs; + CompOverlayClientPtr pOc; + int rc; + int n = 0; + + REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); + /* Unsupported by current architecture and porting is too much effort. */ + /* + VERIFY_WINDOW(pWin, stuff->window, client, DixGetAttrAccess); + */ + pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); + if (!pWin) + { + client->errorValue = stuff->window; + return BadWindow; + } + pScreen = pWin->drawable.pScreen; + + /* + * Create an OverlayClient structure to mark this client's + * interest in the overlay window + */ + pOc = compCreateOverlayClient(pScreen, client); + if (pOc == NULL) + return BadAlloc; + + /* + * Make sure the overlay window exists + */ + cs = GetCompScreen(pScreen); + if (cs->pOverlayWin == NULL) + if (!compCreateOverlayWindow(pScreen)) { + FreeResource(pOc->resource, RT_NONE); + return BadAlloc; + } + + /* + rc = XaceHook(XACE_RESOURCE_ACCESS, client, cs->pOverlayWin->drawable.id, + RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL, DixGetAttrAccess); + */ + rc = Success; + if (rc != Success) { + FreeResource(pOc->resource, RT_NONE); + return rc; + } + + rep = (xCompositeGetOverlayWindowReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .overlayWin = cs->pOverlayWin->drawable.id + }; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.overlayWin, n); + } + WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); + + return Success; } -int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { +static int +ProcCompositeReleaseOverlayWindow(ClientPtr client) +{ + REQUEST(xCompositeReleaseOverlayWindowReq); + WindowPtr pWin; + CompOverlayClientPtr pOc; + + REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); + /* Unsupported by current architecture and porting is too much effort. */ + /* + VERIFY_WINDOW(pWin, stuff->window, client, DixGetAttrAccess); + */ + pWin = (WindowPtr) LookupIDByType (stuff->window, RT_WINDOW); + if (!pWin) + { + client->errorValue = stuff->window; + return BadWindow; + } + + /* + * Has client queried a reference to the overlay window + * on this screen? If not, generate an error. + */ + pOc = compFindOverlayClient(pWin->drawable.pScreen, client); + if (pOc == NULL) + return BadMatch; + + /* The delete function will free the client structure */ + FreeResource(pOc->resource, RT_NONE); + + return Success; +} + +static int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { ProcCompositeQueryVersion, ProcCompositeRedirectWindow, ProcCompositeRedirectSubwindows, @@ -251,6 +460,7 @@ int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { ProcCompositeUnredirectSubwindows, ProcCompositeCreateRegionFromBorderClip, ProcCompositeNameWindowPixmap, + ProcCompositeGetOverlayWindow, ProcCompositeReleaseOverlayWindow, }; static int @@ -351,7 +561,31 @@ SProcCompositeNameWindowPixmap (ClientPtr client) return (*ProcCompositeVector[stuff->compositeReqType]) (client); } -int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { +static int +SProcCompositeGetOverlayWindow(ClientPtr client) +{ + int n = 0; + REQUEST(xCompositeGetOverlayWindowReq); + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); + swapl(&stuff->window, n); + return (*ProcCompositeVector[stuff->compositeReqType]) (client); +} + +static int +SProcCompositeReleaseOverlayWindow(ClientPtr client) +{ + int n = 0; + REQUEST(xCompositeReleaseOverlayWindowReq); + + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); + swapl(&stuff->window, n); + return (*ProcCompositeVector[stuff->compositeReqType]) (client); +} + +static int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { SProcCompositeQueryVersion, SProcCompositeRedirectWindow, SProcCompositeRedirectSubwindows, @@ -359,6 +593,7 @@ int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = { SProcCompositeUnredirectSubwindows, SProcCompositeCreateRegionFromBorderClip, SProcCompositeNameWindowPixmap, + SProcCompositeGetOverlayWindow, SProcCompositeReleaseOverlayWindow, }; static int @@ -372,27 +607,104 @@ SProcCompositeDispatch (ClientPtr client) return BadRequest; } +/* Both unused and incompatible due to architecture, disabled. */ +#if 0 +/** @see GetDefaultBytes */ +static void +GetCompositeClientWindowBytes(void *value, XID id, ResourceSizePtr size) +{ + WindowPtr window = value; + + /* Currently only pixmap bytes are reported to clients. */ + size->resourceSize = 0; + + /* Calculate pixmap reference sizes. */ + size->pixmapRefSize = 0; + if (window->redirectDraw != RedirectDrawNone) + { + SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); + ResourceSizeRec pixmapSize = { 0, 0 }; + ScreenPtr screen = window->drawable.pScreen; + PixmapPtr pixmap = screen->GetWindowPixmap(window); + pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } +} +#endif /* 0 */ + void CompositeExtensionInit (void) { ExtensionEntry *extEntry; int s; + /* Assume initialization is going to fail */ + noCompositeExtension = TRUE; + + fprintf(stderr, "COMPOSITE: trying to initialize extension.\n"); + + for (s = 0; s < screenInfo.numScreens; s++) { + ScreenPtr pScreen = screenInfo.screens[s]; + VisualPtr vis; + + /* Composite on 8bpp pseudocolor root windows appears to fail, so + * just disable it on anything pseudocolor for safety. + */ + for (vis = pScreen->visuals; vis->vid != pScreen->rootVisual; vis++); + if ((vis->class | DynamicClass) == PseudoColor) + return; + + /* Ensure that Render is initialized, which is required for automatic + * compositing. + */ + if (GetPictureScreenIfSet(pScreen) == NULL) + return; + } +#ifdef PANORAMIX + /* Xinerama's rewriting of window drawing before Composite gets to it + * breaks Composite. + */ + if (!noPanoramiXExtension) + return; +#endif + CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow); if (!CompositeClientWindowType) return; + /* SetResourceTypeSizeFunc(CompositeClientWindowType, + GetCompositeClientWindowBytes); + */ + CompositeClientSubwindowsType = CreateNewResourceType (FreeCompositeClientSubwindows); if (!CompositeClientSubwindowsType) return; - CompositeClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (CompositeClientPrivateIndex, + CompositeClientOverlayType = CreateNewResourceType + (FreeCompositeClientOverlay); + if (!CompositeClientOverlayType) + return; + +#ifndef NXAGENT_SERVER + if (!dixRegisterPrivateKey(&CompositeClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (CompositeClientRec))) return; +#else /* !defined(NXAGENT_SERVER) */ + if ((CompositeClientPrivIndex = AllocateClientPrivateIndex()) < 0) + return; + if (!AllocateClientPrivate(CompositeClientPrivIndex, sizeof (CompositeClientRec))) + return; +#endif /* !defined(NXAGENT_SERVER) */ + if (!AddCallback (&ClientStateCallback, CompositeClientCallback, 0)) return; + for (s = 0; s < screenInfo.numScreens; s++) + if (!compScreenInit (screenInfo.screens[s])) { + fprintf (stderr, "COMPOSITE: could not initialize via compScreenInit() for screen %d\n", s); + return; + } + extEntry = AddExtension (COMPOSITE_NAME, 0, 0, ProcCompositeDispatch, SProcCompositeDispatch, CompositeResetProc, StandardMinorOpcode); @@ -400,10 +712,371 @@ CompositeExtensionInit (void) return; CompositeReqCode = (CARD8) extEntry->base; - - for (s = 0; s < screenInfo.numScreens; s++) - if (!compScreenInit (screenInfo.screens[s])) - return; - miRegisterRedirectBorderClipProc (compSetRedirectBorderClip, - compGetRedirectBorderClip); + /* Initialization succeeded */ + noCompositeExtension = FALSE; +} + +/* + * This code requires features the current infrastructure does not provide + * and will thus be disabled. + */ +#if 0 + +#ifdef PANORAMIX +#include "panoramiXsrv.h" + +int (*PanoramiXSaveCompositeVector[CompositeNumberRequests]) (ClientPtr); + +static int +PanoramiXCompositeRedirectWindow(ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + + REQUEST(xCompositeRedirectWindowReq); + + REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq); + + if ((rc = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) + break; + } + + return rc; +} + +static int +PanoramiXCompositeRedirectSubwindows(ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + + REQUEST(xCompositeRedirectSubwindowsReq); + + REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq); + + if ((rc = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) + break; + } + + return rc; +} + +static int +PanoramiXCompositeUnredirectWindow(ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + + REQUEST(xCompositeUnredirectWindowReq); + + REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq); + + if ((rc = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) + break; + } + + return rc; +} + +static int +PanoramiXCompositeUnredirectSubwindows(ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + + REQUEST(xCompositeUnredirectSubwindowsReq); + + REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq); + + if ((rc = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) + break; + } + + return rc; } + +static int +PanoramiXCompositeNameWindowPixmap(ClientPtr client) +{ + WindowPtr pWin; + CompWindowPtr cw; + PixmapPtr pPixmap; + int rc; + PanoramiXRes *win, *newPix; + int i; + + REQUEST(xCompositeNameWindowPixmapReq); + + REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq); + + if ((rc = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + LEGAL_NEW_RESOURCE(stuff->pixmap, client); + + if (!(newPix = malloc(sizeof(PanoramiXRes)))) + return BadAlloc; + + newPix->type = XRT_PIXMAP; + newPix->u.pix.shared = FALSE; + panoramix_setup_ids(newPix, client, stuff->pixmap); + + FOR_NSCREENS(i) { + rc = dixLookupResourceByType((void **) &pWin, win->info[i].id, + RT_WINDOW, client, DixGetAttrAccess); + if (rc != Success) { + client->errorValue = stuff->window; + free(newPix); + return rc; + } + + if (!pWin->viewable) { + free(newPix); + return BadMatch; + } + + cw = GetCompWindow(pWin); + if (!cw) { + free(newPix); + return BadMatch; + } + + pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin); + if (!pPixmap) { + free(newPix); + return BadMatch; + } + + if (!AddResource(newPix->info[i].id, RT_PIXMAP, (void *) pPixmap)) + return BadAlloc; + + ++pPixmap->refcnt; + } + + if (!AddResource(stuff->pixmap, XRT_PIXMAP, (void *) newPix)) + return BadAlloc; + + return Success; +} + +static int +PanoramiXCompositeGetOverlayWindow(ClientPtr client) +{ + REQUEST(xCompositeGetOverlayWindowReq); + xCompositeGetOverlayWindowReply rep; + WindowPtr pWin; + ScreenPtr pScreen; + CompScreenPtr cs; + CompOverlayClientPtr pOc; + int rc; + PanoramiXRes *win, *overlayWin = NULL; + int i; + int n = 0; + + REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); + + if ((rc = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + cs = GetCompScreen(screenInfo.screens[0]); + if (!cs->pOverlayWin) { + if (!(overlayWin = malloc(sizeof(PanoramiXRes)))) + return BadAlloc; + + overlayWin->type = XRT_WINDOW; + overlayWin->u.win.root = FALSE; + } + + FOR_NSCREENS_BACKWARD(i) { + rc = dixLookupResourceByType((void **) &pWin, win->info[i].id, + RT_WINDOW, client, DixGetAttrAccess); + if (rc != Success) { + client->errorValue = stuff->window; + free(overlayWin); + return rc; + } + pScreen = pWin->drawable.pScreen; + + /* + * Create an OverlayClient structure to mark this client's + * interest in the overlay window + */ + pOc = compCreateOverlayClient(pScreen, client); + if (pOc == NULL) { + free(overlayWin); + return BadAlloc; + } + + /* + * Make sure the overlay window exists + */ + cs = GetCompScreen(pScreen); + if (cs->pOverlayWin == NULL) + if (!compCreateOverlayWindow(pScreen)) { + FreeResource(pOc->resource, RT_NONE); + free(overlayWin); + return BadAlloc; + } + + /* + rc = XaceHook(XACE_RESOURCE_ACCESS, client, + cs->pOverlayWin->drawable.id, + RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL, + DixGetAttrAccess); + */ + rc = Success; + if (rc != Success) { + FreeResource(pOc->resource, RT_NONE); + free(overlayWin); + return rc; + } + } + + if (overlayWin) { + FOR_NSCREENS(i) { + cs = GetCompScreen(screenInfo.screens[i]); + overlayWin->info[i].id = cs->pOverlayWin->drawable.id; + } + + AddResource(overlayWin->info[0].id, XRT_WINDOW, overlayWin); + } + + cs = GetCompScreen(screenInfo.screens[0]); + + rep = (xCompositeGetOverlayWindowReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .overlayWin = cs->pOverlayWin->drawable.id + }; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.overlayWin, n); + } + WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep); + + return Success; +} + +static int +PanoramiXCompositeReleaseOverlayWindow(ClientPtr client) +{ + REQUEST(xCompositeReleaseOverlayWindowReq); + WindowPtr pWin; + CompOverlayClientPtr pOc; + PanoramiXRes *win; + int i, rc; + + REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); + + if ((rc = dixLookupResourceByType((void **) &win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_BACKWARD(i) { + if ((rc = dixLookupResourceByType((void **) &pWin, win->info[i].id, + XRT_WINDOW, client, + DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + /* + * Has client queried a reference to the overlay window + * on this screen? If not, generate an error. + */ + pOc = compFindOverlayClient(pWin->drawable.pScreen, client); + if (pOc == NULL) + return BadMatch; + + /* The delete function will free the client structure */ + FreeResource(pOc->resource, RT_NONE); + } + + return Success; +} + +void +PanoramiXCompositeInit(void) +{ + int i; + + for (i = 0; i < CompositeNumberRequests; i++) + PanoramiXSaveCompositeVector[i] = ProcCompositeVector[i]; + /* + * Stuff in Xinerama aware request processing hooks + */ + ProcCompositeVector[X_CompositeRedirectWindow] = + PanoramiXCompositeRedirectWindow; + ProcCompositeVector[X_CompositeRedirectSubwindows] = + PanoramiXCompositeRedirectSubwindows; + ProcCompositeVector[X_CompositeUnredirectWindow] = + PanoramiXCompositeUnredirectWindow; + ProcCompositeVector[X_CompositeUnredirectSubwindows] = + PanoramiXCompositeUnredirectSubwindows; + ProcCompositeVector[X_CompositeNameWindowPixmap] = + PanoramiXCompositeNameWindowPixmap; + ProcCompositeVector[X_CompositeGetOverlayWindow] = + PanoramiXCompositeGetOverlayWindow; + ProcCompositeVector[X_CompositeReleaseOverlayWindow] = + PanoramiXCompositeReleaseOverlayWindow; +} + +void +PanoramiXCompositeReset(void) +{ + int i; + + for (i = 0; i < CompositeNumberRequests; i++) + ProcCompositeVector[i] = PanoramiXSaveCompositeVector[i]; +} + +#endif + +#endif /* 0 */ diff --git a/nx-X11/programs/Xserver/composite/compinit.c b/nx-X11/programs/Xserver/composite/compinit.c index 13a6d6c01..c86aaed5a 100644 --- a/nx-X11/programs/Xserver/composite/compinit.c +++ b/nx-X11/programs/Xserver/composite/compinit.c @@ -27,11 +27,17 @@ #endif #include "compint.h" - -int CompScreenPrivateIndex; -int CompWindowPrivateIndex; -int CompSubwindowsPrivateIndex; -int CompGeneration; +#include "compositeext.h" + +#ifndef NXAGENT_SERVER +DevPrivateKeyRec CompScreenPrivateKeyRec; +DevPrivateKeyRec CompWindowPrivateKeyRec; +DevPrivateKeyRec CompSubwindowsPrivateKeyRec; +#else /* !defined(NXAGENT_SERVER) */ +int CompScreenPrivIndex = -1; +int CompWindowPrivIndex = -1; +int CompSubwindowsPrivIndex = -1; +#endif static Bool compCloseScreen (int index, ScreenPtr pScreen) @@ -39,24 +45,39 @@ compCloseScreen (int index, ScreenPtr pScreen) CompScreenPtr cs = GetCompScreen (pScreen); Bool ret; + free(cs->alternateVisuals); + pScreen->CloseScreen = cs->CloseScreen; - pScreen->BlockHandler = cs->BlockHandler; pScreen->InstallColormap = cs->InstallColormap; + pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes; pScreen->ReparentWindow = cs->ReparentWindow; + + /* + * Unsupported by our old Xserver infrastructure, replaced with direct calls to + * compReallocPixmap(). + */ + /* + pScreen->ConfigNotify = cs->ConfigNotify; + */ + pScreen->MoveWindow = cs->MoveWindow; pScreen->ResizeWindow = cs->ResizeWindow; pScreen->ChangeBorderWidth = cs->ChangeBorderWidth; pScreen->ClipNotify = cs->ClipNotify; - pScreen->PaintWindowBackground = cs->PaintWindowBackground; pScreen->UnrealizeWindow = cs->UnrealizeWindow; pScreen->RealizeWindow = cs->RealizeWindow; pScreen->DestroyWindow = cs->DestroyWindow; pScreen->CreateWindow = cs->CreateWindow; pScreen->CopyWindow = cs->CopyWindow; pScreen->PositionWindow = cs->PositionWindow; + + pScreen->GetImage = cs->GetImage; + pScreen->GetSpans = cs->GetSpans; + pScreen->SourceValidate = cs->SourceValidate; + xfree (cs); - pScreen->devPrivates[CompScreenPrivateIndex].ptr = 0; + FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, NULL); ret = (*pScreen->CloseScreen) (index, pScreen); return ret; } @@ -69,7 +90,7 @@ compInstallColormap (ColormapPtr pColormap) CompScreenPtr cs = GetCompScreen (pScreen); int a; - for (a = 0; a < NUM_COMP_ALTERNATE_VISUALS; a++) + for (a = 0; a < cs->numAlternateVisuals; a++) if (pVisual->vid == cs->alternateVisuals[a]) return; pScreen->InstallColormap = cs->InstallColormap; @@ -78,33 +99,91 @@ compInstallColormap (ColormapPtr pColormap) pScreen->InstallColormap = compInstallColormap; } +/* Unsupported by current architecture, drop for now. */ +#if 0 static void -compScreenUpdate (ScreenPtr pScreen) +compCheckBackingStore(WindowPtr pWin) { - CompScreenPtr cs = GetCompScreen (pScreen); - - compCheckTree (pScreen); - if (cs->damaged) - { - compWindowUpdate (WindowTable[pScreen->myNum]); - cs->damaged = FALSE; + if (pWin->backingStore != NotUseful && !pWin->backStorage) { + compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic); + pWin->backStorage = TRUE; + } + else if (pWin->backingStore == NotUseful && pWin->backStorage) { + compUnredirectWindow(serverClient, pWin, + CompositeRedirectAutomatic); + pWin->backStorage = FALSE; } } +/* Fake backing store via automatic redirection */ +static Bool +compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + CompScreenPtr cs = GetCompScreen(pScreen); + Bool ret; + + pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes; + ret = pScreen->ChangeWindowAttributes(pWin, mask); + + if (ret && (mask & CWBackingStore) && + pScreen->backingStoreSupport != NotUseful) + compCheckBackingStore(pWin); + + pScreen->ChangeWindowAttributes = compChangeWindowAttributes; + + return ret; +} +#endif /* 0 */ + static void -compBlockHandler (int i, - void *blockData, - void *pTimeout, - void *pReadmask) +compGetImage(DrawablePtr pDrawable, + int sx, int sy, + int w, int h, + unsigned int format, unsigned long planemask, char *pdstLine) { - ScreenPtr pScreen = screenInfo.screens[i]; - CompScreenPtr cs = GetCompScreen (pScreen); + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen(pScreen); + + pScreen->GetImage = cs->GetImage; + if (pDrawable->type == DRAWABLE_WINDOW) + compPaintChildrenToWindow(pScreen, (WindowPtr) pDrawable); + (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine); + cs->GetImage = pScreen->GetImage; + pScreen->GetImage = compGetImage; +} + +static void +compGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, + int nspans, char *pdstStart) +{ + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen(pScreen); + + pScreen->GetSpans = cs->GetSpans; + if (pDrawable->type == DRAWABLE_WINDOW) + compPaintChildrenToWindow(pScreen, (WindowPtr) pDrawable); + (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); + cs->GetSpans = pScreen->GetSpans; + pScreen->GetSpans = compGetSpans; +} - pScreen->BlockHandler = cs->BlockHandler; - compScreenUpdate (pScreen); - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); - cs->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = compBlockHandler; +static void +compSourceValidate(DrawablePtr pDrawable, + int x, int y, + int width, int height /* , unsigned int subWindowMode */ /* unsupported */) +{ + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen(pScreen); + + pScreen->SourceValidate = cs->SourceValidate; + if (pDrawable->type == DRAWABLE_WINDOW /* && subWindowMode == IncludeInferiors */ /* unsupported */) + compPaintChildrenToWindow(pScreen, (WindowPtr) pDrawable); + if (pScreen->SourceValidate) + (*pScreen->SourceValidate) (pDrawable, x, y, width, height /*, + subWindowMode */ /* unsupported */); + cs->SourceValidate = pScreen->SourceValidate; + pScreen->SourceValidate = compSourceValidate; } /* @@ -139,192 +218,190 @@ compFindVisuallessDepth (ScreenPtr pScreen, int d) return 0; } +/* + * Add a list of visual IDs to the list of visuals to implicitly redirect. + */ +static Bool +compRegisterAlternateVisuals(CompScreenPtr cs, VisualID * vids, int nVisuals) +{ + VisualID *p; + +#ifndef NXAGENT_SERVER + p = reallocarray(cs->alternateVisuals, + cs->numAlternateVisuals + nVisuals, sizeof(VisualID)); +#else + p = xrealloc(cs->alternateVisuals, + sizeof(VisualID) * (cs->numAlternateVisuals + nVisuals)); +#endif + if (p == NULL) + return FALSE; + + memcpy(&p[cs->numAlternateVisuals], vids, sizeof(VisualID) * nVisuals); + + cs->alternateVisuals = p; + cs->numAlternateVisuals += nVisuals; + + return TRUE; +} + +Bool +CompositeRegisterAlternateVisuals(ScreenPtr pScreen, VisualID * vids, + int nVisuals) +{ + CompScreenPtr cs = GetCompScreen(pScreen); + + return compRegisterAlternateVisuals(cs, vids, nVisuals); +} + +Bool +CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen, + VisualID parentVisual, + VisualID winVisual) +{ + CompScreenPtr cs = GetCompScreen(pScreen); + CompImplicitRedirectException *p; + +#ifndef NXAGENT_SERVER + p = reallocarray(cs->implicitRedirectExceptions, + cs->numImplicitRedirectExceptions + 1, sizeof(p[0])); +#else + p = xrealloc(cs->implicitRedirectExceptions, + sizeof(p[0]) * (cs->numImplicitRedirectExceptions + 1)); +#endif + if (p == NULL) + return FALSE; + + p[cs->numImplicitRedirectExceptions].parentVisual = parentVisual; + p[cs->numImplicitRedirectExceptions].winVisual = winVisual; + + cs->implicitRedirectExceptions = p; + cs->numImplicitRedirectExceptions++; + + return TRUE; +} + typedef struct _alternateVisual { int depth; CARD32 format; } CompAlternateVisual; -static CompAlternateVisual altVisuals[NUM_COMP_ALTERNATE_VISUALS] = { +static CompAlternateVisual altVisuals[] = { #if COMP_INCLUDE_RGB24_VISUAL { 24, PICT_r8g8b8 }, #endif { 32, PICT_a8r8g8b8 }, }; +static const int NUM_COMP_ALTERNATE_VISUALS = sizeof(altVisuals) / + sizeof(CompAlternateVisual); + static Bool -compAddAlternateVisuals (ScreenPtr pScreen, CompScreenPtr cs) +compAddAlternateVisual (ScreenPtr pScreen, CompScreenPtr cs, + CompAlternateVisual * alt) { - VisualPtr visuals; - DepthPtr depths[NUM_COMP_ALTERNATE_VISUALS]; - PictFormatPtr pPictFormats[NUM_COMP_ALTERNATE_VISUALS]; - int i; - int numVisuals; - VisualID *vids[NUM_COMP_ALTERNATE_VISUALS]; - XID *installedCmaps; - ColormapPtr installedCmap; - int numInstalledCmaps; - int numAlternate = 0; - int alt; - - memset (cs->alternateVisuals, '\0', sizeof (cs->alternateVisuals)); - - for (alt = 0; alt < NUM_COMP_ALTERNATE_VISUALS; alt++) - { - DepthPtr depth; - PictFormatPtr pPictFormat; - - depth = compFindVisuallessDepth (pScreen, altVisuals[alt].depth); - if (!depth) - continue; - /* - * Find the right picture format - */ - pPictFormat = PictureMatchFormat (pScreen, altVisuals[alt].depth, - altVisuals[alt].format); - if (!pPictFormat) - continue; + VisualPtr visual; + DepthPtr depth; + PictFormatPtr pPictFormat; + unsigned long alphaMask; - /* - * Allocate vid list for this depth - */ - vids[numAlternate] = xalloc (sizeof (VisualID)); - if (!vids[numAlternate]) - continue; - depths[numAlternate] = depth; - pPictFormats[numAlternate] = pPictFormat; - numAlternate++; - } + /* + * The ARGB32 visual is always available. Other alternate depth visuals + * are only provided if their depth is less than the root window depth. + * There's no deep reason for this. + */ + if (alt->depth >= pScreen->rootDepth && alt->depth != 32) + return FALSE; - if (!numAlternate) + depth = compFindVisuallessDepth(pScreen, alt->depth); + if (!depth) + /* alt->depth doesn't exist or already has alternate visuals. */ return TRUE; - /* - * Find the installed colormaps - */ - installedCmaps = xalloc (pScreen->maxInstalledCmaps * sizeof (XID)); - if (!installedCmaps) - { - for (alt = 0; alt < numAlternate; alt++) - xfree (vids[alt]); + pPictFormat = PictureMatchFormat(pScreen, alt->depth, alt->format); + if (!pPictFormat) return FALSE; - } - numInstalledCmaps = (*pScreen->ListInstalledColormaps) (pScreen, - installedCmaps); - /* - * realloc the visual array to fit the new one in place - */ - numVisuals = pScreen->numVisuals; - visuals = xrealloc (pScreen->visuals, - (numVisuals + numAlternate) * sizeof (VisualRec)); - if (!visuals) - { - for (alt = 0; alt < numAlternate; alt++) - xfree (vids[alt]); - xfree (installedCmaps); + if (ResizeVisualArray(pScreen, 1, depth) == FALSE) { return FALSE; } - /* - * Fix up any existing installed colormaps -- we'll assume that - * the only ones created so far have been installed. If this - * isn't true, we'll have to walk the resource database looking - * for all colormaps. - */ - for (i = 0; i < numInstalledCmaps; i++) - { - int j; - - installedCmap = LookupIDByType (installedCmaps[i], RT_COLORMAP); - if (!installedCmap) - continue; - j = installedCmap->pVisual - pScreen->visuals; - installedCmap->pVisual = &visuals[j]; - } - - xfree (installedCmaps); - - pScreen->visuals = visuals; - pScreen->numVisuals = numVisuals + numAlternate; + visual = pScreen->visuals + (pScreen->numVisuals - 1); /* the new one */ - for (alt = 0; alt < numAlternate; alt++) - { - DepthPtr depth = depths[alt]; - PictFormatPtr pPictFormat = pPictFormats[alt]; - VisualPtr visual = &visuals[numVisuals + alt]; - unsigned long alphaMask; - - /* - * Initialize the visual - */ - visual->class = TrueColor; + /* Initialize the visual */ visual->bitsPerRGBValue = 8; - - visual->vid = FakeClientID (0); - visual->redMask = (((unsigned long) pPictFormat->direct.redMask) << - pPictFormat->direct.red); - visual->greenMask = (((unsigned long) pPictFormat->direct.greenMask) << - pPictFormat->direct.green); - visual->blueMask = (((unsigned long) pPictFormat->direct.blueMask) << - pPictFormat->direct.blue); - alphaMask = (((unsigned long) pPictFormat->direct.alphaMask) << - pPictFormat->direct.alpha); - visual->offsetRed = pPictFormat->direct.red; - visual->offsetGreen = pPictFormat->direct.green; - visual->offsetBlue = pPictFormat->direct.blue; + if (PICT_FORMAT_TYPE(alt->format) == PICT_TYPE_COLOR) { + visual->class = PseudoColor; + visual->nplanes = PICT_FORMAT_BPP(alt->format); + visual->ColormapEntries = 1 << visual->nplanes; + } + else { + DirectFormatRec *direct = &pPictFormat->direct; + + visual->class = TrueColor; + visual->redMask = ((unsigned long) direct->redMask) << direct->red; + visual->greenMask = + ((unsigned long) direct->greenMask) << direct->green; + visual->blueMask = ((unsigned long) direct->blueMask) << direct->blue; + alphaMask = ((unsigned long) direct->alphaMask) << direct->alpha; + visual->offsetRed = direct->red; + visual->offsetGreen = direct->green; + visual->offsetBlue = direct->blue; /* * Include A bits in this (unlike GLX which includes only RGB) * This lets DIX compute suitable masks for colormap allocations */ - visual->nplanes = Ones (visual->redMask | + visual->nplanes = Ones(visual->redMask | visual->greenMask | - visual->blueMask | - alphaMask); - /* - * find widest component - */ - visual->ColormapEntries = (1 << max (Ones (visual->redMask), - max (Ones (visual->greenMask), - Ones (visual->blueMask)))); + visual->blueMask | alphaMask); + /* find widest component */ + visual->ColormapEntries = (1 << max(Ones(visual->redMask), + max(Ones(visual->greenMask), + Ones(visual->blueMask)))); + } - /* - * remember the visual ID to detect auto-update windows - */ - cs->alternateVisuals[alt] = visual->vid; + /* remember the visual ID to detect auto-update windows */ + compRegisterAlternateVisuals(cs, &visual->vid, 1); - /* - * Fix up the depth - */ - vids[alt][0] = visual->vid; - depth->numVids = 1; - depth->vids = vids[alt]; - } return TRUE; } +static Bool +compAddAlternateVisuals(ScreenPtr pScreen, CompScreenPtr cs) +{ + int alt, ret = 0; + + for (alt = 0; alt < NUM_COMP_ALTERNATE_VISUALS; alt++) + ret |= compAddAlternateVisual(pScreen, cs, altVisuals + alt); + + return ! !ret; +} + Bool compScreenInit (ScreenPtr pScreen) { CompScreenPtr cs; - if (CompGeneration != serverGeneration) - { - CompScreenPrivateIndex = AllocateScreenPrivateIndex (); - if (CompScreenPrivateIndex == -1) - return FALSE; - CompWindowPrivateIndex = AllocateWindowPrivateIndex (); - if (CompWindowPrivateIndex == -1) - return FALSE; - CompSubwindowsPrivateIndex = AllocateWindowPrivateIndex (); - if (CompSubwindowsPrivateIndex == -1) +#ifndef NXAGENT_SERVER + if (!dixRegisterPrivateKey(&CompScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) return FALSE; - CompGeneration = serverGeneration; - } - if (!AllocateWindowPrivate (pScreen, CompWindowPrivateIndex, 0)) + if (!dixRegisterPrivateKey(&CompWindowPrivateKeyRec, PRIVATE_WINDOW, 0)) + return FALSE; + if (!dixRegisterPrivateKey(&CompSubwindowsPrivateKeyRec, PRIVATE_WINDOW, 0)) + return FALSE; +#else /* !defined(NXAGENT_SERVER) */ + if ((CompScreenPrivIndex = AllocateScreenPrivateIndex()) < 0) + return FALSE; + if ((CompWindowPrivIndex = AllocateWindowPrivateIndex()) < 0) + return FALSE; + if ((CompSubwindowsPrivIndex = AllocateWindowPrivateIndex()) < 0) + return FALSE; + + if (!AllocateWindowPrivate (pScreen, CompWindowPrivIndex, 0)) return FALSE; - if (!AllocateWindowPrivate (pScreen, CompSubwindowsPrivateIndex, 0)) + if (!AllocateWindowPrivate (pScreen, CompSubwindowsPrivIndex, 0)) return FALSE; +#endif if (GetCompScreen (pScreen)) return TRUE; @@ -334,12 +411,24 @@ compScreenInit (ScreenPtr pScreen) cs->damaged = FALSE; + cs->overlayWid = FakeClientID(0); + cs->pOverlayWin = NULL; + cs->pOverlayClients = NULL; + + cs->numAlternateVisuals = 0; + cs->alternateVisuals = NULL; + cs->numImplicitRedirectExceptions = 0; + cs->implicitRedirectExceptions = NULL; + if (!compAddAlternateVisuals (pScreen, cs)) { xfree (cs); return FALSE; } + if (!disableBackingStore) + pScreen->backingStoreSupport = WhenMapped; + cs->PositionWindow = pScreen->PositionWindow; pScreen->PositionWindow = compPositionWindow; @@ -358,12 +447,18 @@ compScreenInit (ScreenPtr pScreen) cs->UnrealizeWindow = pScreen->UnrealizeWindow; pScreen->UnrealizeWindow = compUnrealizeWindow; - cs->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = compPaintWindowBackground; - cs->ClipNotify = pScreen->ClipNotify; pScreen->ClipNotify = compClipNotify; + /* + * Unsupported by our old Xserver infrastructure, replaced with direct calls to + * compReallocPixmap(). + */ + /* + cs->ConfigNotify = pScreen->ConfigNotify; + pScreen->ConfigNotify = compConfigNotify; + */ + cs->MoveWindow = pScreen->MoveWindow; pScreen->MoveWindow = compMoveWindow; @@ -379,12 +474,29 @@ compScreenInit (ScreenPtr pScreen) cs->InstallColormap = pScreen->InstallColormap; pScreen->InstallColormap = compInstallColormap; - cs->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = compBlockHandler; + /* Unsupported by our current architecture, drop for now. */ + /* + cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; + pScreen->ChangeWindowAttributes = compChangeWindowAttributes; + */ + + cs->BlockHandler = NULL; cs->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = compCloseScreen; - pScreen->devPrivates[CompScreenPrivateIndex].ptr = (void *) cs; + cs->GetImage = pScreen->GetImage; + pScreen->GetImage = compGetImage; + + cs->GetSpans = pScreen->GetSpans; + pScreen->GetSpans = compGetSpans; + + cs->SourceValidate = pScreen->SourceValidate; + pScreen->SourceValidate = compSourceValidate; + + FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, cs); + + RegisterRealChildHeadProc(CompositeRealChildHead); + return TRUE; } diff --git a/nx-X11/programs/Xserver/composite/compint.h b/nx-X11/programs/Xserver/composite/compint.h index 262d95108..2834dad4e 100644 --- a/nx-X11/programs/Xserver/composite/compint.h +++ b/nx-X11/programs/Xserver/composite/compint.h @@ -51,6 +51,7 @@ #include "damageextint.h" #include "xfixes.h" #include +#include "compositeext.h" #include /* @@ -58,6 +59,7 @@ #define COMPOSITE_DEBUG */ +#define COMPOSITE_DEBUG typedef struct _CompClientWindow { struct _CompClientWindow *next; @@ -89,11 +91,19 @@ typedef struct _CompSubwindows { #define COMP_INCLUDE_RGB24_VISUAL 0 #endif -#if COMP_INCLUDE_RGB24_VISUAL -#define NUM_COMP_ALTERNATE_VISUALS 2 -#else -#define NUM_COMP_ALTERNATE_VISUALS 1 -#endif +typedef struct _CompOverlayClientRec *CompOverlayClientPtr; + +typedef struct _CompOverlayClientRec { + CompOverlayClientPtr pNext; + ClientPtr pClient; + ScreenPtr pScreen; + XID resource; +} CompOverlayClientRec; + +typedef struct _CompImplicitRedirectException { + XID parentVisual; + XID winVisual; +} CompImplicitRedirectException; typedef struct _CompScreen { PositionWindowProcPtr PositionWindow; @@ -102,13 +112,21 @@ typedef struct _CompScreen { DestroyWindowProcPtr DestroyWindow; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; - PaintWindowProcPtr PaintWindowBackground; ClipNotifyProcPtr ClipNotify; /* * Called from ConfigureWindow, these * three track changes to the offscreen storage * geometry */ + + /* + * Unsupported by our old Xserver infrastructure, replaced with direct calls to + * compReallocPixmap(). + */ + /* + ConfigNotifyProcPtr ConfigNotify; + */ + MoveWindowProcPtr MoveWindow; ResizeWindowProcPtr ResizeWindow; ChangeBorderWidthProcPtr ChangeBorderWidth; @@ -122,30 +140,79 @@ typedef struct _CompScreen { */ InstallColormapProcPtr InstallColormap; + /* + * Fake backing store via automatic redirection + */ + ChangeWindowAttributesProcPtr ChangeWindowAttributes; + ScreenBlockHandlerProcPtr BlockHandler; CloseScreenProcPtr CloseScreen; - Bool damaged; - XID alternateVisuals[NUM_COMP_ALTERNATE_VISUALS]; + Bool damaged; + int numAlternateVisuals; + VisualID *alternateVisuals; + int numImplicitRedirectExceptions; + CompImplicitRedirectException *implicitRedirectExceptions; + + WindowPtr pOverlayWin; + Window overlayWid; + CompOverlayClientPtr pOverlayClients; + + GetImageProcPtr GetImage; + GetSpansProcPtr GetSpans; + SourceValidateProcPtr SourceValidate; } CompScreenRec, *CompScreenPtr; -extern int CompScreenPrivateIndex; -extern int CompWindowPrivateIndex; -extern int CompSubwindowsPrivateIndex; +#ifndef NXAGENT_SERVER +extern DevPrivateKeyRec CompScreenPrivateKeyRec; -#define GetCompScreen(s) ((CompScreenPtr) ((s)->devPrivates[CompScreenPrivateIndex].ptr)) -#define GetCompWindow(w) ((CompWindowPtr) ((w)->devPrivates[CompWindowPrivateIndex].ptr)) -#define GetCompSubwindows(w) ((CompSubwindowsPtr) ((w)->devPrivates[CompSubwindowsPrivateIndex].ptr)) +#define CompScreenPrivateKey (&CompScreenPrivateKeyRec) + +extern DevPrivateKeyRec CompWindowPrivateKeyRec; + +#define CompWindowPrivateKey (&CompWindowPrivateKeyRec) + +extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec; + +#define CompSubwindowsPrivateKey (&CompSubwindowsPrivateKeyRec) + +#define GetCompScreen(s) ((CompScreenPtr) \ + dixLookupPrivate(&(s)->devPrivates, CompScreenPrivateKey)) +#define GetCompWindow(w) ((CompWindowPtr) \ + dixLookupPrivate(&(w)->devPrivates, CompWindowPrivateKey)) +#define GetCompSubwindows(w) ((CompSubwindowsPtr) \ + dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey)) +#else /* !defined(NXAGENT_SERVER) */ +extern int CompScreenPrivIndex; +extern int CompWindowPrivIndex; +extern int CompSubwindowsPrivIndex; + +#define GetCompScreen(s) ((CompScreenPtr) (s)->devPrivates[CompScreenPrivIndex].ptr) +#define GetCompWindow(w) ((CompWindowPtr) (w)->devPrivates[CompWindowPrivIndex].ptr) +#define GetCompSubwindows(w) ((CompSubwindowsPtr) (w)->devPrivates[CompSubwindowsPrivIndex].ptr) +#endif /* !defined(NXAGENT_SERVER) */ -extern RESTYPE CompositeClientWindowType; extern RESTYPE CompositeClientSubwindowsType; +extern RESTYPE CompositeClientOverlayType; + +/* Shim for less ifdefs within the actual code. */ +#ifndef NXAGENT_SERVER +#define FAKE_DIX_SET_PRIVATE_IMPL(obj, privateKey, ptr_val) do { dixSetPrivate(&(obj)->devPrivates, privateKey, ptr_val); } while (0) + +#define FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pScreen, CompScreenPrivateKey, ptr_val) +#define FAKE_DIX_SET_WINDOW_PRIVATE(pWin, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pWin, CompWindowPrivateKey, ptr_val) +#define FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pWin, CompSubwindowsPrivateKey, ptr_val) +#else /* !defined(NXAGENT_SERVER) */ +#define FAKE_DIX_SET_PRIVATE_IMPL(obj, privIndex, ptr_val) do { (obj)->devPrivates[privIndex].ptr = (void *) (ptr_val); } while (0) + +#define FAKE_DIX_SET_SCREEN_PRIVATE(pScreen, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pScreen, CompScreenPrivIndex, ptr_val) +#define FAKE_DIX_SET_WINDOW_PRIVATE(pWin, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pWin, CompWindowPrivIndex, ptr_val) +#define FAKE_DIX_SET_SUBWINDOWS_PRIVATE(pWin, ptr_val) FAKE_DIX_SET_PRIVATE_IMPL(pWin, CompSubwindowsPrivIndex, ptr_val) +#endif /* !defined(NXAGENT_SERVER) */ /* * compalloc.c */ -void -compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure); - Bool compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update); @@ -174,25 +241,40 @@ Bool compAllocPixmap (WindowPtr pWin); void -compFreePixmap (WindowPtr pWin); + compSetParentPixmap(WindowPtr pWin); + +void + compRestoreWindow(WindowPtr pWin, PixmapPtr pPixmap); Bool compReallocPixmap (WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, int bw); /* - * compext.c + * compinit.c */ -void -CompositeExtensionInit (void); +Bool + compScreenInit(ScreenPtr pScreen); /* - * compinit.c + * compoverlay.c */ +void + compFreeOverlayClient(CompOverlayClientPtr pOcToDel); + +CompOverlayClientPtr +compFindOverlayClient(ScreenPtr pScreen, ClientPtr pClient); + +CompOverlayClientPtr +compCreateOverlayClient(ScreenPtr pScreen, ClientPtr pClient); + Bool -compScreenInit (ScreenPtr pScreen); + compCreateOverlayWindow(ScreenPtr pScreen); + +void + compDestroyOverlayWindow(ScreenPtr pScreen); /* * compwindow.c @@ -205,6 +287,9 @@ compCheckTree (ScreenPtr pScreen); #define compCheckTree(s) #endif +PictFormatPtr +compWindowFormat (WindowPtr pWin); + void compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap); @@ -220,8 +305,6 @@ compRealizeWindow (WindowPtr pWin); Bool compUnrealizeWindow (WindowPtr pWin); -void -compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what); void compClipNotify (WindowPtr pWin, int dx, int dy); @@ -255,6 +338,25 @@ void compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); void -compWindowUpdate (WindowPtr pWin); + compPaintChildrenToWindow(ScreenPtr pScreen, WindowPtr pWin); + +WindowPtr + CompositeRealChildHead(WindowPtr pWin); + +int + DeleteWindowNoInputDevices(void *value, XID wid); + +/* + * Unsupported by our old Xserver infrastructure, replaced with direct calls to + * compReallocPixmap(). + */ +/* +int +compConfigNotify(WindowPtr pWin, int x, int y, int w, int h, + int bw, WindowPtr pSib); +*/ + +void PanoramiXCompositeInit(void); +void PanoramiXCompositeReset(void); #endif /* _COMPINT_H_ */ diff --git a/nx-X11/programs/Xserver/composite/compositeext.h b/nx-X11/programs/Xserver/composite/compositeext.h new file mode 100644 index 000000000..b96cb1d68 --- /dev/null +++ b/nx-X11/programs/Xserver/composite/compositeext.h @@ -0,0 +1,44 @@ +/* + * Copyright © 2009 NVIDIA Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#ifndef _COMPOSITEEXT_H_ +#define _COMPOSITEEXT_H_ + +#include "misc.h" +#include "scrnintstr.h" + +extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen, + VisualID * vids, + int nVisuals); + +extern _X_EXPORT Bool CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen, + VisualID parentVisual, + VisualID winVisual); + +extern _X_EXPORT RESTYPE CompositeClientWindowType; + +#endif /* _COMPOSITEEXT_H_ */ diff --git a/nx-X11/programs/Xserver/composite/compoverlay.c b/nx-X11/programs/Xserver/composite/compoverlay.c new file mode 100644 index 000000000..dfe59f3cf --- /dev/null +++ b/nx-X11/programs/Xserver/composite/compoverlay.c @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Copyright © 2003 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "compint.h" +#ifndef NXAGENT_SERVER +#include "xace.h" +#endif + +#ifdef PANORAMIX +#include "panoramiXsrv.h" +#endif + +/* + * Delete the given overlay client list element from its screen list. + */ +void +compFreeOverlayClient(CompOverlayClientPtr pOcToDel) +{ + ScreenPtr pScreen = pOcToDel->pScreen; + CompScreenPtr cs = GetCompScreen(pScreen); + CompOverlayClientPtr *pPrev, pOc; + + for (pPrev = &cs->pOverlayClients; (pOc = *pPrev); pPrev = &pOc->pNext) { + if (pOc == pOcToDel) { + *pPrev = pOc->pNext; + free(pOc); + break; + } + } + + /* Destroy overlay window when there are no more clients using it */ + if (cs->pOverlayClients == NULL) + compDestroyOverlayWindow(pScreen); +} + +/* + * Return the client's first overlay client rec from the given screen + */ +CompOverlayClientPtr +compFindOverlayClient(ScreenPtr pScreen, ClientPtr pClient) +{ + CompScreenPtr cs = GetCompScreen(pScreen); + CompOverlayClientPtr pOc; + + for (pOc = cs->pOverlayClients; pOc != NULL; pOc = pOc->pNext) + if (pOc->pClient == pClient) + return pOc; + + return NULL; +} + +/* + * Create an overlay client object for the given client + */ +CompOverlayClientPtr +compCreateOverlayClient(ScreenPtr pScreen, ClientPtr pClient) +{ + CompScreenPtr cs = GetCompScreen(pScreen); + CompOverlayClientPtr pOc; + + pOc = (CompOverlayClientPtr) malloc(sizeof(CompOverlayClientRec)); + if (pOc == NULL) + return NULL; + + pOc->pClient = pClient; + pOc->pScreen = pScreen; + pOc->resource = FakeClientID(pClient->index); + pOc->pNext = cs->pOverlayClients; + cs->pOverlayClients = pOc; + + /* + * Create a resource for this element so it can be deleted + * when the client goes away. + */ + if (!AddResource(pOc->resource, CompositeClientOverlayType, (void *) pOc)) + return NULL; + + return pOc; +} + +/* + * Create the overlay window and map it + */ +Bool +compCreateOverlayWindow(ScreenPtr pScreen) +{ + CompScreenPtr cs = GetCompScreen(pScreen); + WindowPtr pRoot = WindowTable[pScreen->myNum]; + WindowPtr pWin; + XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */ + int result; + int w = pScreen->width; + int h = pScreen->height; + int x = 0, y = 0; + + /* Unsupported by current architecture, disabled. */ +#if 0 +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + x = -pScreen->x; + y = -pScreen->y; + w = PanoramiXPixWidth; + h = PanoramiXPixHeight; + } +#endif +#endif + + pWin = cs->pOverlayWin = + CreateWindow(cs->overlayWid, pRoot, x, y, w, h, 0, + InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0], + pRoot->drawable.depth, + serverClient, pScreen->rootVisual, &result); + if (pWin == NULL) + return FALSE; + + if (!AddResource(pWin->drawable.id, RT_WINDOW, (void *) pWin)) + return FALSE; + + MapWindow(pWin, serverClient); + + return TRUE; +} + +/* + * Destroy the overlay window + */ +void +compDestroyOverlayWindow(ScreenPtr pScreen) +{ + CompScreenPtr cs = GetCompScreen(pScreen); + + cs->pOverlayWin = NullWindow; + FreeResource(cs->overlayWid, RT_NONE); +} diff --git a/nx-X11/programs/Xserver/composite/compwindow.c b/nx-X11/programs/Xserver/composite/compwindow.c index fbdc44420..799aad023 100644 --- a/nx-X11/programs/Xserver/composite/compwindow.c +++ b/nx-X11/programs/Xserver/composite/compwindow.c @@ -28,6 +28,10 @@ #include "compint.h" +#ifdef PANORAMIX +#include "panoramiXsrv.h" +#endif + #ifdef COMPOSITE_DEBUG static int compCheckWindow (WindowPtr pWin, void * data) @@ -39,10 +43,10 @@ compCheckWindow (WindowPtr pWin, void * data) if (!pWin->parent) { - assert (!pWin->redirectDraw); + assert (pWin->redirectDraw == RedriectDrawNone); assert (pWinPixmap == pScreenPixmap); } - else if (pWin->redirectDraw) + else if (pWin->redirectDraw != RedirectDrawNone) { assert (pWinPixmap != pParentPixmap); assert (pWinPixmap != pScreenPixmap); @@ -73,15 +77,27 @@ typedef struct _compPixmapVisit { static Bool compRepaintBorder (ClientPtr pClient, void * closure) { - WindowPtr pWindow = LookupWindow ((XID) closure, pClient); + WindowPtr pWindow; +#ifndef NXAGENT_SERVER + int rc = + dixLookupWindow(&pWindow, (XID) (intptr_t) closure, pClient, + DixWriteAccess); +#else + pWindow = SecurityLookupWindow((XID) (intptr_t) closure, pClient, SecurityWriteAccess); + int rc = pWindow ? Success : BadWindow; +#endif - if (pWindow) + if (rc == Success) { RegionRec exposed; RegionNull(&exposed); RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize); +#ifndef NXAGENT_SERVER + pWindow->drawable.pScreen->PaintWindowBorder(pWindow, &exposed, PW_BORDER); +#else (*pWindow->drawable.pScreen->PaintWindowBorder)(pWindow, &exposed, PW_BORDER); +#endif RegionUninit(&exposed); } return TRUE; @@ -93,7 +109,7 @@ compSetPixmapVisitWindow (WindowPtr pWindow, void * data) CompPixmapVisitPtr pVisit = (CompPixmapVisitPtr) data; ScreenPtr pScreen = pWindow->drawable.pScreen; - if (pWindow != pVisit->pWindow && pWindow->redirectDraw) + if (pWindow != pVisit->pWindow && pWindow->redirectDraw != RedirectDrawNone) return WT_DONTWALKCHILDREN; (*pScreen->SetWindowPixmap) (pWindow, pVisit->pPixmap); /* @@ -105,7 +121,7 @@ compSetPixmapVisitWindow (WindowPtr pWindow, void * data) SetBorderSize (pWindow); if (HasBorder (pWindow)) QueueWorkProc (compRepaintBorder, serverClient, - (void *) pWindow->drawable.id); + (void *) (intptr_t) pWindow->drawable.id); return WT_WALKCHILDREN; } @@ -124,21 +140,73 @@ Bool compCheckRedirect (WindowPtr pWin) { CompWindowPtr cw = GetCompWindow (pWin); + CompScreenPtr cs = GetCompScreen(pWin->drawable.pScreen); Bool should; should = pWin->realized && (pWin->drawable.class != InputOnly) && - (cw != NULL); + (cw != NULL) && (pWin->parent != NULL); - if (should != pWin->redirectDraw) + /* Never redirect the overlay window */ + if (cs->pOverlayWin != NULL) { + if (pWin == cs->pOverlayWin) { + should = FALSE; + } + } + + if (should != (pWin->redirectDraw != RedirectDrawNone)) { if (should) return compAllocPixmap (pWin); + else { + ScreenPtr pScreen = pWin->drawable.pScreen; + PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); + + compSetParentPixmap(pWin); + compRestoreWindow(pWin, pPixmap); + (*pScreen->DestroyPixmap) (pPixmap); + } + } + else if (should) { + if (cw->update == CompositeRedirectAutomatic) + pWin->redirectDraw = RedirectDrawAutomatic; else - compFreePixmap (pWin); + pWin->redirectDraw = RedirectDrawManual; } return TRUE; } +static int +updateOverlayWindow(ScreenPtr pScreen) +{ + CompScreenPtr cs; + WindowPtr pWin; /* overlay window */ + XID vlist[2]; + int w = pScreen->width; + int h = pScreen->height; + +#ifdef PANORAMIX + if (!noPanoramiXExtension) { + w = PanoramiXPixWidth; + h = PanoramiXPixHeight; + } +#endif + + cs = GetCompScreen(pScreen); + if ((pWin = cs->pOverlayWin) != NULL) { + if ((pWin->drawable.width == w) && (pWin->drawable.height == h)) + return Success; + + /* Let's resize the overlay window. */ + vlist[0] = w; + vlist[1] = h; + return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin)); + } + + /* Let's be on the safe side and not assume an overlay window is + always allocated. */ + return Success; +} + Bool compPositionWindow (WindowPtr pWin, int x, int y) { @@ -153,10 +221,11 @@ compPositionWindow (WindowPtr pWin, int x, int y) compCheckRedirect (pWin); */ #ifdef COMPOSITE_DEBUG - if (pWin->redirectDraw != (pWin->viewable && (GetCompWindow(pWin) != NULL))) + if ((pWin->redirectDraw != RedirectDrawNone) != + (pWin->viewable && (GetCompWindow(pWin) != NULL))) abort (); #endif - if (pWin->redirectDraw) + if (pWin->redirectDraw != RedirectDrawNone) { PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); int bw = wBorderWidth (pWin); @@ -176,6 +245,8 @@ compPositionWindow (WindowPtr pWin, int x, int y) cs->PositionWindow = pScreen->PositionWindow; pScreen->PositionWindow = compPositionWindow; compCheckTree (pWin->drawable.pScreen); + if (updateOverlayWindow(pScreen) != Success) + ret = FALSE; return ret; } @@ -213,21 +284,6 @@ compUnrealizeWindow (WindowPtr pWin) return ret; } -void -compPaintWindowBackground (WindowPtr pWin, RegionPtr pRegion, int what) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - CompSubwindowsPtr csw = GetCompSubwindows (pWin); - CompScreenPtr cs = GetCompScreen (pScreen); - - if (csw && csw->update == CompositeRedirectManual) - return; - pScreen->PaintWindowBackground = cs->PaintWindowBackground; - (*pScreen->PaintWindowBackground) (pWin, pRegion, what); - cs->PaintWindowBackground = pScreen->PaintWindowBackground; - pScreen->PaintWindowBackground = compPaintWindowBackground; -} - /* * Called after the borderClip for the window has settled down * We use this to make sure our extra borderClip has the right origin @@ -273,12 +329,27 @@ compIsAlternateVisual (ScreenPtr pScreen, CompScreenPtr cs = GetCompScreen (pScreen); int i; - for (i = 0; i < NUM_COMP_ALTERNATE_VISUALS; i++) + for (i = 0; i < cs->numAlternateVisuals; i++) if (cs->alternateVisuals[i] == visual) return TRUE; return FALSE; } +static Bool +compIsImplicitRedirectException(ScreenPtr pScreen, + XID parentVisual, XID winVisual) +{ + CompScreenPtr cs = GetCompScreen(pScreen); + int i; + + for (i = 0; i < cs->numImplicitRedirectExceptions; i++) + if (cs->implicitRedirectExceptions[i].parentVisual == parentVisual && + cs->implicitRedirectExceptions[i].winVisual == winVisual) + return TRUE; + + return FALSE; +} + static Bool compImplicitRedirect (WindowPtr pWin, WindowPtr pParent) { @@ -287,6 +358,9 @@ compImplicitRedirect (WindowPtr pWin, WindowPtr pParent) ScreenPtr pScreen = pWin->drawable.pScreen; XID winVisual = wVisual (pWin); XID parentVisual = wVisual (pParent); + + if (compIsImplicitRedirectException(pScreen, parentVisual, winVisual)) + return FALSE; if (winVisual != parentVisual && (compIsAlternateVisual (pScreen, winVisual) || @@ -296,6 +370,21 @@ compImplicitRedirect (WindowPtr pWin, WindowPtr pParent) return FALSE; } +static void +compFreeOldPixmap(WindowPtr pWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + + if (pWin->redirectDraw != RedirectDrawNone) { + CompWindowPtr cw = GetCompWindow(pWin); + + if (cw->pOldPixmap) { + (*pScreen->DestroyPixmap) (cw->pOldPixmap); + cw->pOldPixmap = NullPixmap; + } + } +} + void compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind) { @@ -303,8 +392,7 @@ compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind) CompScreenPtr cs = GetCompScreen (pScreen); compCheckTree (pScreen); - if (pWin->redirectDraw) - { + if (pWin->redirectDraw != RedirectDrawNone) { WindowPtr pParent; int draw_x, draw_y; unsigned int w, h, bw; @@ -312,7 +400,7 @@ compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind) /* if this is a root window, can't be moved */ if (!(pParent = pWin->parent)) return; - + bw = wBorderWidth (pWin); draw_x = pParent->drawable.x + x + (int)bw; draw_y = pParent->drawable.y + y + (int)bw; @@ -327,16 +415,7 @@ compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind) cs->MoveWindow = pScreen->MoveWindow; pScreen->MoveWindow = compMoveWindow; - if (pWin->redirectDraw) - { - CompWindowPtr cw = GetCompWindow (pWin); - if (cw->pOldPixmap) - { - (*pScreen->DestroyPixmap) (cw->pOldPixmap); - cw->pOldPixmap = NullPixmap; - } - } - + compFreeOldPixmap(pWin); compCheckTree (pScreen); } @@ -348,12 +427,12 @@ compResizeWindow (WindowPtr pWin, int x, int y, CompScreenPtr cs = GetCompScreen (pScreen); compCheckTree (pScreen); - if (pWin->redirectDraw) + if (pWin->redirectDraw != RedirectDrawNone) { WindowPtr pParent; int draw_x, draw_y; unsigned int bw; - + /* if this is a root window, can't be moved */ if (!(pParent = pWin->parent)) return; @@ -364,20 +443,13 @@ compResizeWindow (WindowPtr pWin, int x, int y, compReallocPixmap (pWin, draw_x, draw_y, w, h, bw); } compCheckTree (pScreen); - + pScreen->ResizeWindow = cs->ResizeWindow; (*pScreen->ResizeWindow) (pWin, x, y, w, h, pSib); cs->ResizeWindow = pScreen->ResizeWindow; pScreen->ResizeWindow = compResizeWindow; - if (pWin->redirectDraw) - { - CompWindowPtr cw = GetCompWindow (pWin); - if (cw->pOldPixmap) - { - (*pScreen->DestroyPixmap) (cw->pOldPixmap); - cw->pOldPixmap = NullPixmap; - } - } + + compFreeOldPixmap(pWin); compCheckTree (pWin->drawable.pScreen); } @@ -388,37 +460,30 @@ compChangeBorderWidth (WindowPtr pWin, unsigned int bw) CompScreenPtr cs = GetCompScreen (pScreen); compCheckTree (pScreen); - if (pWin->redirectDraw) + if (pWin->redirectDraw != RedirectDrawNone) { WindowPtr pParent; int draw_x, draw_y; unsigned int w, h; - + /* if this is a root window, can't be moved */ if (!(pParent = pWin->parent)) return; - + draw_x = pWin->drawable.x; draw_y = pWin->drawable.y; w = pWin->drawable.width; h = pWin->drawable.height; compReallocPixmap (pWin, draw_x, draw_y, w, h, bw); } - compCheckTree (pScreen); + compCheckTree (pScreen); pScreen->ChangeBorderWidth = cs->ChangeBorderWidth; (*pScreen->ChangeBorderWidth) (pWin, bw); cs->ChangeBorderWidth = pScreen->ChangeBorderWidth; pScreen->ChangeBorderWidth = compChangeBorderWidth; - if (pWin->redirectDraw) - { - CompWindowPtr cw = GetCompWindow (pWin); - if (cw->pOldPixmap) - { - (*pScreen->DestroyPixmap) (cw->pOldPixmap); - cw->pOldPixmap = NullPixmap; - } - } + + compFreeOldPixmap(pWin); compCheckTree (pWin->drawable.pScreen); } @@ -454,7 +519,7 @@ compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent) /* * Reset pixmap pointers as appropriate */ - if (pWin->parent && !pWin->redirectDraw) + if (pWin->parent && pWin->redirectDraw == RedirectDrawNone) compSetPixmap (pWin, (*pScreen->GetWindowPixmap) (pWin->parent)); /* * Call down to next function @@ -473,7 +538,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) CompScreenPtr cs = GetCompScreen (pScreen); int dx = 0, dy = 0; - if (pWin->redirectDraw) + if (pWin->redirectDraw != RedirectDrawNone) { PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); CompWindowPtr cw = GetCompWindow (pWin); @@ -487,7 +552,6 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) * need to be copied to pNewPixmap. */ RegionRec rgnDst; - PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); GCPtr pGC; dx = ptOldOrg.x - pWin->drawable.x; @@ -524,6 +588,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } FreeScratchGC (pGC); } + RegionUninit (&rgnDst); return; } dx = pPixmap->screen_x - cw->oldx; @@ -568,8 +633,11 @@ compCreateWindow (WindowPtr pWin) { CompSubwindowsPtr csw = GetCompSubwindows (pWin->parent); CompClientWindowPtr ccw; + PixmapPtr parent_pixmap = (*pScreen->GetWindowPixmap)(pWin->parent); + PixmapPtr window_pixmap = (*pScreen->GetWindowPixmap)(pWin); - (*pScreen->SetWindowPixmap) (pWin, (*pScreen->GetWindowPixmap) (pWin->parent)); + if (window_pixmap != parent_pixmap) + (*pScreen->SetWindowPixmap) (pWin, parent_pixmap); if (csw) for (ccw = csw->clients; ccw; ccw = ccw->next) compRedirectWindow (clients[CLIENT_ID(ccw->id)], @@ -598,8 +666,12 @@ compDestroyWindow (WindowPtr pWin) while ((csw = GetCompSubwindows (pWin))) FreeResource (csw->clients->id, RT_NONE); - if (pWin->redirectDraw) - compFreePixmap (pWin); + if (pWin->redirectDraw != RedirectDrawNone) { + PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); + + compSetParentPixmap (pWin); + (*pScreen->DestroyPixmap) (pPixmap); + } ret = (*pScreen->DestroyWindow) (pWin); cs->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = compDestroyWindow; @@ -658,7 +730,7 @@ compGetWindowVisual (WindowPtr pWin) return 0; } -static PictFormatPtr +PictFormatPtr compWindowFormat (WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; @@ -735,21 +807,103 @@ compWindowUpdateAutomatic (WindowPtr pWin) DamageEmpty (cw->damage); } +static void +compPaintWindowToParent(WindowPtr pWin) +{ + compPaintChildrenToWindow(pWin->drawable.pScreen, pWin); + + if (pWin->redirectDraw != RedirectDrawNone) { + CompWindowPtr cw = GetCompWindow(pWin); + + if (cw->damaged) { + compWindowUpdateAutomatic(pWin); + cw->damaged = FALSE; + } + } +} + void -compWindowUpdate (WindowPtr pWin) +compPaintChildrenToWindow(ScreenPtr pScreen, WindowPtr pWin) { WindowPtr pChild; + CompScreenPtr cs = GetCompScreen(pScreen); + + if (!cs->damaged) + return; for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib) - compWindowUpdate (pChild); - if (pWin->redirectDraw) - { - CompWindowPtr cw = GetCompWindow(pWin); + compPaintWindowToParent(pChild); - if (cw->damaged) - { - compWindowUpdateAutomatic (pWin); - cw->damaged = FALSE; + cs->damaged = FALSE; +} + +WindowPtr +CompositeRealChildHead(WindowPtr pWin) +{ + WindowPtr pChild, pChildBefore; + CompScreenPtr cs; + + if (!pWin->parent && + (screenIsSaved == SCREEN_SAVER_ON) && + (HasSaverWindow(pWin->drawable.pScreen->myNum))) { + + /* First child is the screen saver; see if next child is the overlay */ + pChildBefore = pWin->firstChild; + pChild = pChildBefore->nextSib; + + } + else { + pChildBefore = NullWindow; + pChild = pWin->firstChild; + } + + if (!pChild) { + return NullWindow; + } + + cs = GetCompScreen(pWin->drawable.pScreen); + if (pChild == cs->pOverlayWin) { + return pChild; + } + else { + return pChildBefore; } +} + +/* ConfigNotify not implemented... replace with the old pixmap reallocation algorithm... */ +/* +int +compConfigNotify(WindowPtr pWin, int x, int y, int w, int h, + int bw, WindowPtr pSib) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + CompScreenPtr cs = GetCompScreen(pScreen); + Bool ret = 0; + WindowPtr pParent = pWin->parent; + int draw_x, draw_y; + Bool alloc_ret; + + if (cs->ConfigNotify) { + pScreen->ConfigNotify = cs->ConfigNotify; + ret = (*pScreen->ConfigNotify) (pWin, x, y, w, h, bw, pSib); + cs->ConfigNotify = pScreen->ConfigNotify; + pScreen->ConfigNotify = compConfigNotify; + + if (ret) + return ret; } + + if (pWin->redirectDraw == RedirectDrawNone) + return Success; + + compCheckTree(pScreen); + + draw_x = pParent->drawable.x + x + bw; + draw_y = pParent->drawable.y + y + bw; + alloc_ret = compReallocPixmap(pWin, draw_x, draw_y, w, h, bw); + + if (alloc_ret == FALSE) + return BadAlloc; + return Success; } +*/ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXcompositeext.h b/nx-X11/programs/Xserver/hw/nxagent/NXcompositeext.h index b4433d6c1..38ac87e9b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXcompositeext.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXcompositeext.h @@ -33,7 +33,7 @@ #define COMPOSITE_NAME "Composite" #define COMPOSITE_MAJOR 0 -#define COMPOSITE_MINOR 2 +#define COMPOSITE_MINOR 4 #define CompositeRedirectAutomatic 0 #define CompositeRedirectManual 1 @@ -45,7 +45,11 @@ #define X_CompositeUnredirectSubwindows 4 #define X_CompositeCreateRegionFromBorderClip 5 #define X_CompositeNameWindowPixmap 6 +#define X_CompositeGetOverlayWindow 7 +#define X_CompositeReleaseOverlayWindow 8 -#define CompositeNumberRequests (X_CompositeNameWindowPixmap + 1) +#define CompositeNumberRequests (X_CompositeReleaseOverlayWindow + 1) + +#define CompositeNumberEvents 0 #endif /* _COMPOSITE_H_ */ -- cgit v1.2.3 From 104a3e9e2dbafd31e7b1def3686d052a356fc74a Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 15 Feb 2017 09:59:00 +0100 Subject: Naming change: Security*Access -> Dix*Access Backported from X.org: commit 6c46645cfc1afda8aeabfe0ed4d9342673b702f1 Author: Eamon Walsh Date: Thu Dec 14 14:45:42 2006 -0500 Naming change: Security*Access -> Dix*Access Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/Xext/panoramiXprocs.c | 172 ++++++++++++------------ nx-X11/programs/Xserver/Xext/saver.c | 10 +- nx-X11/programs/Xserver/Xext/security.c | 10 +- nx-X11/programs/Xserver/Xext/shape.c | 22 +-- nx-X11/programs/Xserver/Xext/shm.c | 6 +- nx-X11/programs/Xserver/Xext/sync.c | 16 +-- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 4 +- nx-X11/programs/Xserver/Xext/xvdisp.c | 30 ++--- nx-X11/programs/Xserver/composite/compwindow.c | 2 +- nx-X11/programs/Xserver/damageext/damageext.c | 10 +- nx-X11/programs/Xserver/dbe/dbe.c | 12 +- nx-X11/programs/Xserver/dix/colormap.c | 4 +- nx-X11/programs/Xserver/dix/cursor.c | 4 +- nx-X11/programs/Xserver/dix/dispatch.c | 116 ++++++++-------- nx-X11/programs/Xserver/dix/dixfonts.c | 8 +- nx-X11/programs/Xserver/dix/dixutils.c | 6 +- nx-X11/programs/Xserver/dix/events.c | 38 +++--- nx-X11/programs/Xserver/dix/gc.c | 8 +- nx-X11/programs/Xserver/dix/property.c | 20 +-- nx-X11/programs/Xserver/dix/resource.c | 4 +- nx-X11/programs/Xserver/dix/window.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 16 +-- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 10 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 48 +++---- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 10 +- nx-X11/programs/Xserver/include/dix.h | 10 +- nx-X11/programs/Xserver/include/resource.h | 8 +- nx-X11/programs/Xserver/randr/randrstr.h | 8 +- nx-X11/programs/Xserver/randr/rrdispatch.c | 2 +- nx-X11/programs/Xserver/randr/rrmode.c | 2 +- nx-X11/programs/Xserver/randr/rrmonitor.c | 6 +- nx-X11/programs/Xserver/randr/rroutput.c | 4 +- nx-X11/programs/Xserver/randr/rrprovider.c | 2 +- nx-X11/programs/Xserver/randr/rrscreen.c | 10 +- nx-X11/programs/Xserver/randr/rrxinerama.c | 6 +- nx-X11/programs/Xserver/render/picture.c | 4 +- nx-X11/programs/Xserver/render/render.c | 122 ++++++++--------- nx-X11/programs/Xserver/xfixes/cursor.c | 12 +- nx-X11/programs/Xserver/xfixes/region.c | 46 +++---- nx-X11/programs/Xserver/xfixes/saveset.c | 2 +- nx-X11/programs/Xserver/xfixes/select.c | 2 +- 43 files changed, 421 insertions(+), 425 deletions(-) (limited to 'nx-X11/programs/Xserver/composite/compwindow.c') diff --git a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c index 9da3328f8..906fdd137 100644 --- a/nx-X11/programs/Xserver/Xext/panoramiXprocs.c +++ b/nx-X11/programs/Xserver/Xext/panoramiXprocs.c @@ -89,7 +89,7 @@ int PanoramiXCreateWindow(ClientPtr client) return BadLength; if (!(parent = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->parent, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->parent, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(stuff->class == CopyFromParent) @@ -103,7 +103,7 @@ int PanoramiXCreateWindow(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -112,7 +112,7 @@ int PanoramiXCreateWindow(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -121,7 +121,7 @@ int PanoramiXCreateWindow(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_COLORMAP, SecurityReadAccess))) + client, tmp, XRT_COLORMAP, DixReadAccess))) return BadColor; } } @@ -190,7 +190,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client) return BadLength; if (!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; if((win->u.win.class == InputOnly) && @@ -202,7 +202,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -211,7 +211,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -220,7 +220,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client) tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_COLORMAP, SecurityReadAccess))) + client, tmp, XRT_COLORMAP, DixReadAccess))) return BadColor; } } @@ -249,7 +249,7 @@ int PanoramiXDestroyWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityDestroyAccess))) + client, stuff->id, XRT_WINDOW, DixDestroyAccess))) return BadWindow; FOR_NSCREENS_BACKWARD(j) { @@ -274,7 +274,7 @@ int PanoramiXDestroySubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityDestroyAccess))) + client, stuff->id, XRT_WINDOW, DixDestroyAccess))) return BadWindow; FOR_NSCREENS_BACKWARD(j) { @@ -299,7 +299,7 @@ int PanoramiXChangeSaveSet(ClientPtr client) REQUEST_SIZE_MATCH(xChangeSaveSetReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityReadAccess))) + client, stuff->window, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_BACKWARD(j) { @@ -323,11 +323,11 @@ int PanoramiXReparentWindow(ClientPtr client) REQUEST_SIZE_MATCH(xReparentWindowReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(!(parent = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->parent, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->parent, XRT_WINDOW, DixWriteAccess))) return BadWindow; x = stuff->x; @@ -358,7 +358,7 @@ int PanoramiXMapWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityReadAccess))) + client, stuff->id, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -380,7 +380,7 @@ int PanoramiXMapSubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityReadAccess))) + client, stuff->id, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -402,7 +402,7 @@ int PanoramiXUnmapWindow(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityReadAccess))) + client, stuff->id, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -424,7 +424,7 @@ int PanoramiXUnmapSubwindows(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_WINDOW, SecurityReadAccess))) + client, stuff->id, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -455,11 +455,11 @@ int PanoramiXConfigureWindow(ClientPtr client) /* because we need the parent */ if (!(pWin = (WindowPtr)SecurityLookupIDByType( - client, stuff->window, RT_WINDOW, SecurityWriteAccess))) + client, stuff->window, RT_WINDOW, DixWriteAccess))) return BadWindow; if (!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; if ((Mask)stuff->mask & CWSibling) { @@ -467,7 +467,7 @@ int PanoramiXConfigureWindow(ClientPtr client) sib_offset = Ones((Mask)stuff->mask & (CWSibling - 1)); if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) { if(!(sib = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_WINDOW, SecurityReadAccess))) + client, tmp, XRT_WINDOW, DixReadAccess))) return BadWindow; } } @@ -512,7 +512,7 @@ int PanoramiXCirculateWindow(ClientPtr client) REQUEST_SIZE_MATCH(xCirculateWindowReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; FOR_NSCREENS_FORWARD(j) { @@ -577,11 +577,11 @@ int PanoramiXTranslateCoords(ClientPtr client) REQUEST_SIZE_MATCH(xTranslateCoordsReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, - SecurityReadAccess); + DixReadAccess); if (!pDst) return(BadWindow); rep.type = X_Reply; @@ -653,7 +653,7 @@ int PanoramiXCreatePixmap(ClientPtr client) client->errorValue = stuff->pid; if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixReadAccess))) return BadDrawable; if(!(newPix = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) @@ -692,7 +692,7 @@ int PanoramiXFreePixmap(ClientPtr client) client->errorValue = stuff->id; if(!(pix = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_PIXMAP, SecurityDestroyAccess))) + client, stuff->id, XRT_PIXMAP, DixDestroyAccess))) return BadPixmap; FOR_NSCREENS_BACKWARD(j) { @@ -728,14 +728,14 @@ int PanoramiXCreateGC(ClientPtr client) return BadLength; if (!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixReadAccess))) return BadDrawable; if ((Mask)stuff->mask & GCTile) { tile_offset = Ones((Mask)stuff->mask & (GCTile - 1)); if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { if(!(tile = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -743,7 +743,7 @@ int PanoramiXCreateGC(ClientPtr client) stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1)); if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { if(!(stip = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -751,7 +751,7 @@ int PanoramiXCreateGC(ClientPtr client) clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1)); if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { if(!(clip = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -803,14 +803,14 @@ int PanoramiXChangeGC(ClientPtr client) return BadLength; if (!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if ((Mask)stuff->mask & GCTile) { tile_offset = Ones((Mask)stuff->mask & (GCTile - 1)); if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) { if(!(tile = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -818,7 +818,7 @@ int PanoramiXChangeGC(ClientPtr client) stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1)); if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) { if(!(stip = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -826,7 +826,7 @@ int PanoramiXChangeGC(ClientPtr client) clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1)); if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) { if(!(clip = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -857,11 +857,11 @@ int PanoramiXCopyGC(ClientPtr client) REQUEST_SIZE_MATCH(xCopyGCReq); if(!(srcGC = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->srcGC, XRT_GC, SecurityReadAccess))) + client, stuff->srcGC, XRT_GC, DixReadAccess))) return BadGC; if(!(dstGC = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dstGC, XRT_GC, SecurityWriteAccess))) + client, stuff->dstGC, XRT_GC, DixWriteAccess))) return BadGC; FOR_NSCREENS(j) { @@ -884,7 +884,7 @@ int PanoramiXSetDashes(ClientPtr client) REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityWriteAccess))) + client, stuff->gc, XRT_GC, DixWriteAccess))) return BadGC; FOR_NSCREENS_BACKWARD(j) { @@ -906,7 +906,7 @@ int PanoramiXSetClipRectangles(ClientPtr client) REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityWriteAccess))) + client, stuff->gc, XRT_GC, DixWriteAccess))) return BadGC; FOR_NSCREENS_BACKWARD(j) { @@ -928,7 +928,7 @@ int PanoramiXFreeGC(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_GC, SecurityDestroyAccess))) + client, stuff->id, XRT_GC, DixDestroyAccess))) return BadGC; FOR_NSCREENS_BACKWARD(j) { @@ -954,7 +954,7 @@ int PanoramiXClearToBackground(ClientPtr client) REQUEST_SIZE_MATCH(xClearAreaReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->window, XRT_WINDOW, DixWriteAccess))) return BadWindow; x = stuff->x; @@ -996,13 +996,13 @@ int PanoramiXCopyArea(ClientPtr client) REQUEST_SIZE_MATCH(xCopyAreaReq); if(!(src = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess))) + client, stuff->srcDrawable, XRC_DRAWABLE, DixReadAccess))) return BadDrawable; srcShared = IS_SHARED_PIXMAP(src); if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->dstDrawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; dstShared = IS_SHARED_PIXMAP(dst); @@ -1011,7 +1011,7 @@ int PanoramiXCopyArea(ClientPtr client) return (* SavedProcVector[X_CopyArea])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if((dst->type == XRT_WINDOW) && dst->u.win.root) @@ -1080,7 +1080,7 @@ int PanoramiXCopyArea(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client); if (stuff->dstDrawable != stuff->srcDrawable) { SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, - SecurityReadAccess); + DixReadAccess); if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) { client->errorValue = stuff->dstDrawable; @@ -1144,13 +1144,13 @@ int PanoramiXCopyPlane(ClientPtr client) REQUEST_SIZE_MATCH(xCopyPlaneReq); if(!(src = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess))) + client, stuff->srcDrawable, XRC_DRAWABLE, DixReadAccess))) return BadDrawable; srcShared = IS_SHARED_PIXMAP(src); if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->dstDrawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; dstShared = IS_SHARED_PIXMAP(dst); @@ -1159,7 +1159,7 @@ int PanoramiXCopyPlane(ClientPtr client) return (* SavedProcVector[X_CopyPlane])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if((dst->type == XRT_WINDOW) && dst->u.win.root) @@ -1186,7 +1186,7 @@ int PanoramiXCopyPlane(ClientPtr client) VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client); if (stuff->dstDrawable != stuff->srcDrawable) { SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, - SecurityReadAccess); + DixReadAccess); if (pdstDraw->pScreen != psrcDraw->pScreen) { client->errorValue = stuff->dstDrawable; return (BadMatch); @@ -1244,14 +1244,14 @@ int PanoramiXPolyPoint(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyPointReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyPoint])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1302,14 +1302,14 @@ int PanoramiXPolyLine(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyLineReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyLine])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1360,14 +1360,14 @@ int PanoramiXPolySegment(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolySegmentReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolySegment])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1422,14 +1422,14 @@ int PanoramiXPolyRectangle(ClientPtr client) if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyRectangle])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1482,14 +1482,14 @@ int PanoramiXPolyArc(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyArcReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyArc])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1540,14 +1540,14 @@ int PanoramiXFillPoly(ClientPtr client) REQUEST_AT_LEAST_SIZE(xFillPolyReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_FillPoly])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1599,14 +1599,14 @@ int PanoramiXPolyFillRectangle(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyFillRectangle])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1658,14 +1658,14 @@ int PanoramiXPolyFillArc(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyFillArcReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyFillArc])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1716,14 +1716,14 @@ int PanoramiXPutImage(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PutImage])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1767,7 +1767,7 @@ int PanoramiXGetImage(ClientPtr client) } if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(draw->type == XRT_PIXMAP) @@ -1907,14 +1907,14 @@ PanoramiXPolyText8(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyTextReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyText8])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1946,14 +1946,14 @@ PanoramiXPolyText16(ClientPtr client) REQUEST_AT_LEAST_SIZE(xPolyTextReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_PolyText16])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1985,14 +1985,14 @@ int PanoramiXImageText8(ClientPtr client) REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_ImageText8])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -2024,14 +2024,14 @@ int PanoramiXImageText16(ClientPtr client) REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(IS_SHARED_PIXMAP(draw)) return (*SavedProcVector[X_ImageText16])(client); if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -2062,7 +2062,7 @@ int PanoramiXCreateColormap(ClientPtr client) REQUEST_SIZE_MATCH(xCreateColormapReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->window, XRT_WINDOW, SecurityReadAccess))) + client, stuff->window, XRT_WINDOW, DixReadAccess))) return BadWindow; if(!stuff->visual || (stuff->visual > 255)) @@ -2105,7 +2105,7 @@ int PanoramiXFreeColormap(ClientPtr client) client->errorValue = stuff->id; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_COLORMAP, SecurityDestroyAccess))) + client, stuff->id, XRT_COLORMAP, DixDestroyAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j) { @@ -2134,7 +2134,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client) if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( client, stuff->srcCmap, XRT_COLORMAP, - SecurityReadAccess | SecurityWriteAccess))) + DixReadAccess | DixWriteAccess))) return BadColor; if(!(newCmap = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) @@ -2172,7 +2172,7 @@ int PanoramiXInstallColormap(ClientPtr client) client->errorValue = stuff->id; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_COLORMAP, SecurityReadAccess))) + client, stuff->id, XRT_COLORMAP, DixReadAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2195,7 +2195,7 @@ int PanoramiXUninstallColormap(ClientPtr client) client->errorValue = stuff->id; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->id, XRT_COLORMAP, SecurityReadAccess))) + client, stuff->id, XRT_COLORMAP, DixReadAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j) { @@ -2218,7 +2218,7 @@ int PanoramiXAllocColor(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2241,7 +2241,7 @@ int PanoramiXAllocNamedColor(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2264,7 +2264,7 @@ int PanoramiXAllocColorCells(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2287,7 +2287,7 @@ int PanoramiXAllocColorPlanes(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2311,7 +2311,7 @@ int PanoramiXFreeColors(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j) { @@ -2333,7 +2333,7 @@ int PanoramiXStoreColors(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ @@ -2356,7 +2356,7 @@ int PanoramiXStoreNamedColor(ClientPtr client) client->errorValue = stuff->cmap; if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess))) + client, stuff->cmap, XRT_COLORMAP, DixWriteAccess))) return BadColor; FOR_NSCREENS_BACKWARD(j){ diff --git a/nx-X11/programs/Xserver/Xext/saver.c b/nx-X11/programs/Xserver/Xext/saver.c index 3e4fd8a95..06a967eb4 100644 --- a/nx-X11/programs/Xserver/Xext/saver.c +++ b/nx-X11/programs/Xserver/Xext/saver.c @@ -1199,7 +1199,7 @@ ProcScreenSaverSetAttributes (ClientPtr client) REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2); @@ -1211,7 +1211,7 @@ ProcScreenSaverSetAttributes (ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pback_offset); if ((tmp != None) && (tmp != ParentRelative)) { if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -1221,7 +1221,7 @@ ProcScreenSaverSetAttributes (ClientPtr client) tmp = *((CARD32 *) &stuff[1] + pbord_offset); if (tmp != CopyFromParent) { if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_PIXMAP, SecurityReadAccess))) + client, tmp, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } } @@ -1231,7 +1231,7 @@ ProcScreenSaverSetAttributes (ClientPtr client) tmp = *((CARD32 *) &stuff[1] + cmap_offset); if ((tmp != CopyFromParent) && (tmp != None)) { if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType( - client, tmp, XRT_COLORMAP, SecurityReadAccess))) + client, tmp, XRT_COLORMAP, DixReadAccess))) return BadColor; } } @@ -1271,7 +1271,7 @@ ProcScreenSaverUnsetAttributes (ClientPtr client) int i; if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; for(i = PanoramiXNumScreens - 1; i > 0; i--) { diff --git a/nx-X11/programs/Xserver/Xext/security.c b/nx-X11/programs/Xserver/Xext/security.c index 3a638460e..55a805aea 100644 --- a/nx-X11/programs/Xserver/Xext/security.c +++ b/nx-X11/programs/Xserver/Xext/security.c @@ -750,7 +750,7 @@ ProcSecurityRevokeAuthorization( REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq); pAuth = (SecurityAuthorizationPtr)SecurityLookupIDByType(client, - stuff->authId, SecurityAuthorizationResType, SecurityDestroyAccess); + stuff->authId, SecurityAuthorizationResType, DixDestroyAccess); if (!pAuth) return SecurityErrorBase + XSecurityBadAuthorization; @@ -1115,7 +1115,7 @@ SecurityCheckResourceIDAccess( int cid = CLIENT_ID(id); int reqtype = ((xReq *)client->requestBuffer)->reqType; - if (SecurityUnknownAccess == access_mode) + if (DixUnknownAccess == access_mode) return rval; /* for compatibility, we have to allow access */ switch (reqtype) @@ -2051,11 +2051,11 @@ SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode) * executed a continue, which will skip the follwing code. */ action = SecurityAllowOperation; - if (access_mode & SecurityReadAccess) + if (access_mode & DixReadAccess) action = max(action, pacl->readAction); - if (access_mode & SecurityWriteAccess) + if (access_mode & DixWriteAccess) action = max(action, pacl->writeAction); - if (access_mode & SecurityDestroyAccess) + if (access_mode & DixDestroyAccess) action = max(action, pacl->destroyAction); break; } /* end for each pacl */ diff --git a/nx-X11/programs/Xserver/Xext/shape.c b/nx-X11/programs/Xserver/Xext/shape.c index de597dead..cd29ec721 100644 --- a/nx-X11/programs/Xserver/Xext/shape.c +++ b/nx-X11/programs/Xserver/Xext/shape.c @@ -385,7 +385,7 @@ ProcPanoramiXShapeRectangles( REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -417,7 +417,7 @@ ProcShapeMask (client) REQUEST_SIZE_MATCH (xShapeMaskReq); UpdateCurrentTime(); - pWin = SecurityLookupWindow (stuff->dest, client, SecurityWriteAccess); + pWin = SecurityLookupWindow (stuff->dest, client, DixWriteAccess); if (!pWin) return BadWindow; switch (stuff->destKind) { @@ -439,7 +439,7 @@ ProcShapeMask (client) srcRgn = 0; else { pPixmap = (PixmapPtr) SecurityLookupIDByType(client, stuff->src, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if (!pPixmap) return BadPixmap; if (pPixmap->drawable.pScreen != pScreen || @@ -483,12 +483,12 @@ ProcPanoramiXShapeMask( REQUEST_SIZE_MATCH (xShapeMaskReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(stuff->src != None) { if(!(pmap = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->src, XRT_PIXMAP, SecurityReadAccess))) + client, stuff->src, XRT_PIXMAP, DixReadAccess))) return BadPixmap; } else pmap = NULL; @@ -611,11 +611,11 @@ ProcPanoramiXShapeCombine( REQUEST_AT_LEAST_SIZE (xShapeCombineReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; if(!(win2 = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->src, XRT_WINDOW, SecurityReadAccess))) + client, stuff->src, XRT_WINDOW, DixReadAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -683,7 +683,7 @@ ProcPanoramiXShapeOffset( REQUEST_AT_LEAST_SIZE (xShapeOffsetReq); if(!(win = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->dest, XRT_WINDOW, SecurityWriteAccess))) + client, stuff->dest, XRT_WINDOW, DixWriteAccess))) return BadWindow; FOR_NSCREENS(j) { @@ -817,11 +817,11 @@ ProcShapeSelectInput (client) XID clientResource; REQUEST_SIZE_MATCH (xShapeSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); + pWin = SecurityLookupWindow (stuff->window, client, DixWriteAccess); if (!pWin) return BadWindow; pHead = (ShapeEventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, SecurityWriteAccess); + pWin->drawable.id, EventType, DixWriteAccess); switch (stuff->enable) { case xTrue: if (pHead) { @@ -988,7 +988,7 @@ ProcShapeInputSelected (client) if (!pWin) return BadWindow; pHead = (ShapeEventPtr *) SecurityLookupIDByType(client, - pWin->drawable.id, EventType, SecurityReadAccess); + pWin->drawable.id, EventType, DixReadAccess); enabled = xFalse; if (pHead) { for (pShapeEvent = *pHead; diff --git a/nx-X11/programs/Xserver/Xext/shm.c b/nx-X11/programs/Xserver/Xext/shm.c index dc8bbf97b..e3fa3a24e 100644 --- a/nx-X11/programs/Xserver/Xext/shm.c +++ b/nx-X11/programs/Xserver/Xext/shm.c @@ -568,11 +568,11 @@ ProcPanoramiXShmPutImage(register ClientPtr client) REQUEST_SIZE_MATCH(xShmPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -618,7 +618,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) } if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if (draw->type == XRT_PIXMAP) diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index e1580b3a3..8cf6af562 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -425,7 +425,7 @@ SyncInitTrigger(client, pTrigger, counter, changes) if (counter == None) pCounter = NULL; else if (!(pCounter = (SyncCounter *)SecurityLookupIDByType( - client, counter, RTCounter, SecurityReadAccess))) + client, counter, RTCounter, DixReadAccess))) { client->errorValue = counter; return SyncErrorBase + XSyncBadCounter; @@ -1527,7 +1527,7 @@ ProcSyncSetCounter(client) REQUEST_SIZE_MATCH(xSyncSetCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->cid, - RTCounter, SecurityWriteAccess); + RTCounter, DixWriteAccess); if (pCounter == NULL) { client->errorValue = stuff->cid; @@ -1560,7 +1560,7 @@ ProcSyncChangeCounter(client) REQUEST_SIZE_MATCH(xSyncChangeCounterReq); pCounter = (SyncCounter *) SecurityLookupIDByType(client, stuff->cid, - RTCounter, SecurityWriteAccess); + RTCounter, DixWriteAccess); if (pCounter == NULL) { client->errorValue = stuff->cid; @@ -1598,7 +1598,7 @@ ProcSyncDestroyCounter(client) REQUEST_SIZE_MATCH(xSyncDestroyCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter, - RTCounter, SecurityDestroyAccess); + RTCounter, DixDestroyAccess); if (pCounter == NULL) { client->errorValue = stuff->counter; @@ -1744,7 +1744,7 @@ ProcSyncQueryCounter(client) REQUEST_SIZE_MATCH(xSyncQueryCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter, - RTCounter, SecurityReadAccess); + RTCounter, DixReadAccess); if (pCounter == NULL) { client->errorValue = stuff->counter; @@ -1872,7 +1872,7 @@ ProcSyncChangeAlarm(client) REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); if (!(pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityWriteAccess))) + RTAlarm, DixWriteAccess))) { client->errorValue = stuff->alarm; return SyncErrorBase + XSyncBadAlarm; @@ -1913,7 +1913,7 @@ ProcSyncQueryAlarm(client) REQUEST_SIZE_MATCH(xSyncQueryAlarmReq); pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityReadAccess); + RTAlarm, DixReadAccess); if (!pAlarm) { client->errorValue = stuff->alarm; @@ -1972,7 +1972,7 @@ ProcSyncDestroyAlarm(client) REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); if (!((SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityDestroyAccess))) + RTAlarm, DixDestroyAccess))) { client->errorValue = stuff->alarm; return SyncErrorBase + XSyncBadAlarm; diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 67a09f77b..6ec47c4f4 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -443,11 +443,11 @@ ProcXF86BigfontQueryFont( #endif client->errorValue = stuff->id; /* EITHER font or gc */ pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!pFont) { /* can't use VERIFY_GC because it might return BadGC */ GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, - SecurityReadAccess); + DixReadAccess); if (!pGC) { client->errorValue = stuff->id; return BadFont; /* procotol spec says only error is BadFont */ diff --git a/nx-X11/programs/Xserver/Xext/xvdisp.c b/nx-X11/programs/Xserver/Xext/xvdisp.c index 34f4537f2..b33bfa493 100644 --- a/nx-X11/programs/Xserver/Xext/xvdisp.c +++ b/nx-X11/programs/Xserver/Xext/xvdisp.c @@ -1854,11 +1854,11 @@ XineramaXvStopVideo(ClientPtr client) REQUEST_SIZE_MATCH(xvStopVideoReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; FOR_NSCREENS_BACKWARD(i) { @@ -1882,7 +1882,7 @@ XineramaXvSetPortAttribute(ClientPtr client) REQUEST_SIZE_MATCH(xvSetPortAttributeReq); if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; FOR_NSCREENS_BACKWARD(i) { @@ -1908,15 +1908,15 @@ XineramaXvShmPutImage(ClientPtr client) REQUEST_SIZE_MATCH(xvShmPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -1955,15 +1955,15 @@ XineramaXvPutImage(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -2000,15 +2000,15 @@ XineramaXvPutVideo(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutVideoReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; @@ -2045,15 +2045,15 @@ XineramaXvPutStill(ClientPtr client) REQUEST_AT_LEAST_SIZE(xvPutImageReq); if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(gc = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->gc, XRT_GC, SecurityReadAccess))) + client, stuff->gc, XRT_GC, DixReadAccess))) return BadGC; if(!(port = (PanoramiXRes *)SecurityLookupIDByType( - client, stuff->port, XvXRTPort, SecurityReadAccess))) + client, stuff->port, XvXRTPort, DixReadAccess))) return _XvBadPort; isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root; diff --git a/nx-X11/programs/Xserver/composite/compwindow.c b/nx-X11/programs/Xserver/composite/compwindow.c index 799aad023..e9bb39827 100644 --- a/nx-X11/programs/Xserver/composite/compwindow.c +++ b/nx-X11/programs/Xserver/composite/compwindow.c @@ -83,7 +83,7 @@ compRepaintBorder (ClientPtr pClient, void * closure) dixLookupWindow(&pWindow, (XID) (intptr_t) closure, pClient, DixWriteAccess); #else - pWindow = SecurityLookupWindow((XID) (intptr_t) closure, pClient, SecurityWriteAccess); + pWindow = SecurityLookupWindow((XID) (intptr_t) closure, pClient, DixWriteAccess); int rc = pWindow ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/damageext/damageext.c b/nx-X11/programs/Xserver/damageext/damageext.c index 38a624be7..6ade82f84 100644 --- a/nx-X11/programs/Xserver/damageext/damageext.c +++ b/nx-X11/programs/Xserver/damageext/damageext.c @@ -175,7 +175,7 @@ ProcDamageCreate (ClientPtr client) REQUEST_SIZE_MATCH(xDamageCreateReq); LEGAL_NEW_RESOURCE(stuff->damage, client); SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client, - SecurityReadAccess); + DixReadAccess); switch (stuff->level) { case XDamageReportRawRectangles: level = DamageReportRawRegion; @@ -233,7 +233,7 @@ ProcDamageDestroy (ClientPtr client) DamageExtPtr pDamageExt; REQUEST_SIZE_MATCH(xDamageDestroyReq); - VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, SecurityWriteAccess); + VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess); FreeResource (stuff->damage, RT_NONE); return (client->noClientException); } @@ -247,9 +247,9 @@ ProcDamageSubtract (ClientPtr client) RegionPtr pParts; REQUEST_SIZE_MATCH(xDamageSubtractReq); - VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, SecurityWriteAccess); - VERIFY_REGION_OR_NONE(pRepair, stuff->repair, client, SecurityWriteAccess); - VERIFY_REGION_OR_NONE(pParts, stuff->parts, client, SecurityWriteAccess); + VERIFY_DAMAGEEXT(pDamageExt, stuff->damage, client, DixWriteAccess); + VERIFY_REGION_OR_NONE(pRepair, stuff->repair, client, DixWriteAccess); + VERIFY_REGION_OR_NONE(pParts, stuff->parts, client, DixWriteAccess); if (pDamageExt->level != DamageReportRawRegion) { diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index d0487ba63..95740871a 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -420,7 +420,7 @@ ProcDbeAllocateBackBufferName(client) /* The window must be valid. */ if (!(pWin = SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess))) + DixWriteAccess))) { return(BadWindow); } @@ -648,9 +648,9 @@ ProcDbeDeallocateBackBufferName(client) /* Buffer name must be valid */ if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client, - stuff->buffer, dbeWindowPrivResType, SecurityDestroyAccess)) || + stuff->buffer, dbeWindowPrivResType, DixDestroyAccess)) || !(SecurityLookupIDByType(client, stuff->buffer, dbeDrawableResType, - SecurityDestroyAccess))) + DixDestroyAccess))) { client->errorValue = stuff->buffer; return(dbeErrorBase + DbeBadBuffer); @@ -751,7 +751,7 @@ ProcDbeSwapBuffers(client) /* Each window must be a valid window - BadWindow. */ if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client, - SecurityWriteAccess))) + DixWriteAccess))) { free(swapInfo); return(BadWindow); @@ -916,7 +916,7 @@ ProcDbeGetVisualInfo(client) for (i = 0; i < stuff->n; i++) { if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable( - drawables[i], client, SecurityReadAccess))) + drawables[i], client, DixReadAccess))) { free(pDrawables); return(BadDrawable); @@ -1072,7 +1072,7 @@ ProcDbeGetBackBufferAttributes(client) REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); if (!(pDbeWindowPriv = (DbeWindowPrivPtr)SecurityLookupIDByType(client, - stuff->buffer, dbeWindowPrivResType, SecurityReadAccess))) + stuff->buffer, dbeWindowPrivResType, DixReadAccess))) { rep.attributes = None; } diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c index b8361a9cf..8b0e1e421 100644 --- a/nx-X11/programs/Xserver/dix/colormap.c +++ b/nx-X11/programs/Xserver/dix/colormap.c @@ -892,7 +892,7 @@ AllocColor (ColormapPtr pmap, { ColormapPtr prootmap = (ColormapPtr) SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pmap->class == prootmap->class) FindColorInRootCmap (prootmap, prootmap->red, entries, &rgb, @@ -909,7 +909,7 @@ AllocColor (ColormapPtr pmap, { ColormapPtr prootmap = (ColormapPtr) SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pmap->class == prootmap->class) { diff --git a/nx-X11/programs/Xserver/dix/cursor.c b/nx-X11/programs/Xserver/dix/cursor.c index 093464298..a1bf6a7ed 100644 --- a/nx-X11/programs/Xserver/dix/cursor.c +++ b/nx-X11/programs/Xserver/dix/cursor.c @@ -262,9 +262,9 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, GlyphSharePtr pShare; sourcefont = (FontPtr) SecurityLookupIDByType(client, source, RT_FONT, - SecurityReadAccess); + DixReadAccess); maskfont = (FontPtr) SecurityLookupIDByType(client, mask, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!sourcefont) { diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 2c7550371..02d5170fb 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -491,7 +491,7 @@ ProcCreateWindow(ClientPtr client) LEGAL_NEW_RESOURCE(stuff->wid, client); if (!(pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess))) + DixWriteAccess))) return BadWindow; len = client->req_len - (sizeof(xCreateWindowReq) >> 2); if (Ones(stuff->mask) != len) @@ -532,7 +532,7 @@ ProcChangeWindowAttributes(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2); @@ -557,7 +557,7 @@ ProcGetWindowAttributes(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); memset(&wa, 0, sizeof(xGetWindowAttributesReply)); @@ -574,7 +574,7 @@ ProcDestroyWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); + DixDestroyAccess); if (!pWin) return(BadWindow); if (pWin->parent) @@ -590,7 +590,7 @@ ProcDestroySubwindows(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityDestroyAccess); + DixDestroyAccess); if (!pWin) return(BadWindow); DestroySubwindows(pWin, client); @@ -606,7 +606,7 @@ ProcChangeSaveSet(register ClientPtr client) REQUEST_SIZE_MATCH(xChangeSaveSetReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) @@ -636,11 +636,11 @@ ProcReparentWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xReparentWindowReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess); + DixWriteAccess); if (!pParent) return(BadWindow); if (SAME_SCREENS(pWin->drawable, pParent->drawable)) @@ -671,7 +671,7 @@ ProcMapWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); MapWindow(pWin, client); @@ -687,7 +687,7 @@ ProcMapSubwindows(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); MapSubwindows(pWin, client); @@ -703,7 +703,7 @@ ProcUnmapWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); UnmapWindow(pWin, FALSE); @@ -719,7 +719,7 @@ ProcUnmapSubwindows(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow( stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); UnmapSubwindows(pWin); @@ -736,7 +736,7 @@ ProcConfigureWindow(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); pWin = (WindowPtr)SecurityLookupWindow( stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); len = client->req_len - (sizeof(xConfigureWindowReq) >> 2); @@ -764,7 +764,7 @@ ProcCirculateWindow(register ClientPtr client) return BadValue; } pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); CirculateWindow(pWin, (int)stuff->direction, client); @@ -778,7 +778,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, SecurityReadAccess); + SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->id, client, DixReadAccess); memset(rep, 0, sizeof(xGetGeometryReply)); rep->type = X_Reply; rep->length = 0; @@ -839,7 +839,7 @@ ProcQueryTree(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); memset(&reply, 0, sizeof(xQueryTreeReply)); @@ -957,7 +957,7 @@ ProcSetSelectionOwner(register ClientPtr client) if (stuff->window != None) { pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); } @@ -1079,7 +1079,7 @@ ProcConvertSelection(register ClientPtr client) REQUEST_SIZE_MATCH(xConvertSelectionReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -1098,7 +1098,7 @@ ProcConvertSelection(register ClientPtr client) #ifdef XCSECURITY && (!client->CheckAccess || (* client->CheckAccess)(client, CurrentSelections[i].window, - RT_WINDOW, SecurityReadAccess, + RT_WINDOW, DixReadAccess, CurrentSelections[i].pWin)) #endif ) @@ -1208,11 +1208,11 @@ ProcTranslateCoords(register ClientPtr client) REQUEST_SIZE_MATCH(xTranslateCoordsReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client, - SecurityReadAccess); + DixReadAccess); if (!pDst) return(BadWindow); memset(&rep, 0, sizeof(xTranslateCoordsReply)); @@ -1305,7 +1305,7 @@ ProcCloseFont(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityDestroyAccess); + DixDestroyAccess); if ( pFont != (FontPtr)NULL) /* id was valid */ { FreeResource(stuff->id, RT_NONE); @@ -1331,12 +1331,12 @@ ProcQueryFont(register ClientPtr client) client->errorValue = stuff->id; /* EITHER font or gc */ pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!pFont) { /* can't use VERIFY_GC because it might return BadGC */ pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC, - SecurityReadAccess); + DixReadAccess); if (!pGC) { client->errorValue = stuff->id; @@ -1394,11 +1394,11 @@ ProcQueryTextExtents(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xQueryTextExtentsReq); pFont = (FontPtr)SecurityLookupIDByType(client, stuff->fid, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!pFont) { pGC = (GC *)SecurityLookupIDByType(client, stuff->fid, RT_GC, - SecurityReadAccess); + DixReadAccess); if (!pGC) { client->errorValue = stuff->fid; @@ -1479,7 +1479,7 @@ ProcCreatePixmap(register ClientPtr client) client->errorValue = stuff->pid; LEGAL_NEW_RESOURCE(stuff->pid, client); SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); + DixReadAccess); if (!stuff->width || !stuff->height) { client->errorValue = 0; @@ -1535,7 +1535,7 @@ ProcFreePixmap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, - SecurityDestroyAccess); + DixDestroyAccess); if (pMap) { FreeResource(stuff->id, RT_NONE); @@ -1562,7 +1562,7 @@ ProcCreateGC(register ClientPtr client) client->errorValue = stuff->gc; LEGAL_NEW_RESOURCE(stuff->gc, client); SECURITY_VERIFY_DRAWABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); + DixReadAccess); len = client->req_len - (sizeof(xCreateGCReq) >> 2); if (len != Ones(stuff->mask)) return BadLength; @@ -1584,7 +1584,7 @@ ProcChangeGC(register ClientPtr client) unsigned len; REQUEST_AT_LEAST_SIZE(xChangeGCReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixWriteAccess); len = client->req_len - (sizeof(xChangeGCReq) >> 2); if (len != Ones(stuff->mask)) return BadLength; @@ -1608,8 +1608,8 @@ ProcCopyGC(register ClientPtr client) REQUEST(xCopyGCReq); REQUEST_SIZE_MATCH(xCopyGCReq); - SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, SecurityReadAccess); - SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, SecurityWriteAccess); + SECURITY_VERIFY_GC( pGC, stuff->srcGC, client, DixReadAccess); + SECURITY_VERIFY_GC( dstGC, stuff->dstGC, client, DixWriteAccess); if ((dstGC->pScreen != pGC->pScreen) || (dstGC->depth != pGC->depth)) return (BadMatch); result = CopyGC(pGC, dstGC, stuff->mask); @@ -1636,7 +1636,7 @@ ProcSetDashes(register ClientPtr client) return BadValue; } - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); + SECURITY_VERIFY_GC(pGC,stuff->gc, client, DixWriteAccess); result = SetDashes(pGC, stuff->dashOffset, stuff->nDashes, (unsigned char *)&stuff[1]); @@ -1664,7 +1664,7 @@ ProcSetClipRectangles(register ClientPtr client) client->errorValue = stuff->ordering; return BadValue; } - SECURITY_VERIFY_GC(pGC,stuff->gc, client, SecurityWriteAccess); + SECURITY_VERIFY_GC(pGC,stuff->gc, client, DixWriteAccess); nr = (client->req_len << 2) - sizeof(xSetClipRectanglesReq); if (nr & 4) @@ -1685,7 +1685,7 @@ ProcFreeGC(register ClientPtr client) REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); - SECURITY_VERIFY_GC(pGC, stuff->id, client, SecurityDestroyAccess); + SECURITY_VERIFY_GC(pGC, stuff->id, client, DixDestroyAccess); FreeResource(stuff->id, RT_NONE); return(client->noClientException); } @@ -1698,7 +1698,7 @@ ProcClearToBackground(register ClientPtr client) REQUEST_SIZE_MATCH(xClearAreaReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (pWin->drawable.class == InputOnly) @@ -1732,7 +1732,7 @@ ProcCopyArea(register ClientPtr client) if (stuff->dstDrawable != stuff->srcDrawable) { SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client, - SecurityReadAccess); + DixReadAccess); if ((pDst->pScreen != pSrc->pScreen) || (pDst->depth != pSrc->depth)) { client->errorValue = stuff->dstDrawable; @@ -1772,7 +1772,7 @@ ProcCopyPlane(register ClientPtr client) if (stuff->dstDrawable != stuff->srcDrawable) { SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client, - SecurityReadAccess); + DixReadAccess); if (pdstDraw->pScreen != psrcDraw->pScreen) { client->errorValue = stuff->dstDrawable; @@ -2115,7 +2115,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, client->errorValue = format; return(BadValue); } - SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, SecurityReadAccess); + SECURITY_VERIFY_DRAWABLE(pDraw, drawable, client, DixReadAccess); memset(&xgi, 0, sizeof(xGetImageReply)); if(pDraw->type == DRAWABLE_WINDOW) @@ -2447,7 +2447,7 @@ ProcCreateColormap(register ClientPtr client) mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -2477,7 +2477,7 @@ ProcFreeColormap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pmap = (ColormapPtr )SecurityLookupIDByType(client, stuff->id, RT_COLORMAP, - SecurityDestroyAccess); + DixDestroyAccess); if (pmap) { /* Freeing a default colormap is a no-op */ @@ -2505,7 +2505,7 @@ ProcCopyColormapAndFree(register ClientPtr client) mid = stuff->mid; LEGAL_NEW_RESOURCE(mid, client); if( (pSrcMap = (ColormapPtr )SecurityLookupIDByType(client, stuff->srcCmap, - RT_COLORMAP, SecurityReadAccess|SecurityWriteAccess)) ) + RT_COLORMAP, DixReadAccess|DixWriteAccess)) ) { result = CopyColormapAndFree(mid, pSrcMap, client->index); if (client->noClientException != Success) @@ -2528,7 +2528,7 @@ ProcInstallColormap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pcmp) { (*(pcmp->pScreen->InstallColormap)) (pcmp); @@ -2549,7 +2549,7 @@ ProcUninstallColormap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->id, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pcmp) { if(pcmp->mid != pcmp->pScreen->defColormap) @@ -2573,7 +2573,7 @@ ProcListInstalledColormaps(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -2608,7 +2608,7 @@ ProcAllocColor (register ClientPtr client) REQUEST_SIZE_MATCH(xAllocColorReq); pmap = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pmap) { acr.type = X_Reply; @@ -2648,7 +2648,7 @@ ProcAllocNamedColor (register ClientPtr client) REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { int retval; @@ -2700,7 +2700,7 @@ ProcAllocColorCells (register ClientPtr client) REQUEST_SIZE_MATCH(xAllocColorCellsReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { xAllocColorCellsReply accr; @@ -2766,7 +2766,7 @@ ProcAllocColorPlanes(register ClientPtr client) REQUEST_SIZE_MATCH(xAllocColorPlanesReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { xAllocColorPlanesReply acpr; @@ -2830,7 +2830,7 @@ ProcFreeColors(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xFreeColorsReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { int count; @@ -2865,7 +2865,7 @@ ProcStoreColors (ClientPtr client) REQUEST_AT_LEAST_SIZE(xStoreColorsReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { int count; @@ -2899,7 +2899,7 @@ ProcStoreNamedColor (register ClientPtr client) REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityWriteAccess); + RT_COLORMAP, DixWriteAccess); if (pcmp) { xColorItem def; @@ -2933,7 +2933,7 @@ ProcQueryColors(register ClientPtr client) REQUEST_AT_LEAST_SIZE(xQueryColorsReq); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pcmp) { int count, retval; @@ -2987,7 +2987,7 @@ ProcLookupColor(register ClientPtr client) REQUEST_FIXED_SIZE(xLookupColorReq, stuff->nbytes); pcmp = (ColormapPtr)SecurityLookupIDByType(client, stuff->cmap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (pcmp) { xLookupColorReply lcr; @@ -3037,9 +3037,9 @@ ProcCreateCursor (register ClientPtr client) LEGAL_NEW_RESOURCE(stuff->cid, client); src = (PixmapPtr)SecurityLookupIDByType(client, stuff->source, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); msk = (PixmapPtr)SecurityLookupIDByType(client, stuff->mask, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if ( src == (PixmapPtr)NULL) { client->errorValue = stuff->source; @@ -3139,7 +3139,7 @@ ProcFreeCursor (register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->id, - RT_CURSOR, SecurityDestroyAccess); + RT_CURSOR, DixDestroyAccess); if (pCursor) { FreeResource(stuff->id, RT_NONE); @@ -3169,7 +3169,7 @@ ProcQueryBestSize (register ClientPtr client) return(BadValue); } SECURITY_VERIFY_GEOMETRABLE (pDraw, stuff->drawable, client, - SecurityReadAccess); + DixReadAccess); if (stuff->class != CursorShape && pDraw->type == UNDRAWABLE_WINDOW) return (BadMatch); pScreen = pDraw->pScreen; diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c index aa90b8769..f7d047c2d 100644 --- a/nx-X11/programs/Xserver/dix/dixfonts.c +++ b/nx-X11/programs/Xserver/dix/dixfonts.c @@ -1197,7 +1197,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) if (c->slept && c->pDraw && c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) + RC_DRAWABLE, DixWriteAccess)) { /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client and avoid further @@ -1227,7 +1227,7 @@ doPolyText(ClientPtr client, register PTclosurePtr c) | ((Font)*(c->pElt+2)) << 16 | ((Font)*(c->pElt+1)) << 24; pFont = (FontPtr)SecurityLookupIDByType(client, fid, RT_FONT, - SecurityReadAccess); + DixReadAccess); if (!pFont) { client->errorValue = fid; @@ -1489,7 +1489,7 @@ doImageText(ClientPtr client, register ITclosurePtr c) if (c->slept && c->pDraw && c->pDraw != (DrawablePtr)SecurityLookupIDByClass(client, c->did, - RC_DRAWABLE, SecurityWriteAccess)) + RC_DRAWABLE, DixWriteAccess)) { /* Our drawable has disappeared. Treat like client died... ask the FPE code to clean up after client. */ @@ -2044,7 +2044,7 @@ FontPtr find_old_font(XID id) { return (FontPtr) SecurityLookupIDByType(NullClient, id, RT_NONE, - SecurityUnknownAccess); + DixUnknownAccess); } Font diff --git a/nx-X11/programs/Xserver/dix/dixutils.c b/nx-X11/programs/Xserver/dix/dixutils.c index bd7439d89..bf925f748 100644 --- a/nx-X11/programs/Xserver/dix/dixutils.c +++ b/nx-X11/programs/Xserver/dix/dixutils.c @@ -260,13 +260,13 @@ SecurityLookupDrawable(XID rid, ClientPtr client, Mask access_mode) WindowPtr LookupWindow(XID rid, ClientPtr client) { - return SecurityLookupWindow(rid, client, SecurityUnknownAccess); + return SecurityLookupWindow(rid, client, DixUnknownAccess); } void * LookupDrawable(XID rid, ClientPtr client) { - return SecurityLookupDrawable(rid, client, SecurityUnknownAccess); + return SecurityLookupDrawable(rid, client, DixUnknownAccess); } #else /* not XCSECURITY */ @@ -317,7 +317,7 @@ ClientPtr LookupClient(XID rid, ClientPtr client) { void * pRes = (void *)SecurityLookupIDByClass(client, rid, RC_ANY, - SecurityReadAccess); + DixReadAccess); int clientIndex = CLIENT_ID(rid); if (clientIndex && pRes && clients[clientIndex] && !(rid & SERVER_BIT)) diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index fa8bfc92d..fde3e91dd 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -2201,7 +2201,7 @@ XineramaWarpPointer(ClientPtr client) if (stuff->dstWid != None) { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); + dest = SecurityLookupWindow(stuff->dstWid, client, DixReadAccess); if (!dest) return BadWindow; } @@ -2214,7 +2214,7 @@ XineramaWarpPointer(ClientPtr client) XID winID = stuff->srcWid; WindowPtr source; - source = SecurityLookupWindow(winID, client, SecurityReadAccess); + source = SecurityLookupWindow(winID, client, DixReadAccess); if (!source) return BadWindow; winX = source->drawable.x; @@ -2281,7 +2281,7 @@ ProcWarpPointer(ClientPtr client) if (stuff->dstWid != None) { - dest = SecurityLookupWindow(stuff->dstWid, client, SecurityReadAccess); + dest = SecurityLookupWindow(stuff->dstWid, client, DixReadAccess); if (!dest) return BadWindow; } @@ -2294,7 +2294,7 @@ ProcWarpPointer(ClientPtr client) XID winID = stuff->srcWid; WindowPtr source; - source = SecurityLookupWindow(winID, client, SecurityReadAccess); + source = SecurityLookupWindow(winID, client, DixReadAccess); if (!source) return BadWindow; winX = source->drawable.x; @@ -3469,7 +3469,7 @@ SetInputFocus( else if ((focusID == FollowKeyboard) && followOK) focusWin = inputInfo.keyboard->focus->win; else if (!(focusWin = SecurityLookupWindow(focusID, client, - SecurityReadAccess))) + DixReadAccess))) return BadWindow; else { @@ -3590,7 +3590,7 @@ ProcGrabPointer(ClientPtr client) client->errorValue = stuff->eventMask; return BadValue; } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; if (stuff->confineTo == None) @@ -3598,7 +3598,7 @@ ProcGrabPointer(ClientPtr client) else { confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); + DixReadAccess); if (!confineTo) return BadWindow; } @@ -3607,7 +3607,7 @@ ProcGrabPointer(ClientPtr client) else { cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursor) { client->errorValue = stuff->cursor; @@ -3682,7 +3682,7 @@ ProcChangeActivePointerGrab(ClientPtr client) else { newCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!newCursor) { client->errorValue = stuff->cursor; @@ -3752,7 +3752,7 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev, client->errorValue = ownerEvents; return BadValue; } - pWin = SecurityLookupWindow(grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; time = ClientTimeToServerTime(ctime); @@ -3842,7 +3842,7 @@ ProcQueryPointer(ClientPtr client) DeviceIntPtr mouse = inputInfo.pointer; REQUEST_SIZE_MATCH(xResourceReq); - pWin = SecurityLookupWindow(stuff->id, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->id, client, DixReadAccess); if (!pWin) return BadWindow; if (mouse->valuator->motionHintWindow) @@ -4009,7 +4009,7 @@ ProcSendEvent(ClientPtr client) } else pWin = SecurityLookupWindow(stuff->destination, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return BadWindow; if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) @@ -4048,7 +4048,7 @@ ProcUngrabKey(ClientPtr client) DeviceIntPtr keybd = inputInfo.keyboard; REQUEST_SIZE_MATCH(xUngrabKeyReq); - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; @@ -4119,7 +4119,7 @@ ProcGrabKey(ClientPtr client) client->errorValue = stuff->modifiers; return BadValue; } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; @@ -4171,14 +4171,14 @@ ProcGrabButton(ClientPtr client) client->errorValue = stuff->eventMask; return BadValue; } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; if (stuff->confineTo == None) confineTo = NullWindow; else { confineTo = SecurityLookupWindow(stuff->confineTo, client, - SecurityReadAccess); + DixReadAccess); if (!confineTo) return BadWindow; } @@ -4187,7 +4187,7 @@ ProcGrabButton(ClientPtr client) else { cursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursor) { client->errorValue = stuff->cursor; @@ -4222,7 +4222,7 @@ ProcUngrabButton(ClientPtr client) client->errorValue = stuff->modifiers; return BadValue; } - pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->grabWindow, client, DixReadAccess); if (!pWin) return BadWindow; tempGrab.resource = client->clientAsMask; @@ -4376,7 +4376,7 @@ ProcRecolorCursor(ClientPtr client) REQUEST_SIZE_MATCH(xRecolorCursorReq); pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor, - RT_CURSOR, SecurityWriteAccess); + RT_CURSOR, DixWriteAccess); if ( !pCursor) { client->errorValue = stuff->cursor; diff --git a/nx-X11/programs/Xserver/dix/gc.c b/nx-X11/programs/Xserver/dix/gc.c index 29f14de43..b3a4edf4d 100644 --- a/nx-X11/programs/Xserver/dix/gc.c +++ b/nx-X11/programs/Xserver/dix/gc.c @@ -271,7 +271,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC { NEXTVAL(XID, newpix); pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - newpix, RT_PIXMAP, SecurityReadAccess); + newpix, RT_PIXMAP, DixReadAccess); } if (pPixmap) { @@ -307,7 +307,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC { NEXTVAL(XID, newstipple) pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - newstipple, RT_PIXMAP, SecurityReadAccess); + newstipple, RT_PIXMAP, DixReadAccess); } if (pPixmap) { @@ -349,7 +349,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC { NEXTVAL(XID, newfont) pFont = (FontPtr)SecurityLookupIDByType(client, newfont, - RT_FONT, SecurityReadAccess); + RT_FONT, DixReadAccess); } if (pFont) { @@ -416,7 +416,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC } else pPixmap = (PixmapPtr)SecurityLookupIDByType(client, - pid, RT_PIXMAP, SecurityReadAccess); + pid, RT_PIXMAP, DixReadAccess); } if (pPixmap) diff --git a/nx-X11/programs/Xserver/dix/property.c b/nx-X11/programs/Xserver/dix/property.c index 2e5569367..f5713cf5e 100644 --- a/nx-X11/programs/Xserver/dix/property.c +++ b/nx-X11/programs/Xserver/dix/property.c @@ -106,7 +106,7 @@ ProcRotateProperties(ClientPtr client) REQUEST_FIXED_SIZE(xRotatePropertiesReq, stuff->nAtoms << 2); UpdateCurrentTime(); pWin = (WindowPtr) SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (!stuff->nAtoms) @@ -119,7 +119,7 @@ ProcRotateProperties(ClientPtr client) { #ifdef XCSECURITY char action = SecurityCheckPropertyAccess(client, pWin, atoms[i], - SecurityReadAccess|SecurityWriteAccess); + DixReadAccess|DixWriteAccess); #endif if (!ValidAtom(atoms[i]) #ifdef XCSECURITY @@ -219,7 +219,7 @@ ProcChangeProperty(ClientPtr client) REQUEST_FIXED_SIZE(xChangePropertyReq, totalSize); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (!ValidAtom(stuff->property)) @@ -235,7 +235,7 @@ ProcChangeProperty(ClientPtr client) #ifdef XCSECURITY switch (SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityWriteAccess)) + DixWriteAccess)) { case SecurityErrorOperation: client->errorValue = stuff->property; @@ -469,7 +469,7 @@ ProcGetProperty(ClientPtr client) if (stuff->delete) UpdateCurrentTime(); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return BadWindow; @@ -507,10 +507,10 @@ ProcGetProperty(ClientPtr client) #ifdef XCSECURITY { - Mask access_mode = SecurityReadAccess; + Mask access_mode = DixReadAccess; if (stuff->delete) - access_mode |= SecurityDestroyAccess; + access_mode |= DixDestroyAccess; switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, access_mode)) { @@ -614,7 +614,7 @@ ProcListProperties(ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -659,7 +659,7 @@ ProcDeleteProperty(register ClientPtr client) REQUEST_SIZE_MATCH(xDeletePropertyReq); UpdateCurrentTime(); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (!ValidAtom(stuff->property)) @@ -670,7 +670,7 @@ ProcDeleteProperty(register ClientPtr client) #ifdef XCSECURITY switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityDestroyAccess)) + DixDestroyAccess)) { case SecurityErrorOperation: client->errorValue = stuff->property; diff --git a/nx-X11/programs/Xserver/dix/resource.c b/nx-X11/programs/Xserver/dix/resource.c index ca7da1601..d22b0cdd0 100644 --- a/nx-X11/programs/Xserver/dix/resource.c +++ b/nx-X11/programs/Xserver/dix/resource.c @@ -878,14 +878,14 @@ void * LookupIDByType(XID id, RESTYPE rtype) { return SecurityLookupIDByType(NullClient, id, rtype, - SecurityUnknownAccess); + DixUnknownAccess); } void * LookupIDByClass(XID id, RESTYPE classes) { return SecurityLookupIDByClass(NullClient, id, classes, - SecurityUnknownAccess); + DixUnknownAccess); } #else /* not XCSECURITY */ diff --git a/nx-X11/programs/Xserver/dix/window.c b/nx-X11/programs/Xserver/dix/window.c index 1239ab9f7..a7346e778 100644 --- a/nx-X11/programs/Xserver/dix/window.c +++ b/nx-X11/programs/Xserver/dix/window.c @@ -1028,7 +1028,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt else { pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if (pPixmap != (PixmapPtr) NULL) { if ((pPixmap->drawable.depth != pWin->drawable.depth) || @@ -1089,7 +1089,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt else { pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pixID, - RT_PIXMAP, SecurityReadAccess); + RT_PIXMAP, DixReadAccess); if (pPixmap) { if ((pPixmap->drawable.depth != pWin->drawable.depth) || @@ -1302,7 +1302,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt goto PatchUp; } pCmap = (ColormapPtr)SecurityLookupIDByType(client, cmap, - RT_COLORMAP, SecurityReadAccess); + RT_COLORMAP, DixReadAccess); if (!pCmap) { error = BadColor; @@ -1378,7 +1378,7 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt else { pCursor = (CursorPtr)SecurityLookupIDByType(client, cursorID, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!pCursor) { error = BadCursor; @@ -2252,7 +2252,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP sibwid = (Window ) *pVlist; pVlist++; pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, - RT_WINDOW, SecurityReadAccess); + RT_WINDOW, DixReadAccess); if (!pSib) { client->errorValue = sibwid; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 8fc6cf5fd..a46434bf1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -586,7 +586,7 @@ ProcReparentWindow(register ClientPtr client) REQUEST_SIZE_MATCH(xReparentWindowReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); @@ -596,7 +596,7 @@ ProcReparentWindow(register ClientPtr client) } pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, - SecurityWriteAccess); + DixWriteAccess); if (!pParent) return(BadWindow); if (SAME_SCREENS(pWin->drawable, pParent->drawable)) @@ -630,7 +630,7 @@ ProcQueryTree(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->id, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); memset(&reply, 0, sizeof(xQueryTreeReply)); @@ -698,7 +698,7 @@ ProcSetSelectionOwner(register ClientPtr client) if (stuff->window != None) { pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); } @@ -797,7 +797,7 @@ ProcConvertSelection(register ClientPtr client) REQUEST_SIZE_MATCH(xConvertSelectionReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->requestor, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); @@ -837,7 +837,7 @@ ProcConvertSelection(register ClientPtr client) #ifdef XCSECURITY && (!client->CheckAccess || (* client->CheckAccess)(client, CurrentSelections[i].window, - RT_WINDOW, SecurityReadAccess, + RT_WINDOW, DixReadAccess, CurrentSelections[i].pWin)) #endif ) @@ -918,7 +918,7 @@ ProcCloseFont(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT, - SecurityDestroyAccess); + DixDestroyAccess); if (pFont != (FontPtr)NULL) { #ifdef NXAGENT_SERVER @@ -1015,7 +1015,7 @@ ProcFreePixmap(register ClientPtr client) REQUEST_SIZE_MATCH(xResourceReq); pMap = (PixmapPtr)SecurityLookupIDByType(client, stuff->id, RT_PIXMAP, - SecurityDestroyAccess); + DixDestroyAccess); if (pMap) { #ifdef NXAGENT_SERVER diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index f507e5f71..43cb806e7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -583,7 +583,7 @@ ProcSendEvent(ClientPtr client) } else pWin = SecurityLookupWindow(stuff->destination, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return BadWindow; if ((stuff->propagate != xFalse) && (stuff->propagate != xTrue)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 881d2e2d0..28fdd19f5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -131,7 +131,7 @@ ProcChangeProperty(ClientPtr client) if (pWin == NULL) #endif pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityWriteAccess); + DixWriteAccess); if (!pWin) return(BadWindow); if (!ValidAtom(stuff->property)) @@ -147,7 +147,7 @@ ProcChangeProperty(ClientPtr client) #ifdef XCSECURITY switch (SecurityCheckPropertyAccess(client, pWin, stuff->property, - SecurityWriteAccess)) + DixWriteAccess)) { case SecurityErrorOperation: client->errorValue = stuff->property; @@ -348,7 +348,7 @@ ProcGetProperty(ClientPtr client) if (stuff->delete) UpdateCurrentTime(); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return BadWindow; @@ -439,10 +439,10 @@ ProcGetProperty(ClientPtr client) #ifdef XCSECURITY { - Mask access_mode = SecurityReadAccess; + Mask access_mode = DixReadAccess; if (stuff->delete) - access_mode |= SecurityDestroyAccess; + access_mode |= DixDestroyAccess; switch(SecurityCheckPropertyAccess(client, pWin, stuff->property, access_mode)) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index b8c5cdbd2..8d55516fb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -385,11 +385,11 @@ ProcRenderCreatePicture (ClientPtr client) LEGAL_NEW_RESOURCE(stuff->pid, client); SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); + DixWriteAccess); pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->format; @@ -426,7 +426,7 @@ ProcRenderChangePicture (ClientPtr client) int error; REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); @@ -450,7 +450,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client) int result; REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pPicture->pDrawable) return BadDrawable; @@ -558,13 +558,13 @@ ProcRenderComposite (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, + VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess, RenderErrBase + BadPicture); if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || @@ -687,9 +687,9 @@ ProcRenderTrapezoids (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -700,7 +700,7 @@ ProcRenderTrapezoids (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -758,7 +758,7 @@ ProcRenderCreateGlyphSet (ClientPtr client) format = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!format) { client->errorValue = stuff->format; @@ -809,7 +809,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->existing, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->existing; @@ -834,7 +834,7 @@ ProcRenderFreeGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityDestroyAccess); + DixDestroyAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -860,7 +860,7 @@ ProcRenderFreeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -928,9 +928,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -941,7 +941,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -954,7 +954,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1027,7 +1027,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, gs, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = gs; @@ -1163,7 +1163,7 @@ ProcRenderFillRectangles (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -1212,7 +1212,7 @@ ProcRenderCreateCursor (ClientPtr client) REQUEST_SIZE_MATCH (xRenderCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); if (!pSrc->pDrawable) return BadDrawable; @@ -1430,7 +1430,7 @@ ProcRenderSetPictureTransform (ClientPtr client) int result; REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); @@ -1453,7 +1453,7 @@ ProcRenderSetPictureFilter (ClientPtr client) char *name; REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); name = (char *) (stuff + 1); params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); @@ -1490,7 +1490,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) for (i = 0; i < ncursor; i++) { cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursors[i]) { free (cursors); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 7cb29bde5..adff36569 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -503,7 +503,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP sibwid = (Window ) *pVlist; pVlist++; pSib = (WindowPtr )SecurityLookupIDByType(client, sibwid, - RT_WINDOW, SecurityReadAccess); + RT_WINDOW, DixReadAccess); if (!pSib) { client->errorValue = sibwid; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index bb961e5a8..bb19b3458 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -540,7 +540,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if ((wmHints.flags & IconPixmapHint) && (wmHints.icon_pixmap != None)) { PixmapPtr icon = (PixmapPtr)SecurityLookupIDByType(pClient, wmHints.icon_pixmap, - RT_PIXMAP, SecurityDestroyAccess); + RT_PIXMAP, DixDestroyAccess); if (icon) { @@ -567,7 +567,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if ((wmHints.flags & IconWindowHint) && (wmHints.icon_window != None)) { WindowPtr icon = (WindowPtr)SecurityLookupWindow(wmHints.icon_window, pClient, - SecurityDestroyAccess); + DixDestroyAccess); if (icon) { @@ -589,7 +589,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if ((wmHints.flags & IconMaskHint) && (wmHints.icon_mask != None)) { PixmapPtr icon = (PixmapPtr)SecurityLookupIDByType(pClient, wmHints.icon_mask, - RT_PIXMAP, SecurityDestroyAccess); + RT_PIXMAP, DixDestroyAccess); if (icon) { @@ -611,7 +611,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if ((wmHints.flags & WindowGroupHint) && (wmHints.window_group != None)) { WindowPtr window = (WindowPtr)SecurityLookupWindow(wmHints.window_group, pClient, - SecurityDestroyAccess); + DixDestroyAccess); if (window) { @@ -695,7 +695,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) for (i = 0; i < nUnits; i++) { pWindow = (WindowPtr)SecurityLookupWindow(input[i], pClient, - SecurityDestroyAccess); + DixDestroyAccess); if ((input[i] != None) && pWindow) { wind[i] = nxagentWindow(pWindow); diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index 4b9c7749c..0b08b46a9 100644 --- a/nx-X11/programs/Xserver/include/dix.h +++ b/nx-X11/programs/Xserver/include/dix.h @@ -138,13 +138,13 @@ SOFTWARE. } #define VERIFY_DRAWABLE(pDraw, did, client)\ - SECURITY_VERIFY_DRAWABLE(pDraw, did, client, SecurityUnknownAccess) + SECURITY_VERIFY_DRAWABLE(pDraw, did, client, DixUnknownAccess) #define VERIFY_GEOMETRABLE(pDraw, did, client)\ - SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, SecurityUnknownAccess) + SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, DixUnknownAccess) #define VERIFY_GC(pGC, rid, client)\ - SECURITY_VERIFY_GC(pGC, rid, client, SecurityUnknownAccess) + SECURITY_VERIFY_GC(pGC, rid, client, DixUnknownAccess) #else /* not XCSECURITY */ @@ -255,8 +255,8 @@ SOFTWARE. if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\ (client->lastDrawableID != drawID))\ {\ - SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, SecurityWriteAccess);\ - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess);\ + SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, DixWriteAccess);\ + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess);\ if ((pGC->depth != pDraw->depth) ||\ (pGC->pScreen != pDraw->pScreen))\ return (BadMatch);\ diff --git a/nx-X11/programs/Xserver/include/resource.h b/nx-X11/programs/Xserver/include/resource.h index 5e169e093..164e7ccfc 100644 --- a/nx-X11/programs/Xserver/include/resource.h +++ b/nx-X11/programs/Xserver/include/resource.h @@ -220,10 +220,10 @@ extern void * LookupClientResourceComplex( * simultaneously. */ -#define SecurityUnknownAccess 0 /* don't know intentions */ -#define SecurityReadAccess (1<<0) /* inspecting the object */ -#define SecurityWriteAccess (1<<1) /* changing the object */ -#define SecurityDestroyAccess (1<<2) /* destroying the object */ +#define DixUnknownAccess 0 /* don't know intentions */ +#define DixReadAccess (1<<0) /* inspecting the object */ +#define DixWriteAccess (1<<1) /* changing the object */ +#define DixDestroyAccess (1<<2) /* destroying the object */ #ifdef XCSECURITY diff --git a/nx-X11/programs/Xserver/randr/randrstr.h b/nx-X11/programs/Xserver/randr/randrstr.h index 459a47383..4b497f82d 100644 --- a/nx-X11/programs/Xserver/randr/randrstr.h +++ b/nx-X11/programs/Xserver/randr/randrstr.h @@ -443,12 +443,8 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; (SecurityLookupIDByType (client, id, \ RRProviderType, a))) -#define DixUnknownAccess SecurityUnknownAccess -#define DixReadAccess SecurityReadAccess -#define DixWriteAccess SecurityWriteAccess -#define DixSetAttrAccess SecurityWriteAccess -#define DixUseAccess SecurityWriteAccess -#define DixDestroyAccess SecurityDestroyAccess +#define DixSetAttrAccess DixWriteAccess +#define DixUseAccess DixWriteAccess #endif diff --git a/nx-X11/programs/Xserver/randr/rrdispatch.c b/nx-X11/programs/Xserver/randr/rrdispatch.c index 14f74d771..68d3b97e6 100644 --- a/nx-X11/programs/Xserver/randr/rrdispatch.c +++ b/nx-X11/programs/Xserver/randr/rrdispatch.c @@ -87,7 +87,7 @@ ProcRRSelectInput(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityWriteAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixWriteAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c index a2bbec7d9..9f8277a55 100644 --- a/nx-X11/programs/Xserver/randr/rrmode.c +++ b/nx-X11/programs/Xserver/randr/rrmode.c @@ -357,7 +357,7 @@ ProcRRCreateMode(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c index 8829caf2f..13b061c35 100644 --- a/nx-X11/programs/Xserver/randr/rrmonitor.c +++ b/nx-X11/programs/Xserver/randr/rrmonitor.c @@ -636,7 +636,7 @@ ProcRRGetMonitors(ClientPtr client) #ifndef NXAGENT_SERVER r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); #else - window = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + window = SecurityLookupWindow(stuff->window, client, DixReadAccess); r = window ? Success : BadWindow; #endif @@ -723,7 +723,7 @@ ProcRRSetMonitor(ClientPtr client) #ifndef NXAGENT_SERVER r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); #else - window = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + window = SecurityLookupWindow(stuff->window, client, DixReadAccess); r = window ? Success : BadWindow; #endif @@ -772,7 +772,7 @@ ProcRRDeleteMonitor(ClientPtr client) #ifndef NXAGENT_SERVER r = dixLookupWindow(&window, stuff->window, client, DixGetAttrAccess); #else - window = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + window = SecurityLookupWindow(stuff->window, client, DixReadAccess); r = window ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c index 07fda36b5..9e31a423b 100644 --- a/nx-X11/programs/Xserver/randr/rroutput.c +++ b/nx-X11/programs/Xserver/randr/rroutput.c @@ -583,7 +583,7 @@ ProcRRSetOutputPrimary(ClientPtr client) #ifndef NXAGENT_SERVER ret = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); ret = pWin ? Success : BadWindow; #endif @@ -641,7 +641,7 @@ ProcRRGetOutputPrimary(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/randr/rrprovider.c b/nx-X11/programs/Xserver/randr/rrprovider.c index fe99fa04d..a56d1ca1a 100644 --- a/nx-X11/programs/Xserver/randr/rrprovider.c +++ b/nx-X11/programs/Xserver/randr/rrprovider.c @@ -69,7 +69,7 @@ ProcRRGetProviders(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/randr/rrscreen.c b/nx-X11/programs/Xserver/randr/rrscreen.c index bdb8b6dd3..1a30b29d4 100644 --- a/nx-X11/programs/Xserver/randr/rrscreen.c +++ b/nx-X11/programs/Xserver/randr/rrscreen.c @@ -222,7 +222,7 @@ ProcRRGetScreenSizeRange(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif @@ -276,7 +276,7 @@ ProcRRSetScreenSize(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) @@ -532,7 +532,7 @@ rrGetScreenResources(ClientPtr client, Bool query) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) @@ -806,7 +806,7 @@ ProcRRGetScreenInfo(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif @@ -980,7 +980,7 @@ ProcRRSetScreenConfig(ClientPtr client) rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixWriteAccess); #else /* !defined(NXAGENT_SERVER) */ pDraw = - SecurityLookupDrawable(stuff->drawable, client, SecurityWriteAccess); + SecurityLookupDrawable(stuff->drawable, client, DixWriteAccess); rc = pDraw ? Success : BadDrawable; #endif /* !defined(NXAGENT_SERVER) */ diff --git a/nx-X11/programs/Xserver/randr/rrxinerama.c b/nx-X11/programs/Xserver/randr/rrxinerama.c index 5c80e52db..d863897a7 100644 --- a/nx-X11/programs/Xserver/randr/rrxinerama.c +++ b/nx-X11/programs/Xserver/randr/rrxinerama.c @@ -150,7 +150,7 @@ ProcRRXineramaGetState(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif @@ -205,7 +205,7 @@ ProcRRXineramaGetScreenCount(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif if (rc != Success) @@ -240,7 +240,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client) #ifndef NXAGENT_SERVER rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); #else - pWin = SecurityLookupWindow(stuff->window, client, SecurityReadAccess); + pWin = SecurityLookupWindow(stuff->window, client, DixReadAccess); rc = pWin ? Success : BadWindow; #endif diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index 4a1cd98f5..862ae0031 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -1210,7 +1210,7 @@ ChangePicture (PicturePtr pPicture, pAlpha = (PicturePtr) SecurityLookupIDByType(client, pid, PictureType, - SecurityWriteAccess|SecurityReadAccess); + DixWriteAccess|DixReadAccess); if (!pAlpha) { client->errorValue = pid; @@ -1271,7 +1271,7 @@ ChangePicture (PicturePtr pPicture, pPixmap = (PixmapPtr)SecurityLookupIDByType(client, pid, RT_PIXMAP, - SecurityReadAccess); + DixReadAccess); if (!pPixmap) { client->errorValue = pid; diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 774dcc8ec..abc26b5d9 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -567,7 +567,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { @@ -636,11 +636,11 @@ ProcRenderCreatePicture (ClientPtr client) LEGAL_NEW_RESOURCE(stuff->pid, client); SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, - SecurityWriteAccess); + DixWriteAccess); pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->format; @@ -674,7 +674,7 @@ ProcRenderChangePicture (ClientPtr client) int len; REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); len = client->req_len - (sizeof(xRenderChangePictureReq) >> 2); @@ -694,7 +694,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client) int result; REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pPicture->pDrawable) return BadDrawable; @@ -721,7 +721,7 @@ ProcRenderFreePicture (ClientPtr client) REQUEST_SIZE_MATCH(xRenderFreePictureReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixDestroyAccess, RenderErrBase + BadPicture); FreeResource (stuff->picture, RT_NONE); return(client->noClientException); @@ -752,13 +752,13 @@ ProcRenderComposite (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, + VERIFY_ALPHA (pMask, stuff->mask, client, DixReadAccess, RenderErrBase + BadPicture); if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) @@ -800,9 +800,9 @@ ProcRenderTrapezoids (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -813,7 +813,7 @@ ProcRenderTrapezoids (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -848,9 +848,9 @@ ProcRenderTriangles (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -861,7 +861,7 @@ ProcRenderTriangles (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -895,9 +895,9 @@ ProcRenderTriStrip (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -908,7 +908,7 @@ ProcRenderTriStrip (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -942,9 +942,9 @@ ProcRenderTriFan (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -955,7 +955,7 @@ ProcRenderTriFan (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -1008,7 +1008,7 @@ ProcRenderCreateGlyphSet (ClientPtr client) format = (PictFormatPtr) SecurityLookupIDByType (client, stuff->format, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!format) { client->errorValue = stuff->format; @@ -1056,7 +1056,7 @@ ProcRenderReferenceGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->existing, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->existing; @@ -1083,7 +1083,7 @@ ProcRenderFreeGlyphSet (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityDestroyAccess); + DixDestroyAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1118,7 +1118,7 @@ ProcRenderAddGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1223,7 +1223,7 @@ ProcRenderFreeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityWriteAccess); + DixWriteAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1278,9 +1278,9 @@ ProcRenderCompositeGlyphs (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -1291,7 +1291,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) pFormat = (PictFormatPtr) SecurityLookupIDByType (client, stuff->maskFormat, PictFormatType, - SecurityReadAccess); + DixReadAccess); if (!pFormat) { client->errorValue = stuff->maskFormat; @@ -1304,7 +1304,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, stuff->glyphset, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = stuff->glyphset; @@ -1366,7 +1366,7 @@ ProcRenderCompositeGlyphs (ClientPtr client) glyphSet = (GlyphSetPtr) SecurityLookupIDByType (client, gs, GlyphSetType, - SecurityReadAccess); + DixReadAccess); if (!glyphSet) { client->errorValue = gs; @@ -1447,7 +1447,7 @@ ProcRenderFillRectangles (ClientPtr client) client->errorValue = stuff->op; return BadValue; } - VERIFY_PICTURE (pDst, stuff->dst, client, SecurityWriteAccess, + VERIFY_PICTURE (pDst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pDst->pDrawable) return BadDrawable; @@ -1515,7 +1515,7 @@ ProcRenderCreateCursor (ClientPtr client) REQUEST_SIZE_MATCH (xRenderCreateCursorReq); LEGAL_NEW_RESOURCE(stuff->cid, client); - VERIFY_PICTURE (pSrc, stuff->src, client, SecurityReadAccess, + VERIFY_PICTURE (pSrc, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); if (!pSrc->pDrawable) return BadDrawable; @@ -1699,7 +1699,7 @@ ProcRenderSetPictureTransform (ClientPtr client) int result; REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); result = SetPictureTransform (pPicture, (PictTransform *) &stuff->transform); if (client->noClientException != Success) @@ -1726,7 +1726,7 @@ ProcRenderQueryFilters (ClientPtr client) char *names; REQUEST_SIZE_MATCH(xRenderQueryFiltersReq); - SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, SecurityReadAccess); + SECURITY_VERIFY_DRAWABLE(pDrawable, stuff->drawable, client, DixReadAccess); pScreen = pDrawable->pScreen; nbytesName = 0; @@ -1828,7 +1828,7 @@ ProcRenderSetPictureFilter (ClientPtr client) char *name; REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); name = (char *) (stuff + 1); params = (xFixed *) (name + ((stuff->nbytes + 3) & ~3)); @@ -1862,7 +1862,7 @@ ProcRenderCreateAnimCursor (ClientPtr client) for (i = 0; i < ncursor; i++) { cursors[i] = (CursorPtr)SecurityLookupIDByType(client, elt->cursor, - RT_CURSOR, SecurityReadAccess); + RT_CURSOR, DixReadAccess); if (!cursors[i]) { free (cursors); @@ -1891,7 +1891,7 @@ ProcRenderAddTraps (ClientPtr client) REQUEST(xRenderAddTrapsReq); REQUEST_AT_LEAST_SIZE(xRenderAddTrapsReq); - VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE (pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); if (!pPicture->pDrawable) return BadDrawable; @@ -2644,7 +2644,7 @@ PanoramiXRenderCreatePicture (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderCreatePictureReq); if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass( - client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess))) + client, stuff->drawable, XRC_DRAWABLE, DixWriteAccess))) return BadDrawable; if(!(newPict = (PanoramiXRes *) malloc(sizeof(PanoramiXRes)))) return BadAlloc; @@ -2686,7 +2686,7 @@ PanoramiXRenderChangePicture (ClientPtr client) REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2707,7 +2707,7 @@ PanoramiXRenderSetPictureClipRectangles (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureClipRectanglesReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2728,7 +2728,7 @@ PanoramiXRenderSetPictureTransform (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureTransformReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2749,7 +2749,7 @@ PanoramiXRenderSetPictureFilter (ClientPtr client) REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq); - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); FOR_NSCREENS_BACKWARD(j) { @@ -2772,7 +2772,7 @@ PanoramiXRenderFreePicture (ClientPtr client) client->errorValue = stuff->picture; - VERIFY_XIN_PICTURE(pict, stuff->picture, client, SecurityDestroyAccess, + VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess, RenderErrBase + BadPicture); @@ -2798,11 +2798,11 @@ PanoramiXRenderComposite (ClientPtr client) REQUEST_SIZE_MATCH(xRenderCompositeReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_ALPHA (msk, stuff->mask, client, SecurityReadAccess, + VERIFY_XIN_ALPHA (msk, stuff->mask, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); orig = *stuff; @@ -2846,9 +2846,9 @@ PanoramiXRenderCompositeGlyphs (ClientPtr client) INT16 xSrc, ySrc; REQUEST_AT_LEAST_SIZE(xRenderCompositeGlyphsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); if (client->req_len << 2 >= (sizeof (xRenderCompositeGlyphsReq) + @@ -2889,7 +2889,7 @@ PanoramiXRenderFillRectangles (ClientPtr client) int extra_len; REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderFillRectanglesReq); if (extra_len && @@ -2936,9 +2936,9 @@ PanoramiXRenderTrapezoids(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTrapezoidsReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTrapezoidsReq); @@ -2998,9 +2998,9 @@ PanoramiXRenderTriangles(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTrianglesReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTrianglesReq); @@ -3056,9 +3056,9 @@ PanoramiXRenderTriStrip(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTriStripReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTriStripReq); @@ -3110,9 +3110,9 @@ PanoramiXRenderTriFan(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderTriFanReq); - VERIFY_XIN_PICTURE (src, stuff->src, client, SecurityReadAccess, + VERIFY_XIN_PICTURE (src, stuff->src, client, DixReadAccess, RenderErrBase + BadPicture); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderTriFanReq); @@ -3166,7 +3166,7 @@ PanoramiXRenderColorTrapezoids(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderColorTrapezoidsReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderColorTrapezoidsReq); @@ -3210,7 +3210,7 @@ PanoramiXRenderColorTriangles(ClientPtr client) REQUEST_AT_LEAST_SIZE (xRenderColorTrianglesReq); - VERIFY_XIN_PICTURE (dst, stuff->dst, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (dst, stuff->dst, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderColorTrianglesReq); @@ -3256,7 +3256,7 @@ PanoramiXRenderAddTraps (ClientPtr client) INT16 x_off, y_off; REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq); - VERIFY_XIN_PICTURE (picture, stuff->picture, client, SecurityWriteAccess, + VERIFY_XIN_PICTURE (picture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); extra_len = (client->req_len << 2) - sizeof (xRenderAddTrapsReq); if (extra_len && diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 61822aab7..67f46f55e 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -193,7 +193,7 @@ ProcXFixesSelectCursorInput (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesSelectCursorInputReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); if (stuff->eventMask & ~CursorAllEvents) @@ -362,7 +362,7 @@ ProcXFixesSetCursorName (ClientPtr client) Atom atom; REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); - VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityWriteAccess); + VERIFY_CURSOR(pCursor, stuff->cursor, client, DixWriteAccess); tchar = (char *) &stuff[1]; atom = MakeAtom (tchar, stuff->nbytes, TRUE); if (atom == BAD_RESOURCE) @@ -394,7 +394,7 @@ ProcXFixesGetCursorName (ClientPtr client) int len; REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); - VERIFY_CURSOR(pCursor, stuff->cursor, client, SecurityReadAccess); + VERIFY_CURSOR(pCursor, stuff->cursor, client, DixReadAccess); if (pCursor->name) str = NameForAtom (pCursor->name); else @@ -619,8 +619,8 @@ ProcXFixesChangeCursor (ClientPtr client) REQUEST(xXFixesChangeCursorReq); REQUEST_SIZE_MATCH(xXFixesChangeCursorReq); - VERIFY_CURSOR (pSource, stuff->source, client, SecurityReadAccess); - VERIFY_CURSOR (pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_CURSOR (pSource, stuff->source, client, DixReadAccess); + VERIFY_CURSOR (pDestination, stuff->destination, client, DixWriteAccess); ReplaceCursor (pSource, TestForCursor, (void *) pDestination); return (client->noClientException); @@ -653,7 +653,7 @@ ProcXFixesChangeCursorByName (ClientPtr client) REQUEST(xXFixesChangeCursorByNameReq); REQUEST_FIXED_SIZE(xXFixesChangeCursorByNameReq, stuff->nbytes); - VERIFY_CURSOR(pSource, stuff->source, client, SecurityReadAccess); + VERIFY_CURSOR(pSource, stuff->source, client, DixReadAccess); tchar = (char *) &stuff[1]; name = MakeAtom (tchar, stuff->nbytes, FALSE); if (name) diff --git a/nx-X11/programs/Xserver/xfixes/region.c b/nx-X11/programs/Xserver/xfixes/region.c index 6759b4bfe..31d19b5ff 100644 --- a/nx-X11/programs/Xserver/xfixes/region.c +++ b/nx-X11/programs/Xserver/xfixes/region.c @@ -117,7 +117,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) pPixmap = (PixmapPtr) SecurityLookupIDByType (client, stuff->bitmap, RT_PIXMAP, - SecurityReadAccess); + DixReadAccess); if (!pPixmap) { client->errorValue = stuff->bitmap; @@ -222,7 +222,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq); LEGAL_NEW_RESOURCE (stuff->region, client); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityReadAccess); + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess); switch (pGC->clientClipType) { case CT_PIXMAP: @@ -269,7 +269,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq); LEGAL_NEW_RESOURCE (stuff->region, client); - VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityReadAccess, + VERIFY_PICTURE(pPicture, stuff->picture, client, DixReadAccess, RenderErrBase + BadPicture); switch (pPicture->clientClipType) { @@ -316,7 +316,7 @@ ProcXFixesDestroyRegion (ClientPtr client) RegionPtr pRegion; REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); FreeResource (stuff->region, RT_NONE); return(client->noClientException); } @@ -340,7 +340,7 @@ ProcXFixesSetRegion (ClientPtr client) REQUEST (xXFixesSetRegionReq); REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); things = (client->req_len << 2) - sizeof (xXFixesCreateRegionReq); if (things & 4) @@ -377,8 +377,8 @@ ProcXFixesCopyRegion (ClientPtr client) RegionPtr pSource, pDestination; REQUEST (xXFixesCopyRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); if (!RegionCopy(pDestination, pSource)) return BadAlloc; @@ -406,9 +406,9 @@ ProcXFixesCombineRegion (ClientPtr client) REQUEST (xXFixesCombineRegionReq); REQUEST_SIZE_MATCH (xXFixesCombineRegionReq); - VERIFY_REGION(pSource1, stuff->source1, client, SecurityReadAccess); - VERIFY_REGION(pSource2, stuff->source2, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource1, stuff->source1, client, DixReadAccess); + VERIFY_REGION(pSource2, stuff->source2, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); switch (stuff->xfixesReqType) { case X_XFixesUnionRegion: @@ -452,8 +452,8 @@ ProcXFixesInvertRegion (ClientPtr client) REQUEST(xXFixesInvertRegionReq); REQUEST_SIZE_MATCH(xXFixesInvertRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); /* Compute bounds, limit to 16 bits */ bounds.x1 = stuff->x; @@ -499,7 +499,7 @@ ProcXFixesTranslateRegion (ClientPtr client) REQUEST(xXFixesTranslateRegionReq); REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); RegionTranslate(pRegion, stuff->dx, stuff->dy); return (client->noClientException); @@ -525,8 +525,8 @@ ProcXFixesRegionExtents (ClientPtr client) REQUEST(xXFixesRegionExtentsReq); REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); RegionReset(pDestination, RegionExtents(pSource)); @@ -557,7 +557,7 @@ ProcXFixesFetchRegion (ClientPtr client) REQUEST(xXFixesFetchRegionReq); REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); - VERIFY_REGION(pRegion, stuff->region, client, SecurityReadAccess); + VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess); pExtent = RegionExtents(pRegion); pBox = RegionRects (pRegion); @@ -618,8 +618,8 @@ ProcXFixesSetGCClipRegion (ClientPtr client) REQUEST(xXFixesSetGCClipRegionReq); REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq); - SECURITY_VERIFY_GC(pGC, stuff->gc, client, SecurityWriteAccess); - VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, SecurityReadAccess); + SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixWriteAccess); + VERIFY_REGION_OR_NONE (pRegion, stuff->region, client, DixReadAccess); if (pRegion) { @@ -669,7 +669,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) client->errorValue = stuff->dest; return BadWindow; } - VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityWriteAccess); + VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixWriteAccess); pScreen = pWin->drawable.pScreen; switch (stuff->destKind) { case ShapeBounding: @@ -756,9 +756,9 @@ ProcXFixesSetPictureClipRegion (ClientPtr client) REQUEST(xXFixesSetPictureClipRegionReq); REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq); - VERIFY_PICTURE(pPicture, stuff->picture, client, SecurityWriteAccess, + VERIFY_PICTURE(pPicture, stuff->picture, client, DixWriteAccess, RenderErrBase + BadPicture); - VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, SecurityReadAccess); + VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess); return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin, pRegion); @@ -793,8 +793,8 @@ ProcXFixesExpandRegion (ClientPtr client) int i; REQUEST_SIZE_MATCH (xXFixesExpandRegionReq); - VERIFY_REGION(pSource, stuff->source, client, SecurityReadAccess); - VERIFY_REGION(pDestination, stuff->destination, client, SecurityWriteAccess); + VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); + VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); nBoxes = RegionNumRects(pSource); pSrc = RegionRects(pSource); diff --git a/nx-X11/programs/Xserver/xfixes/saveset.c b/nx-X11/programs/Xserver/xfixes/saveset.c index a81c0ca1b..0a5b2b8da 100644 --- a/nx-X11/programs/Xserver/xfixes/saveset.c +++ b/nx-X11/programs/Xserver/xfixes/saveset.c @@ -38,7 +38,7 @@ ProcXFixesChangeSaveSet(ClientPtr client) REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id))) diff --git a/nx-X11/programs/Xserver/xfixes/select.c b/nx-X11/programs/Xserver/xfixes/select.c index 600abc660..b21301d1c 100644 --- a/nx-X11/programs/Xserver/xfixes/select.c +++ b/nx-X11/programs/Xserver/xfixes/select.c @@ -198,7 +198,7 @@ ProcXFixesSelectSelectionInput (ClientPtr client) REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq); pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); + DixReadAccess); if (!pWin) return(BadWindow); if (stuff->eventMask & ~SelectionAllEvents) -- cgit v1.2.3