7 /* $XConsortium: mispritest.h,v 5.14 94/04/17 20:27:55 dpw Exp $ */
11 Copyright (c) 1989 X Consortium
13 Permission is hereby granted, free of charge, to any person obtaining a copy
14 of this software and associated documentation files (the "Software"), to deal
15 in the Software without restriction, including without limitation the rights
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 copies of the Software, and to permit persons to whom the Software is
18 furnished to do so, subject to the following conditions:
20 The above copyright notice and this permission notice shall be included in
21 all copies or substantial portions of the Software.
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
27 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 Except as contained in this notice, the name of the X Consortium shall not be
31 used in advertising or otherwise to promote the sale, use or other dealings
32 in this Software without prior written authorization from the X Consortium.
35 # include "misprite.h"
38 * per screen information
42 CloseScreenProcPtr CloseScreen;
43 GetImageProcPtr GetImage;
44 GetSpansProcPtr GetSpans;
45 SourceValidateProcPtr SourceValidate;
46 CreateGCProcPtr CreateGC;
47 ScreenBlockHandlerProcPtr BlockHandler;
48 InstallColormapProcPtr InstallColormap;
49 StoreColorsProcPtr StoreColors;
50 PaintWindowBackgroundProcPtr PaintWindowBackground;
51 PaintWindowBorderProcPtr PaintWindowBorder;
52 CopyWindowProcPtr CopyWindow;
53 ClearToBackgroundProcPtr ClearToBackground;
54 SaveDoomedAreasProcPtr SaveDoomedAreas;
55 RestoreAreasProcPtr RestoreAreas;
67 ColormapPtr pInstalledMap;
68 ColormapPtr pColormap;
70 miSpriteCursorFuncPtr funcs;
71 } miSpriteScreenRec, *miSpriteScreenPtr;
73 #define SOURCE_COLOR 0
79 } miSpriteGCRec, *miSpriteGCPtr;
82 * Overlap BoxPtr and Box elements
84 #define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
85 (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
86 ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
89 * Overlap BoxPtr, origins, and rectangle
91 #define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
92 BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
95 * Overlap BoxPtr, origins and RectPtr
97 #define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
98 ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
99 (int)((pRect)->width), (int)((pRect)->height))
101 * Overlap BoxPtr and horizontal span
103 #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
105 #define LINE_SORT(x1,y1,x2,y2) \
107 if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
108 if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
110 #define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
111 BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))