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