Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/X11
File: Xregion.h
/************************************************************************
[0] Fix | Delete
[1] Fix | Delete
Copyright 1987, 1998 The Open Group
[2] Fix | Delete
[3] Fix | Delete
Permission to use, copy, modify, distribute, and sell this software and its
[4] Fix | Delete
documentation for any purpose is hereby granted without fee, provided that
[5] Fix | Delete
the above copyright notice appear in all copies and that both that
[6] Fix | Delete
copyright notice and this permission notice appear in supporting
[7] Fix | Delete
documentation.
[8] Fix | Delete
[9] Fix | Delete
The above copyright notice and this permission notice shall be included in
[10] Fix | Delete
all copies or substantial portions of the Software.
[11] Fix | Delete
[12] Fix | Delete
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
[13] Fix | Delete
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
[14] Fix | Delete
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
[15] Fix | Delete
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
[16] Fix | Delete
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
[17] Fix | Delete
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[18] Fix | Delete
[19] Fix | Delete
Except as contained in this notice, the name of The Open Group shall not be
[20] Fix | Delete
used in advertising or otherwise to promote the sale, use or other dealings
[21] Fix | Delete
in this Software without prior written authorization from The Open Group.
[22] Fix | Delete
[23] Fix | Delete
[24] Fix | Delete
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
[25] Fix | Delete
[26] Fix | Delete
All Rights Reserved
[27] Fix | Delete
[28] Fix | Delete
Permission to use, copy, modify, and distribute this software and its
[29] Fix | Delete
documentation for any purpose and without fee is hereby granted,
[30] Fix | Delete
provided that the above copyright notice appear in all copies and that
[31] Fix | Delete
both that copyright notice and this permission notice appear in
[32] Fix | Delete
supporting documentation, and that the name of Digital not be
[33] Fix | Delete
used in advertising or publicity pertaining to distribution of the
[34] Fix | Delete
software without specific, written prior permission.
[35] Fix | Delete
[36] Fix | Delete
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
[37] Fix | Delete
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
[38] Fix | Delete
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
[39] Fix | Delete
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
[40] Fix | Delete
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
[41] Fix | Delete
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
[42] Fix | Delete
SOFTWARE.
[43] Fix | Delete
[44] Fix | Delete
************************************************************************/
[45] Fix | Delete
[46] Fix | Delete
#ifndef _X11_XREGION_H_
[47] Fix | Delete
#define _X11_XREGION_H_
[48] Fix | Delete
[49] Fix | Delete
typedef struct {
[50] Fix | Delete
short x1, x2, y1, y2;
[51] Fix | Delete
} Box, BOX, BoxRec, *BoxPtr;
[52] Fix | Delete
[53] Fix | Delete
typedef struct {
[54] Fix | Delete
short x, y, width, height;
[55] Fix | Delete
}RECTANGLE, RectangleRec, *RectanglePtr;
[56] Fix | Delete
[57] Fix | Delete
#define TRUE 1
[58] Fix | Delete
#define FALSE 0
[59] Fix | Delete
#define MAXSHORT 32767
[60] Fix | Delete
#define MINSHORT -MAXSHORT
[61] Fix | Delete
#ifndef MAX
[62] Fix | Delete
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
[63] Fix | Delete
#endif
[64] Fix | Delete
#ifndef MIN
[65] Fix | Delete
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
[66] Fix | Delete
#endif
[67] Fix | Delete
[68] Fix | Delete
[69] Fix | Delete
/*
[70] Fix | Delete
* clip region
[71] Fix | Delete
*/
[72] Fix | Delete
[73] Fix | Delete
typedef struct _XRegion {
[74] Fix | Delete
long size;
[75] Fix | Delete
long numRects;
[76] Fix | Delete
BOX *rects;
[77] Fix | Delete
BOX extents;
[78] Fix | Delete
} REGION;
[79] Fix | Delete
[80] Fix | Delete
/* Xutil.h contains the declaration:
[81] Fix | Delete
* typedef struct _XRegion *Region;
[82] Fix | Delete
*/
[83] Fix | Delete
[84] Fix | Delete
/* 1 if two BOXs overlap.
[85] Fix | Delete
* 0 if two BOXs do not overlap.
[86] Fix | Delete
* Remember, x2 and y2 are not in the region
[87] Fix | Delete
*/
[88] Fix | Delete
#define EXTENTCHECK(r1, r2) \
[89] Fix | Delete
((r1)->x2 > (r2)->x1 && \
[90] Fix | Delete
(r1)->x1 < (r2)->x2 && \
[91] Fix | Delete
(r1)->y2 > (r2)->y1 && \
[92] Fix | Delete
(r1)->y1 < (r2)->y2)
[93] Fix | Delete
[94] Fix | Delete
/*
[95] Fix | Delete
* update region extents
[96] Fix | Delete
*/
[97] Fix | Delete
#define EXTENTS(r,idRect){\
[98] Fix | Delete
if((r)->x1 < (idRect)->extents.x1)\
[99] Fix | Delete
(idRect)->extents.x1 = (r)->x1;\
[100] Fix | Delete
if((r)->y1 < (idRect)->extents.y1)\
[101] Fix | Delete
(idRect)->extents.y1 = (r)->y1;\
[102] Fix | Delete
if((r)->x2 > (idRect)->extents.x2)\
[103] Fix | Delete
(idRect)->extents.x2 = (r)->x2;\
[104] Fix | Delete
if((r)->y2 > (idRect)->extents.y2)\
[105] Fix | Delete
(idRect)->extents.y2 = (r)->y2;\
[106] Fix | Delete
}
[107] Fix | Delete
[108] Fix | Delete
/*
[109] Fix | Delete
* Check to see if there is enough memory in the present region.
[110] Fix | Delete
*/
[111] Fix | Delete
#define MEMCHECK(reg, rect, firstrect){\
[112] Fix | Delete
if ((reg)->numRects >= ((reg)->size - 1)){\
[113] Fix | Delete
BoxPtr tmpRect = Xrealloc ((firstrect), \
[114] Fix | Delete
(2 * (sizeof(BOX)) * ((reg)->size))); \
[115] Fix | Delete
if (tmpRect == NULL) \
[116] Fix | Delete
return(0);\
[117] Fix | Delete
(firstrect) = tmpRect; \
[118] Fix | Delete
(reg)->size *= 2;\
[119] Fix | Delete
(rect) = &(firstrect)[(reg)->numRects];\
[120] Fix | Delete
}\
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
/* this routine checks to see if the previous rectangle is the same
[124] Fix | Delete
* or subsumes the new rectangle to add.
[125] Fix | Delete
*/
[126] Fix | Delete
[127] Fix | Delete
#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\
[128] Fix | Delete
(!(((Reg)->numRects > 0)&&\
[129] Fix | Delete
((R-1)->y1 == (Ry1)) &&\
[130] Fix | Delete
((R-1)->y2 == (Ry2)) &&\
[131] Fix | Delete
((R-1)->x1 <= (Rx1)) &&\
[132] Fix | Delete
((R-1)->x2 >= (Rx2))))
[133] Fix | Delete
[134] Fix | Delete
/* add a rectangle to the given Region */
[135] Fix | Delete
#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\
[136] Fix | Delete
if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\
[137] Fix | Delete
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
[138] Fix | Delete
(r)->x1 = (rx1);\
[139] Fix | Delete
(r)->y1 = (ry1);\
[140] Fix | Delete
(r)->x2 = (rx2);\
[141] Fix | Delete
(r)->y2 = (ry2);\
[142] Fix | Delete
EXTENTS((r), (reg));\
[143] Fix | Delete
(reg)->numRects++;\
[144] Fix | Delete
(r)++;\
[145] Fix | Delete
}\
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
[149] Fix | Delete
[150] Fix | Delete
/* add a rectangle to the given Region */
[151] Fix | Delete
#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\
[152] Fix | Delete
if ((rx1 < rx2) && (ry1 < ry2) &&\
[153] Fix | Delete
CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\
[154] Fix | Delete
(r)->x1 = (rx1);\
[155] Fix | Delete
(r)->y1 = (ry1);\
[156] Fix | Delete
(r)->x2 = (rx2);\
[157] Fix | Delete
(r)->y2 = (ry2);\
[158] Fix | Delete
(reg)->numRects++;\
[159] Fix | Delete
(r)++;\
[160] Fix | Delete
}\
[161] Fix | Delete
}
[162] Fix | Delete
[163] Fix | Delete
#define EMPTY_REGION(pReg) pReg->numRects = 0
[164] Fix | Delete
[165] Fix | Delete
#define REGION_NOT_EMPTY(pReg) pReg->numRects
[166] Fix | Delete
[167] Fix | Delete
#define INBOX(r, x, y) \
[168] Fix | Delete
( ( ((r).x2 > x)) && \
[169] Fix | Delete
( ((r).x1 <= x)) && \
[170] Fix | Delete
( ((r).y2 > y)) && \
[171] Fix | Delete
( ((r).y1 <= y)) )
[172] Fix | Delete
[173] Fix | Delete
/*
[174] Fix | Delete
* number of points to buffer before sending them off
[175] Fix | Delete
* to scanlines() : Must be an even number
[176] Fix | Delete
*/
[177] Fix | Delete
#define NUMPTSTOBUFFER 200
[178] Fix | Delete
[179] Fix | Delete
/*
[180] Fix | Delete
* used to allocate buffers for points and link
[181] Fix | Delete
* the buffers together
[182] Fix | Delete
*/
[183] Fix | Delete
typedef struct _POINTBLOCK {
[184] Fix | Delete
XPoint pts[NUMPTSTOBUFFER];
[185] Fix | Delete
struct _POINTBLOCK *next;
[186] Fix | Delete
} POINTBLOCK;
[187] Fix | Delete
[188] Fix | Delete
#endif /* _X11_XREGION_H_ */
[189] Fix | Delete
[190] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function