1 | /*
|
---|
2 | * Copyright © 2006 Sun Microsystems
|
---|
3 | *
|
---|
4 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
5 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
6 | * the above copyright notice appear in all copies and that both that
|
---|
7 | * copyright notice and this permission notice appear in supporting
|
---|
8 | * documentation, and that the name of Sun Microsystems not be used in
|
---|
9 | * advertising or publicity pertaining to distribution of the software without
|
---|
10 | * specific, written prior permission. Sun Microsystems makes no
|
---|
11 | * representations about the suitability of this software for any purpose. It
|
---|
12 | * is provided "as is" without express or implied warranty.
|
---|
13 | *
|
---|
14 | * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
15 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
16 | * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
17 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
18 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
19 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
20 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
21 | *
|
---|
22 | * Copyright © 2003 Keith Packard
|
---|
23 | *
|
---|
24 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
25 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
26 | * the above copyright notice appear in all copies and that both that
|
---|
27 | * copyright notice and this permission notice appear in supporting
|
---|
28 | * documentation, and that the name of Keith Packard not be used in
|
---|
29 | * advertising or publicity pertaining to distribution of the software without
|
---|
30 | * specific, written prior permission. Keith Packard makes no
|
---|
31 | * representations about the suitability of this software for any purpose. It
|
---|
32 | * is provided "as is" without express or implied warranty.
|
---|
33 | *
|
---|
34 | * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
35 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
36 | * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
37 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
38 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
39 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
40 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
41 | */
|
---|
42 |
|
---|
43 | #ifdef HAVE_DIX_CONFIG_H
|
---|
44 | #include <dix-config.h>
|
---|
45 | #endif
|
---|
46 |
|
---|
47 | #ifndef _COMPINT_H_
|
---|
48 | #define _COMPINT_H_
|
---|
49 |
|
---|
50 | #include "misc.h"
|
---|
51 | #include "scrnintstr.h"
|
---|
52 | #include "os.h"
|
---|
53 | #include "regionstr.h"
|
---|
54 | #include "validate.h"
|
---|
55 | #include "windowstr.h"
|
---|
56 | #include "input.h"
|
---|
57 | #include "resource.h"
|
---|
58 | #include "colormapst.h"
|
---|
59 | #include "cursorstr.h"
|
---|
60 | #include "dixstruct.h"
|
---|
61 | #include "gcstruct.h"
|
---|
62 | #include "servermd.h"
|
---|
63 | #include "dixevents.h"
|
---|
64 | #include "globals.h"
|
---|
65 | #include "picturestr.h"
|
---|
66 | #include "extnsionst.h"
|
---|
67 | #include "privates.h"
|
---|
68 | #include "mi.h"
|
---|
69 | #include "damage.h"
|
---|
70 | #include "damageextint.h"
|
---|
71 | #include "xfixes.h"
|
---|
72 | #include <X11/extensions/compositeproto.h>
|
---|
73 | #include <assert.h>
|
---|
74 |
|
---|
75 | /*
|
---|
76 | * enable this for debugging
|
---|
77 |
|
---|
78 | #define COMPOSITE_DEBUG
|
---|
79 | */
|
---|
80 |
|
---|
81 | typedef struct _CompClientWindow {
|
---|
82 | struct _CompClientWindow *next;
|
---|
83 | XID id;
|
---|
84 | int update;
|
---|
85 | } CompClientWindowRec, *CompClientWindowPtr;
|
---|
86 |
|
---|
87 | typedef struct _CompWindow {
|
---|
88 | RegionRec borderClip;
|
---|
89 | DamagePtr damage; /* for automatic update mode */
|
---|
90 | Bool damageRegistered;
|
---|
91 | Bool damaged;
|
---|
92 | int update;
|
---|
93 | CompClientWindowPtr clients;
|
---|
94 | int oldx;
|
---|
95 | int oldy;
|
---|
96 | PixmapPtr pOldPixmap;
|
---|
97 | int borderClipX, borderClipY;
|
---|
98 | } CompWindowRec, *CompWindowPtr;
|
---|
99 |
|
---|
100 | #define COMP_ORIGIN_INVALID 0x80000000
|
---|
101 |
|
---|
102 | typedef struct _CompSubwindows {
|
---|
103 | int update;
|
---|
104 | CompClientWindowPtr clients;
|
---|
105 | } CompSubwindowsRec, *CompSubwindowsPtr;
|
---|
106 |
|
---|
107 | #ifndef COMP_INCLUDE_RGB24_VISUAL
|
---|
108 | #define COMP_INCLUDE_RGB24_VISUAL 0
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | typedef struct _CompOverlayClientRec *CompOverlayClientPtr;
|
---|
112 |
|
---|
113 | typedef struct _CompOverlayClientRec {
|
---|
114 | CompOverlayClientPtr pNext;
|
---|
115 | ClientPtr pClient;
|
---|
116 | ScreenPtr pScreen;
|
---|
117 | XID resource;
|
---|
118 | } CompOverlayClientRec;
|
---|
119 |
|
---|
120 | typedef struct _CompScreen {
|
---|
121 | PositionWindowProcPtr PositionWindow;
|
---|
122 | CopyWindowProcPtr CopyWindow;
|
---|
123 | CreateWindowProcPtr CreateWindow;
|
---|
124 | DestroyWindowProcPtr DestroyWindow;
|
---|
125 | RealizeWindowProcPtr RealizeWindow;
|
---|
126 | UnrealizeWindowProcPtr UnrealizeWindow;
|
---|
127 | ClipNotifyProcPtr ClipNotify;
|
---|
128 | /*
|
---|
129 | * Called from ConfigureWindow, these
|
---|
130 | * three track changes to the offscreen storage
|
---|
131 | * geometry
|
---|
132 | */
|
---|
133 | MoveWindowProcPtr MoveWindow;
|
---|
134 | ResizeWindowProcPtr ResizeWindow;
|
---|
135 | ChangeBorderWidthProcPtr ChangeBorderWidth;
|
---|
136 | /*
|
---|
137 | * Reparenting has an effect on Subwindows redirect
|
---|
138 | */
|
---|
139 | ReparentWindowProcPtr ReparentWindow;
|
---|
140 |
|
---|
141 | /*
|
---|
142 | * Colormaps for new visuals better not get installed
|
---|
143 | */
|
---|
144 | InstallColormapProcPtr InstallColormap;
|
---|
145 |
|
---|
146 | /*
|
---|
147 | * Fake backing store via automatic redirection
|
---|
148 | */
|
---|
149 | ChangeWindowAttributesProcPtr ChangeWindowAttributes;
|
---|
150 |
|
---|
151 | ScreenBlockHandlerProcPtr BlockHandler;
|
---|
152 | CloseScreenProcPtr CloseScreen;
|
---|
153 | Bool damaged;
|
---|
154 | int numAlternateVisuals;
|
---|
155 | VisualID *alternateVisuals;
|
---|
156 |
|
---|
157 | WindowPtr pOverlayWin;
|
---|
158 | Window overlayWid;
|
---|
159 | CompOverlayClientPtr pOverlayClients;
|
---|
160 |
|
---|
161 | } CompScreenRec, *CompScreenPtr;
|
---|
162 |
|
---|
163 | extern DevPrivateKey CompScreenPrivateKey;
|
---|
164 | extern DevPrivateKey CompWindowPrivateKey;
|
---|
165 | extern DevPrivateKey CompSubwindowsPrivateKey;
|
---|
166 |
|
---|
167 | #define GetCompScreen(s) ((CompScreenPtr) \
|
---|
168 | dixLookupPrivate(&(s)->devPrivates, CompScreenPrivateKey))
|
---|
169 | #define GetCompWindow(w) ((CompWindowPtr) \
|
---|
170 | dixLookupPrivate(&(w)->devPrivates, CompWindowPrivateKey))
|
---|
171 | #define GetCompSubwindows(w) ((CompSubwindowsPtr) \
|
---|
172 | dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey))
|
---|
173 |
|
---|
174 | extern RESTYPE CompositeClientWindowType;
|
---|
175 | extern RESTYPE CompositeClientSubwindowsType;
|
---|
176 | extern RESTYPE CompositeClientOverlayType;
|
---|
177 |
|
---|
178 | /*
|
---|
179 | * compalloc.c
|
---|
180 | */
|
---|
181 |
|
---|
182 | Bool
|
---|
183 | compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
184 |
|
---|
185 | void
|
---|
186 | compFreeClientWindow (WindowPtr pWin, XID id);
|
---|
187 |
|
---|
188 | int
|
---|
189 | compUnredirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
190 |
|
---|
191 | int
|
---|
192 | compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
193 |
|
---|
194 | void
|
---|
195 | compFreeClientSubwindows (WindowPtr pWin, XID id);
|
---|
196 |
|
---|
197 | int
|
---|
198 | compUnredirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
|
---|
199 |
|
---|
200 | int
|
---|
201 | compRedirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
|
---|
202 |
|
---|
203 | int
|
---|
204 | compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
|
---|
205 |
|
---|
206 | Bool
|
---|
207 | compAllocPixmap (WindowPtr pWin);
|
---|
208 |
|
---|
209 | void
|
---|
210 | compFreePixmap (WindowPtr pWin);
|
---|
211 |
|
---|
212 | Bool
|
---|
213 | compReallocPixmap (WindowPtr pWin, int x, int y,
|
---|
214 | unsigned int w, unsigned int h, int bw);
|
---|
215 |
|
---|
216 | /*
|
---|
217 | * compext.c
|
---|
218 | */
|
---|
219 |
|
---|
220 | void
|
---|
221 | CompositeExtensionInit (void);
|
---|
222 |
|
---|
223 | /*
|
---|
224 | * compinit.c
|
---|
225 | */
|
---|
226 |
|
---|
227 | Bool
|
---|
228 | CompositeRegisterAlternateVisuals (ScreenPtr pScreen,
|
---|
229 | VisualID *vids, int nVisuals);
|
---|
230 |
|
---|
231 | Bool
|
---|
232 | compScreenInit (ScreenPtr pScreen);
|
---|
233 |
|
---|
234 | /*
|
---|
235 | * compoverlay.c
|
---|
236 | */
|
---|
237 |
|
---|
238 | void
|
---|
239 | compFreeOverlayClient (CompOverlayClientPtr pOcToDel);
|
---|
240 |
|
---|
241 | CompOverlayClientPtr
|
---|
242 | compFindOverlayClient (ScreenPtr pScreen, ClientPtr pClient);
|
---|
243 |
|
---|
244 | CompOverlayClientPtr
|
---|
245 | compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient);
|
---|
246 |
|
---|
247 | Bool
|
---|
248 | compCreateOverlayWindow (ScreenPtr pScreen);
|
---|
249 |
|
---|
250 | void
|
---|
251 | compDestroyOverlayWindow (ScreenPtr pScreen);
|
---|
252 |
|
---|
253 | /*
|
---|
254 | * compwindow.c
|
---|
255 | */
|
---|
256 |
|
---|
257 | #ifdef COMPOSITE_DEBUG
|
---|
258 | void
|
---|
259 | compCheckTree (ScreenPtr pScreen);
|
---|
260 | #else
|
---|
261 | #define compCheckTree(s)
|
---|
262 | #endif
|
---|
263 |
|
---|
264 | PictFormatPtr
|
---|
265 | compWindowFormat (WindowPtr pWin);
|
---|
266 |
|
---|
267 | void
|
---|
268 | compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
|
---|
269 |
|
---|
270 | Bool
|
---|
271 | compCheckRedirect (WindowPtr pWin);
|
---|
272 |
|
---|
273 | Bool
|
---|
274 | compPositionWindow (WindowPtr pWin, int x, int y);
|
---|
275 |
|
---|
276 | Bool
|
---|
277 | compRealizeWindow (WindowPtr pWin);
|
---|
278 |
|
---|
279 | Bool
|
---|
280 | compUnrealizeWindow (WindowPtr pWin);
|
---|
281 |
|
---|
282 | void
|
---|
283 | compClipNotify (WindowPtr pWin, int dx, int dy);
|
---|
284 |
|
---|
285 | void
|
---|
286 | compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind);
|
---|
287 |
|
---|
288 | void
|
---|
289 | compResizeWindow (WindowPtr pWin, int x, int y,
|
---|
290 | unsigned int w, unsigned int h, WindowPtr pSib);
|
---|
291 |
|
---|
292 | void
|
---|
293 | compChangeBorderWidth (WindowPtr pWin, unsigned int border_width);
|
---|
294 |
|
---|
295 | void
|
---|
296 | compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent);
|
---|
297 |
|
---|
298 | Bool
|
---|
299 | compCreateWindow (WindowPtr pWin);
|
---|
300 |
|
---|
301 | Bool
|
---|
302 | compDestroyWindow (WindowPtr pWin);
|
---|
303 |
|
---|
304 | void
|
---|
305 | compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion);
|
---|
306 |
|
---|
307 | RegionPtr
|
---|
308 | compGetRedirectBorderClip (WindowPtr pWin);
|
---|
309 |
|
---|
310 | void
|
---|
311 | compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
---|
312 |
|
---|
313 | void
|
---|
314 | compWindowUpdate (WindowPtr pWin);
|
---|
315 |
|
---|
316 | WindowPtr
|
---|
317 | CompositeRealChildHead (WindowPtr pWin);
|
---|
318 |
|
---|
319 | int
|
---|
320 | DeleteWindowNoInputDevices(pointer value, XID wid);
|
---|
321 |
|
---|
322 | #endif /* _COMPINT_H_ */
|
---|