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