From 93a30169f34262fcb861ea308a7d8a24f9abceaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 19 Jul 2007 17:22:53 +0000 Subject: [PATCH] * fix the build, forgot to commit this... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21667 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/interface/RegionSupport.h | 169 ++++++++++++++++++---- 1 file changed, 139 insertions(+), 30 deletions(-) diff --git a/headers/private/interface/RegionSupport.h b/headers/private/interface/RegionSupport.h index 7ceeb60986..dee1351bec 100644 --- a/headers/private/interface/RegionSupport.h +++ b/headers/private/interface/RegionSupport.h @@ -1,4 +1,50 @@ -// This file is distributed under the OpenBeOS license +/* $Xorg: region.h,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */ +/************************************************************************ + +Copyright 1987, 1998 The Open Group + +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. + +The above copyright notice and this permission notice 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 +OPEN GROUP 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. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +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 Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL 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. + +************************************************************************/ #ifndef __REGION_SUPPORT_H #define __REGION_SUPPORT_H @@ -6,38 +52,101 @@ #include class BRegion::Support { -public: - static void ZeroRegion(BRegion ®ion); - static void ClearRegion(BRegion ®ion); - static void CopyRegion(const BRegion &source, BRegion &dest); - static void AndRegion(const BRegion &first, const BRegion &second, BRegion &dest); - static void OrRegion(const BRegion &first, const BRegion &second, BRegion &dest); - static void SubRegion(const BRegion &first, const BRegion &second, BRegion &dest); + public: + static int XUnionRegion(const BRegion* reg1, + const BRegion* reg2, BRegion* newReg); -private: - static void CleanupRegion(BRegion ®ion); - static void CleanupRegionVertical(BRegion ®ion); - static void CleanupRegionHorizontal(BRegion ®ion); - - static void SortRects(clipping_rect *rects, long count); - static void SortTrans(long *lptr1, long *lptr2, long count); - - static void CopyRegionMore(const BRegion &, BRegion &, long); - - static void AndRegionComplex(const BRegion &, const BRegion &, BRegion &); - static void AndRegion1ToN(const BRegion &, const BRegion &, BRegion &); + static int XIntersectRegion(const BRegion* reg1, + const BRegion* reg2, BRegion* newReg); - static void AppendRegion(const BRegion &, const BRegion &, BRegion &); - - static void OrRegionComplex(const BRegion &, const BRegion &, BRegion &); - static void OrRegion1ToN(const BRegion &, const BRegion &, BRegion &); - static void OrRegionNoX(const BRegion &, const BRegion &, BRegion &); - static void ROr(long, long, const BRegion &, const BRegion &, - BRegion &, long *, long *); + static int XSubtractRegion(const BRegion* regM, + const BRegion* regS, BRegion* regD); + + static int XXorRegion(const BRegion* sra, + const BRegion* srb, BRegion* dr); + + static int XPointInRegion(const BRegion* region, + int x, int y); + + enum { + RectangleOut = 0, + RectanglePart = 1, + RectangleIn = 2 + }; + + static int XRectInRegion(const BRegion* region, + const clipping_rect& rect); + + private: + static BRegion* CreateRegion(); + static void DestroyRegion(BRegion* r); + + static void XOffsetRegion(BRegion* pRegion, int x, int y); + + static void miSetExtents(BRegion* pReg); + static int miIntersectO(BRegion* pReg, + clipping_rect* r1, clipping_rect* r1End, + clipping_rect* r2, clipping_rect* r2End, + int top, int bottom); + static void miRegionCopy(BRegion* dstrgn, const BRegion* rgn); + static int miCoalesce(BRegion* pReg, + int prevStart, int curStart); + static int miUnionNonO(BRegion* pReg, clipping_rect* r, + clipping_rect* rEnd, int top, int bottom); + static int miUnionO(BRegion* pReg, + clipping_rect* r1, clipping_rect* r1End, + clipping_rect* r2, clipping_rect* r2End, + int top, int bottom); + static int miSubtractO(BRegion* pReg, + clipping_rect* r1, clipping_rect* r1End, + clipping_rect* r2, clipping_rect* r2End, + int top, int bottom); + static int miSubtractNonO1(BRegion* pReg, + clipping_rect* r, clipping_rect* rEnd, + int top, int bottom); + + + + typedef int (*overlapProcp)( + BRegion* pReg, + clipping_rect* r1, + clipping_rect* r1End, + register clipping_rect* r2, + clipping_rect* r2End, + int top, + int bottom); + + typedef int (*nonOverlapProcp)( + BRegion* pReg, + clipping_rect* r, + clipping_rect* rEnd, + int top, + int bottom); + + static void miRegionOp(BRegion* newReg, + const BRegion* reg1, const BRegion* reg2, + int (*overlapFunc)( + register BRegion* pReg, + register clipping_rect* r1, + clipping_rect* r1End, + register clipping_rect* r2, + clipping_rect* r2End, + int top, + int bottom), + int (*nonOverlap1Func)( + register BRegion* pReg, + register clipping_rect* r, + clipping_rect* rEnd, + register int top, + register int bottom), + + int (*nonOverlap2Func)( + register BRegion* pReg, + register clipping_rect* r, + clipping_rect* rEnd, + register int top, + register int bottom)); - static void SubRegionComplex(const BRegion &, const BRegion &, BRegion &); - static void RSub(long, long, const BRegion &, const BRegion &, - BRegion &, long *, long *); }; #endif // __REGION_SUPPORT_H