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 | #include "picturestr.h"
|
---|
30 |
|
---|
31 | #include "damage.h"
|
---|
32 | #include "damagestr.h"
|
---|
33 | typedef struct _shadowBuf *shadowBufPtr;
|
---|
34 |
|
---|
35 | typedef void (*ShadowUpdateProc) (ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
36 |
|
---|
37 | #define SHADOW_WINDOW_RELOCATE 1
|
---|
38 | #define SHADOW_WINDOW_READ 2
|
---|
39 | #define SHADOW_WINDOW_WRITE 4
|
---|
40 |
|
---|
41 | typedef void *(*ShadowWindowProc) (ScreenPtr pScreen,
|
---|
42 | CARD32 row,
|
---|
43 | CARD32 offset,
|
---|
44 | int mode, CARD32 *size, void *closure);
|
---|
45 |
|
---|
46 | /* BC hack: do not move the damage member. see shadow.c for explanation. */
|
---|
47 | typedef struct _shadowBuf {
|
---|
48 | DamagePtr pDamage;
|
---|
49 | ShadowUpdateProc update;
|
---|
50 | ShadowWindowProc window;
|
---|
51 | RegionRec damage;
|
---|
52 | PixmapPtr pPixmap;
|
---|
53 | void *closure;
|
---|
54 | int randr;
|
---|
55 |
|
---|
56 | /* screen wrappers */
|
---|
57 | GetImageProcPtr GetImage;
|
---|
58 | CloseScreenProcPtr CloseScreen;
|
---|
59 | } shadowBufRec;
|
---|
60 |
|
---|
61 | /* Match defines from randr extension */
|
---|
62 | #define SHADOW_ROTATE_0 1
|
---|
63 | #define SHADOW_ROTATE_90 2
|
---|
64 | #define SHADOW_ROTATE_180 4
|
---|
65 | #define SHADOW_ROTATE_270 8
|
---|
66 | #define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\
|
---|
67 | SHADOW_ROTATE_180|SHADOW_ROTATE_270)
|
---|
68 | #define SHADOW_REFLECT_X 16
|
---|
69 | #define SHADOW_REFLECT_Y 32
|
---|
70 | #define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
|
---|
71 |
|
---|
72 | extern _X_EXPORT DevPrivateKey shadowScrPrivateKey;
|
---|
73 |
|
---|
74 | #define shadowGetBuf(pScr) ((shadowBufPtr) \
|
---|
75 | dixLookupPrivate(&(pScr)->devPrivates, shadowScrPrivateKey))
|
---|
76 | #define shadowBuf(pScr) shadowBufPtr pBuf = shadowGetBuf(pScr)
|
---|
77 | #define shadowDamage(pBuf) DamageRegion(pBuf->pDamage)
|
---|
78 |
|
---|
79 | extern _X_EXPORT Bool
|
---|
80 | shadowSetup(ScreenPtr pScreen);
|
---|
81 |
|
---|
82 | extern _X_EXPORT Bool
|
---|
83 |
|
---|
84 | shadowAdd(ScreenPtr pScreen,
|
---|
85 | PixmapPtr pPixmap,
|
---|
86 | ShadowUpdateProc update,
|
---|
87 | ShadowWindowProc window, int randr, void *closure);
|
---|
88 |
|
---|
89 | extern _X_EXPORT void
|
---|
90 | shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap);
|
---|
91 |
|
---|
92 | extern _X_EXPORT Bool
|
---|
93 |
|
---|
94 | shadowInit(ScreenPtr pScreen, ShadowUpdateProc update, ShadowWindowProc window);
|
---|
95 |
|
---|
96 | extern _X_EXPORT void *shadowAlloc(int width, int height, int bpp);
|
---|
97 |
|
---|
98 | extern _X_EXPORT void
|
---|
99 | shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
100 |
|
---|
101 | extern _X_EXPORT void
|
---|
102 | shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
103 |
|
---|
104 | extern _X_EXPORT void
|
---|
105 | shadowUpdatePlanar4x8(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
106 |
|
---|
107 | extern _X_EXPORT void
|
---|
108 | shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
109 |
|
---|
110 | extern _X_EXPORT void
|
---|
111 | shadowUpdateRotate8_90(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
112 |
|
---|
113 | extern _X_EXPORT void
|
---|
114 | shadowUpdateRotate16_90(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
115 |
|
---|
116 | extern _X_EXPORT void
|
---|
117 | shadowUpdateRotate16_90YX(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
118 |
|
---|
119 | extern _X_EXPORT void
|
---|
120 | shadowUpdateRotate32_90(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
121 |
|
---|
122 | extern _X_EXPORT void
|
---|
123 | shadowUpdateRotate8_180(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
124 |
|
---|
125 | extern _X_EXPORT void
|
---|
126 | shadowUpdateRotate16_180(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
127 |
|
---|
128 | extern _X_EXPORT void
|
---|
129 | shadowUpdateRotate32_180(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
130 |
|
---|
131 | extern _X_EXPORT void
|
---|
132 | shadowUpdateRotate8_270(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
133 |
|
---|
134 | extern _X_EXPORT void
|
---|
135 | shadowUpdateRotate16_270(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
136 |
|
---|
137 | extern _X_EXPORT void
|
---|
138 | shadowUpdateRotate16_270YX(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
139 |
|
---|
140 | extern _X_EXPORT void
|
---|
141 | shadowUpdateRotate32_270(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
142 |
|
---|
143 | extern _X_EXPORT void
|
---|
144 | shadowUpdateRotate8(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
145 |
|
---|
146 | extern _X_EXPORT void
|
---|
147 | shadowUpdateRotate16(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
148 |
|
---|
149 | extern _X_EXPORT void
|
---|
150 | shadowUpdateRotate32(ScreenPtr pScreen, shadowBufPtr pBuf);
|
---|
151 |
|
---|
152 | typedef void (*shadowUpdateProc) (ScreenPtr, shadowBufPtr);
|
---|
153 |
|
---|
154 | extern _X_EXPORT shadowUpdateProc shadowUpdatePackedWeak(void);
|
---|
155 | extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4Weak(void);
|
---|
156 | extern _X_EXPORT shadowUpdateProc shadowUpdatePlanar4x8Weak(void);
|
---|
157 | extern _X_EXPORT shadowUpdateProc shadowUpdateRotatePackedWeak(void);
|
---|
158 |
|
---|
159 | #endif /* _SHADOW_H_ */
|
---|