]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/mi/mispritest.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / programs / Xserver / mi / mispritest.h
1 /*
2  * mispritest.h
3  *
4  * mi sprite structures
5  */
6
7 /* $XConsortium: mispritest.h,v 5.14 94/04/17 20:27:55 dpw Exp $ */
8
9 /*
10
11 Copyright (c) 1989  X Consortium
12
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:
19
20 The above copyright notice and this permission notice shall be included in
21 all copies or substantial portions of the Software.
22
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.
29
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.
33 */
34
35 # include   "misprite.h"
36
37 /*
38  * per screen information
39  */
40
41 typedef struct {
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;
56
57     CursorPtr       pCursor;
58     int             x;
59     int             y;
60     BoxRec          saved;
61     Bool            isUp;
62     Bool            shouldBeUp;
63     WindowPtr       pCacheWin;
64     Bool            isInCacheWin;
65     Bool            checkPixels;
66     xColorItem      colors[2];
67     ColormapPtr     pInstalledMap;
68     ColormapPtr     pColormap;
69     VisualPtr       pVisual;
70     miSpriteCursorFuncPtr    funcs;
71 } miSpriteScreenRec, *miSpriteScreenPtr;
72
73 #define SOURCE_COLOR    0
74 #define MASK_COLOR      1
75
76 typedef struct {
77     GCFuncs             *wrapFuncs;
78     GCOps               *wrapOps;
79 } miSpriteGCRec, *miSpriteGCPtr;
80
81 /*
82  * Overlap BoxPtr and Box elements
83  */
84 #define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
85         (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
86          ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
87
88 /*
89  * Overlap BoxPtr, origins, and rectangle
90  */
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))
93
94 /*
95  * Overlap BoxPtr, origins and RectPtr
96  */
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))
100 /*
101  * Overlap BoxPtr and horizontal span
102  */
103 #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
104
105 #define LINE_SORT(x1,y1,x2,y2) \
106 { int _t; \
107   if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
108   if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
109
110 #define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
111     BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))