f78b12e570284aa8291f4ca1add24937fd107403vboxsync/***********************************************************
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCopyright 1987, 1998 The Open Group
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncthe above copyright notice appear in all copies and that both that
f78b12e570284aa8291f4ca1add24937fd107403vboxsynccopyright notice and this permission notice appear in supporting
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncThe above copyright notice and this permission notice shall be included in
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncall copies or substantial portions of the Software.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncin this Software without prior written authorization from The Open Group.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync All Rights Reserved
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPermission to use, copy, modify, and distribute this software and its
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation for any purpose and without fee is hereby granted,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncprovided that the above copyright notice appear in all copies and that
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncboth that copyright notice and this permission notice appear in
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncsupporting documentation, and that the name of Digital not be
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncused in advertising or publicity pertaining to distribution of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncsoftware without specific, written prior permission.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
f78b12e570284aa8291f4ca1add24937fd107403vboxsync******************************************************************/
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct pixman_region16 RegionRec, *RegionPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* Return values from RectIn() */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * clip region
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct pixman_region16_data RegDataRec, *RegDataPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* not a region */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return ((reg)->data ? (BoxPtr)((reg)->data + 1) : &(reg)->extents);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline BoxPtr RegionBox(RegionPtr reg, int i) {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool RegionInitBoxes(RegionPtr pReg, BoxPtr boxes, int nBoxes)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return pixman_region_init_rects (pReg, boxes, nBoxes);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline void RegionReset(RegionPtr _pReg, BoxPtr _pBox)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool RegionNotEmpty(RegionPtr _pReg) {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int /*size*/);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return pixman_region_intersect (newReg, reg1, reg2);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int /*nrects*/,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int /*ctype*/);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *-----------------------------------------------------------------------
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Subtract --
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Subtract regS from regM and leave the result in regD.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * S stands for subtrahend, M for minuend and D for difference.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * TRUE if successful.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Side Effects:
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * regD is overwritten.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *-----------------------------------------------------------------------
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncRegionSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *-----------------------------------------------------------------------
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Inverse --
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Take a region and a box and return a region that is everything
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * in the box but not in the region. The careful reader will note
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * that this is the same as subtracting the region from the box...
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Side Effects:
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * newReg is overwritten.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *-----------------------------------------------------------------------
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return pixman_region_inverse (newReg, reg1, invRect);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline int
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return pixman_region_contains_rectangle (region, prect);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* TranslateRegion(pReg, x, y)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync translates in place
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline void
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsync return pixman_region_contains_point (pReg, x, y, box);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncstatic inline Bool
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_CREATE(pScreen, r, s) RegionCreate(r,s)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_INTERSECT(pScreen, res, r1, r2) RegionIntersect(res, r1, r2)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_UNION(pScreen, res, r1, r2) RegionUnion(res, r1, r2)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_SUBTRACT(pScreen, res, r1, r2) RegionSubtract(res, r1, r2)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_INVERSE(pScreen, n, r, b) RegionInverse(n, r, b)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_TRANSLATE(pScreen, r, x, y) RegionTranslate(r, x, y)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define RECT_IN_REGION(pScreen, r, b) RegionContainsRect(r, b)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define POINT_IN_REGION(pScreen, r, x, y, b) RegionContainsPoint(r, x, y, b)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_EQUAL(pScreen, r1, r2) RegionEqual(r1, r2)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_APPEND(pScreen, d, r) RegionAppend(d, r)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_VALIDATE(pScreen, r, o) RegionValidate(r, o)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define RECTS_TO_REGION(pScreen, n, r, c) RegionFromRects(n, r, c)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_INIT(pScreen, r, b, s) RegionInit(r, b, s)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_RESET(pScreen, r, b) RegionReset(r, b)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define REGION_NOTEMPTY(pScreen, r) RegionNotEmpty(r)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* INCLUDE_LEGACY_REGION_DEFINES */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* REGIONSTRUCT_H */