1 | /*
|
---|
2 | * mispritest.h
|
---|
3 | *
|
---|
4 | * mi sprite structures
|
---|
5 | */
|
---|
6 |
|
---|
7 | /* $Xorg: mispritest.h,v 1.4 2001/02/09 02:05:22 xorgcvs Exp $ */
|
---|
8 |
|
---|
9 | /*
|
---|
10 |
|
---|
11 | Copyright 1989, 1998 The Open Group
|
---|
12 |
|
---|
13 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
14 | documentation for any purpose is hereby granted without fee, provided that
|
---|
15 | the above copyright notice appear in all copies and that both that
|
---|
16 | copyright notice and this permission notice appear in supporting
|
---|
17 | documentation.
|
---|
18 |
|
---|
19 | The above copyright notice and this permission notice shall be included in
|
---|
20 | all copies or substantial portions of the Software.
|
---|
21 |
|
---|
22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
25 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
26 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
27 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
28 |
|
---|
29 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
30 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
31 | in this Software without prior written authorization from The Open Group.
|
---|
32 | */
|
---|
33 | /* $XFree86: xc/programs/Xserver/mi/mispritest.h,v 1.4 2001/01/17 22:37:07 dawes Exp $ */
|
---|
34 |
|
---|
35 | #ifdef HAVE_DIX_CONFIG_H
|
---|
36 | #include <dix-config.h>
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | #ifndef _MISPRITEST_H_
|
---|
40 | #define _MISPRITEST_H_
|
---|
41 |
|
---|
42 | # include "misprite.h"
|
---|
43 | #ifdef RENDER
|
---|
44 | # include "picturestr.h"
|
---|
45 | #endif
|
---|
46 | # include "damage.h"
|
---|
47 |
|
---|
48 | /*
|
---|
49 | * per screen information
|
---|
50 | */
|
---|
51 |
|
---|
52 | typedef struct {
|
---|
53 | /* screen procedures */
|
---|
54 | CloseScreenProcPtr CloseScreen;
|
---|
55 | GetImageProcPtr GetImage;
|
---|
56 | GetSpansProcPtr GetSpans;
|
---|
57 | SourceValidateProcPtr SourceValidate;
|
---|
58 |
|
---|
59 | /* window procedures */
|
---|
60 | CopyWindowProcPtr CopyWindow;
|
---|
61 |
|
---|
62 | /* backing store procedures */
|
---|
63 | SaveDoomedAreasProcPtr SaveDoomedAreas;
|
---|
64 |
|
---|
65 | /* colormap procedures */
|
---|
66 | InstallColormapProcPtr InstallColormap;
|
---|
67 | StoreColorsProcPtr StoreColors;
|
---|
68 |
|
---|
69 | /* os layer procedures */
|
---|
70 | ScreenBlockHandlerProcPtr BlockHandler;
|
---|
71 |
|
---|
72 | CursorPtr pCursor;
|
---|
73 | int x; /* cursor hotspot */
|
---|
74 | int y;
|
---|
75 | BoxRec saved; /* saved area from the screen */
|
---|
76 | Bool isUp; /* cursor in frame buffer */
|
---|
77 | Bool shouldBeUp; /* cursor should be displayed */
|
---|
78 | WindowPtr pCacheWin; /* window the cursor last seen in */
|
---|
79 | Bool isInCacheWin;
|
---|
80 | Bool checkPixels; /* check colormap collision */
|
---|
81 | xColorItem colors[2];
|
---|
82 | ColormapPtr pInstalledMap;
|
---|
83 | ColormapPtr pColormap;
|
---|
84 | VisualPtr pVisual;
|
---|
85 | miSpriteCursorFuncPtr funcs;
|
---|
86 | DamagePtr pDamage; /* damage tracking structure */
|
---|
87 | } miSpriteScreenRec, *miSpriteScreenPtr;
|
---|
88 |
|
---|
89 | #define SOURCE_COLOR 0
|
---|
90 | #define MASK_COLOR 1
|
---|
91 |
|
---|
92 | #define miSpriteIsUpTRUE(pScreen, pScreenPriv) if (!pScreenPriv->isUp) { \
|
---|
93 | pScreenPriv->isUp = TRUE; \
|
---|
94 | DamageRegister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
|
---|
95 | }
|
---|
96 |
|
---|
97 | #define miSpriteIsUpFALSE(pScreen, pScreenPriv) if (pScreenPriv->isUp) { \
|
---|
98 | DamageUnregister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
|
---|
99 | pScreenPriv->isUp = FALSE; \
|
---|
100 | }
|
---|
101 |
|
---|
102 | /*
|
---|
103 | * Overlap BoxPtr and Box elements
|
---|
104 | */
|
---|
105 | #define BOX_OVERLAP(pCbox,X1,Y1,X2,Y2) \
|
---|
106 | (((pCbox)->x1 <= (X2)) && ((X1) <= (pCbox)->x2) && \
|
---|
107 | ((pCbox)->y1 <= (Y2)) && ((Y1) <= (pCbox)->y2))
|
---|
108 |
|
---|
109 | /*
|
---|
110 | * Overlap BoxPtr, origins, and rectangle
|
---|
111 | */
|
---|
112 | #define ORG_OVERLAP(pCbox,xorg,yorg,x,y,w,h) \
|
---|
113 | BOX_OVERLAP((pCbox),(x)+(xorg),(y)+(yorg),(x)+(xorg)+(w),(y)+(yorg)+(h))
|
---|
114 |
|
---|
115 | /*
|
---|
116 | * Overlap BoxPtr, origins and RectPtr
|
---|
117 | */
|
---|
118 | #define ORGRECT_OVERLAP(pCbox,xorg,yorg,pRect) \
|
---|
119 | ORG_OVERLAP((pCbox),(xorg),(yorg),(pRect)->x,(pRect)->y, \
|
---|
120 | (int)((pRect)->width), (int)((pRect)->height))
|
---|
121 | /*
|
---|
122 | * Overlap BoxPtr and horizontal span
|
---|
123 | */
|
---|
124 | #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y))
|
---|
125 |
|
---|
126 | #define LINE_SORT(x1,y1,x2,y2) \
|
---|
127 | { int _t; \
|
---|
128 | if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \
|
---|
129 | if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } }
|
---|
130 |
|
---|
131 | #define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
|
---|
132 | BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
|
---|
133 |
|
---|
134 | #endif /* _MISPRITEST_H_ */
|
---|