Browse Source

Update Xregion to latest upstream

tags/v1.6.90
Pierre Ossman 8 years ago
parent
commit
3157ed900c
3 changed files with 269 additions and 384 deletions
  1. 247
    329
      common/Xregion/Region.c
  2. 13
    13
      common/Xregion/Xregion.h
  3. 9
    42
      common/Xregion/Xutil.h

+ 247
- 329
common/Xregion/Region.c
File diff suppressed because it is too large
View File


+ 13
- 13
common/Xregion/Xregion.h View File

@@ -1,4 +1,3 @@
/* $Xorg: region.h,v 1.4 2001/02/09 02:03:40 xorgcvs Exp $ */
/************************************************************************

Copyright 1987, 1998 The Open Group
@@ -28,13 +27,13 @@ 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,
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
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.
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
@@ -69,7 +68,7 @@ typedef struct {
#endif


/*
/*
* clip region
*/

@@ -80,13 +79,13 @@ typedef struct _XRegion {
BOX extents;
} REGION;

/* Xutil.h contains the declaration:
* typedef struct _XRegion *Region;
*/
/* Xutil.h contains the declaration:
* typedef struct _XRegion *Region;
*/

/* 1 if two BOXs overlap.
* 0 if two BOXs do not overlap.
* Remember, x2 and y2 are not in the region
* Remember, x2 and y2 are not in the region
*/
#define EXTENTCHECK(r1, r2) \
((r1)->x2 > (r2)->x1 && \
@@ -113,10 +112,11 @@ typedef struct _XRegion {
*/
#define MEMCHECK(reg, rect, firstrect){\
if ((reg)->numRects >= ((reg)->size - 1)){\
(firstrect) = (BOX *) Xrealloc \
((char *)(firstrect), (unsigned) (2 * (sizeof(BOX)) * ((reg)->size)));\
if ((firstrect) == 0)\
BoxPtr tmpRect = Xrealloc ((firstrect), \
(2 * (sizeof(BOX)) * ((reg)->size))); \
if (tmpRect == NULL) \
return(0);\
(firstrect) = tmpRect; \
(reg)->size *= 2;\
(rect) = &(firstrect)[(reg)->numRects];\
}\

+ 9
- 42
common/Xregion/Xutil.h View File

@@ -1,4 +1,3 @@
/* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */

/***********************************************************

@@ -29,13 +28,13 @@ 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,
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
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.
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
@@ -46,7 +45,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/
/* $XFree86: xc/lib/X11/Xutil.h,v 3.4 2001/12/14 19:54:10 dawes Exp $ */

#ifndef _X11_XUTIL_H_
#define _X11_XUTIL_H_
@@ -54,131 +52,100 @@ SOFTWARE.
/* You must include <X11/Xlib.h> before including this file */
#include "Xlib.h"


/*
* opaque reference to Region data type
* opaque reference to Region data type
*/
typedef struct _XRegion *Region;
typedef struct _XRegion *Region;

/* Return values from XRectInRegion() */
#define RectangleOut 0
#define RectangleIn 1
#define RectanglePart 2

extern int XClipBox(
#if NeedFunctionPrototypes
Region /* r */,
XRectangle* /* rect_return */
#endif
);

extern Region XCreateRegion(
#if NeedFunctionPrototypes
void
#endif
);

extern const char *XDefaultString (void);

extern int XDestroyRegion(
#if NeedFunctionPrototypes
Region /* r */
#endif
);

extern int XEmptyRegion(
#if NeedFunctionPrototypes
Region /* r */
#endif
);

extern int XEqualRegion(
#if NeedFunctionPrototypes
Region /* r1 */,
Region /* r2 */
#endif
);

extern int XIntersectRegion(
#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
#endif
);

extern int XOffsetRegion(
#if NeedFunctionPrototypes
Region /* r */,
int /* dx */,
int /* dy */
#endif
);

extern Bool XPointInRegion(
#if NeedFunctionPrototypes
Region /* r */,
int /* x */,
int /* y */
#endif
);

extern Region XPolygonRegion(
#if NeedFunctionPrototypes
XPoint* /* points */,
int /* n */,
int /* fill_rule */
#endif
);

extern int XRectInRegion(
#if NeedFunctionPrototypes
Region /* r */,
int /* x */,
int /* y */,
unsigned int /* width */,
unsigned int /* height */
#endif
);

extern int XShrinkRegion(
#if NeedFunctionPrototypes
Region /* r */,
int /* dx */,
int /* dy */
#endif
);

extern int XSubtractRegion(
#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
#endif
);

extern int XUnionRectWithRegion(
#if NeedFunctionPrototypes
XRectangle* /* rectangle */,
Region /* src_region */,
Region /* dest_region_return */
#endif
);

extern int XUnionRegion(
#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
#endif
);

extern int XXorRegion(
#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
#endif
);

#endif /* _XUTIL_H_ */
#endif /* _X11_XUTIL_H_ */

Loading…
Cancel
Save