1 | /*
|
---|
2 | *
|
---|
3 | * Copyright © 2000 Keith Packard
|
---|
4 | *
|
---|
5 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
6 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
7 | * the above copyright notice appear in all copies and that both that
|
---|
8 | * copyright notice and this permission notice appear in supporting
|
---|
9 | * documentation, and that the name of Keith Packard not be used in
|
---|
10 | * advertising or publicity pertaining to distribution of the software without
|
---|
11 | * specific, written prior permission. Keith Packard makes no
|
---|
12 | * representations about the suitability of this software for any purpose. It
|
---|
13 | * is provided "as is" without express or implied warranty.
|
---|
14 | *
|
---|
15 | * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
17 | * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
19 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
20 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
21 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
22 | */
|
---|
23 |
|
---|
24 | #ifndef _SHADOW_H_
|
---|
25 | #define _SHADOW_H_
|
---|
26 |
|
---|
27 | #include "scrnintstr.h"
|
---|
28 |
|
---|
29 | #ifdef RENDER
|
---|
30 | #include "picturestr.h"
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include "damage.h"
|
---|
34 | #include "damagestr.h"
|
---|
35 | typedef struct _shadowBuf *shadowBufPtr;
|
---|
36 |
|
---|
37 | typedef void (*ShadowUpdateProc) (ScreenPtr pScreen,
|
---|
38 | shadowBufPtr pBuf);
|
---|
39 |
|
---|
40 | #define SHADOW_WINDOW_RELOCATE 1
|
---|
41 | #define SHADOW_WINDOW_READ 2
|
---|
42 | #define SHADOW_WINDOW_WRITE 4
|
---|
43 |
|
---|
44 | typedef void *(*ShadowWindowProc) (ScreenPtr pScreen,
|
---|
45 | CARD32 row,
|
---|
46 | CARD32 offset,
|
---|
47 | int mode,
|
---|
48 | CARD32 *size,
|
---|
49 | void *closure);
|
---|
50 |
|
---|
51 | /* BC hack: do not move the damage member. see shadow.c for explanation. */
|
---|
52 | typedef struct _shadowBuf {
|
---|
53 | DamagePtr pDamage;
|
---|
54 | ShadowUpdateProc update;
|
---|
55 | ShadowWindowProc window;
|
---|
56 | RegionRec damage;
|
---|
57 | PixmapPtr pPixmap;
|
---|
58 | void *closure;
|
---|
59 | int randr;
|
---|
60 |
|
---|
61 | /* screen wrappers */
|
---|
62 | GetImageProcPtr GetImage;
|
---|
63 | CloseScreenProcPtr CloseScreen;
|
---|
64 | } shadowBufRec;
|
---|
65 |
|
---|
66 | /* Match defines from randr extension */
|
---|
67 | #define SHADOW_ROTATE_0 1
|
---|
68 | #define SHADOW_ROTATE_90 2
|
---|
69 | #define SHADOW_ROTATE_180 4
|
---|
70 | #define SHADOW_ROTATE_270 8
|
---|
71 | #define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\
|
---|
72 | SHADOW_ROTATE_180|SHADOW_ROTATE_270)
|
---|
73 | #define SHADOW_REFLECT_X 16
|
---|
74 | #define SHADOW_REFLECT_Y 32
|
---|
75 | #define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
|
---|
76 |
|
---|
77 | extern int shadowScrPrivateIndex;
|
---|
78 |
|
---|
79 | #define shadowGetBuf(pScr) ((shadowBufPtr) (pScr)->devPrivates[shadowScrPrivateIndex].ptr)
|
---|
80 | #define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr)
|
---|
81 | #define shadowDamage(pBuf) DamageRegion(pBuf->pDamage)
|
---|
82 |
|
---|
83 | Bool
|
---|
84 | shadowSetup (ScreenPtr pScreen);
|
---|
85 |
|
---|
86 | Bool
|
---|
87 | shadowAdd (ScreenPtr pScreen,
|
---|
88 | PixmapPtr pPixmap,
|
---|
89 | ShadowUpdateProc update,
|
---|
90 | ShadowWindowProc window,
|
---|
91 | int randr,
|
---|
92 | void *closure);
|
---|
93 |
|
---|
94 | void
|
---|
95 | shadowRemove (ScreenPtr pScreen, PixmapPtr pPixmap);
|
---|
96 |
|
---|
97 | shadowBufPtr
|
---|
98 | shadowFindBuf (WindowPtr pWindow);
|
---|
99 |
|
---|
100 | Bool
|
---|
101 | shadowInit (ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window);
|
---|
102 |
|
---|
103 | void *
|
---|
104 | shadowAlloc (int width, int height, int bpp);
|
---|
105 |
|
---|
106 | void
|
---|
107 | shadowUpdatePacked (ScreenPtr pScreen,
|
---|
108 | shadowBufPtr pBuf);
|
---|
109 |
|
---|
110 | void
|
---|
111 | shadowUpdatePlanar4 (ScreenPtr pScreen,
|
---|
112 | shadowBufPtr pBuf);
|
---|
113 |
|
---|
114 | void
|
---|
115 | shadowUpdatePlanar4x8 (ScreenPtr pScreen,
|
---|
116 | shadowBufPtr pBuf);
|
---|
117 |
|
---|
118 | void
|
---|
119 | shadowUpdateRotatePacked (ScreenPtr pScreen,
|
---|
120 | shadowBufPtr pBuf);
|
---|
121 |
|
---|
122 | void
|
---|
123 | shadowUpdateRotate8_90 (ScreenPtr pScreen,
|
---|
124 | shadowBufPtr pBuf);
|
---|
125 |
|
---|
126 | void
|
---|
127 | shadowUpdateRotate16_90 (ScreenPtr pScreen,
|
---|
128 | shadowBufPtr pBuf);
|
---|
129 |
|
---|
130 | void
|
---|
131 | shadowUpdateRotate16_90YX (ScreenPtr pScreen,
|
---|
132 | shadowBufPtr pBuf);
|
---|
133 |
|
---|
134 | void
|
---|
135 | shadowUpdateRotate32_90 (ScreenPtr pScreen,
|
---|
136 | shadowBufPtr pBuf);
|
---|
137 |
|
---|
138 | void
|
---|
139 | shadowUpdateRotate8_180 (ScreenPtr pScreen,
|
---|
140 | shadowBufPtr pBuf);
|
---|
141 |
|
---|
142 | void
|
---|
143 | shadowUpdateRotate16_180 (ScreenPtr pScreen,
|
---|
144 | shadowBufPtr pBuf);
|
---|
145 |
|
---|
146 | void
|
---|
147 | shadowUpdateRotate32_180 (ScreenPtr pScreen,
|
---|
148 | shadowBufPtr pBuf);
|
---|
149 |
|
---|
150 | void
|
---|
151 | shadowUpdateRotate8_270 (ScreenPtr pScreen,
|
---|
152 | shadowBufPtr pBuf);
|
---|
153 |
|
---|
154 | void
|
---|
155 | shadowUpdateRotate16_270 (ScreenPtr pScreen,
|
---|
156 | shadowBufPtr pBuf);
|
---|
157 |
|
---|
158 | void
|
---|
159 | shadowUpdateRotate16_270YX (ScreenPtr pScreen,
|
---|
160 | shadowBufPtr pBuf);
|
---|
161 |
|
---|
162 | void
|
---|
163 | shadowUpdateRotate32_270 (ScreenPtr pScreen,
|
---|
164 | shadowBufPtr pBuf);
|
---|
165 |
|
---|
166 | void
|
---|
167 | shadowUpdateRotate8 (ScreenPtr pScreen,
|
---|
168 | shadowBufPtr pBuf);
|
---|
169 |
|
---|
170 | void
|
---|
171 | shadowUpdateRotate16 (ScreenPtr pScreen,
|
---|
172 | shadowBufPtr pBuf);
|
---|
173 |
|
---|
174 | void
|
---|
175 | shadowUpdateRotate32 (ScreenPtr pScreen,
|
---|
176 | shadowBufPtr pBuf);
|
---|
177 |
|
---|
178 | typedef void (* shadowUpdateProc)(ScreenPtr, shadowBufPtr);
|
---|
179 |
|
---|
180 | shadowUpdateProc shadowUpdatePackedWeak(void);
|
---|
181 | shadowUpdateProc shadowUpdatePlanar4Weak(void);
|
---|
182 | shadowUpdateProc shadowUpdatePlanar4x8Weak(void);
|
---|
183 | shadowUpdateProc shadowUpdateRotatePackedWeak(void);
|
---|
184 |
|
---|
185 | #endif /* _SHADOW_H_ */
|
---|