forgot that too...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22714 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
09d6e976df
commit
2e46156d87
@ -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
|
#ifndef __REGION_SUPPORT_H
|
||||||
#define __REGION_SUPPORT_H
|
#define __REGION_SUPPORT_H
|
||||||
@ -6,38 +52,101 @@
|
|||||||
#include <Region.h>
|
#include <Region.h>
|
||||||
|
|
||||||
class BRegion::Support {
|
class BRegion::Support {
|
||||||
public:
|
public:
|
||||||
static void ZeroRegion(BRegion ®ion);
|
static int XUnionRegion(const BRegion* reg1,
|
||||||
static void ClearRegion(BRegion ®ion);
|
const BRegion* reg2, BRegion* newReg);
|
||||||
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);
|
|
||||||
|
|
||||||
private:
|
static int XIntersectRegion(const BRegion* reg1,
|
||||||
static void CleanupRegion(BRegion ®ion);
|
const BRegion* reg2, BRegion* newReg);
|
||||||
static void CleanupRegionVertical(BRegion ®ion);
|
|
||||||
static void CleanupRegionHorizontal(BRegion ®ion);
|
|
||||||
|
|
||||||
static void SortRects(clipping_rect *rects, long count);
|
static int XSubtractRegion(const BRegion* regM,
|
||||||
static void SortTrans(int32 *lptr1, int32 *lptr2, long count);
|
const BRegion* regS, BRegion* regD);
|
||||||
|
|
||||||
static void CopyRegionMore(const BRegion &, BRegion &, long);
|
static int XXorRegion(const BRegion* sra,
|
||||||
|
const BRegion* srb, BRegion* dr);
|
||||||
|
|
||||||
static void AndRegionComplex(const BRegion &, const BRegion &, BRegion &);
|
static int XPointInRegion(const BRegion* region,
|
||||||
static void AndRegion1ToN(const BRegion &, const BRegion &, BRegion &);
|
int x, int y);
|
||||||
|
|
||||||
static void AppendRegion(const BRegion &, const BRegion &, BRegion &);
|
enum {
|
||||||
|
RectangleOut = 0,
|
||||||
|
RectanglePart = 1,
|
||||||
|
RectangleIn = 2
|
||||||
|
};
|
||||||
|
|
||||||
static void OrRegionComplex(const BRegion &, const BRegion &, BRegion &);
|
static int XRectInRegion(const BRegion* region,
|
||||||
static void OrRegion1ToN(const BRegion &, const BRegion &, BRegion &);
|
const clipping_rect& rect);
|
||||||
static void OrRegionNoX(const BRegion &, const BRegion &, BRegion &);
|
|
||||||
static void ROr(long, long, const BRegion &, const BRegion &,
|
private:
|
||||||
BRegion &, long *, long *);
|
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
|
#endif // __REGION_SUPPORT_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user