2 * Copyright © 2006 Sun Microsystems, Inc. All rights reserved.
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:
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
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.
23 * Copyright © 2003 Keith Packard
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.
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.
44 #ifdef HAVE_DIX_CONFIG_H
45 #include <dix-config.h>
52 #include "scrnintstr.h"
54 #include "regionstr.h"
56 #include "windowstr.h"
59 #include "colormapst.h"
60 #include "cursorstr.h"
61 #include "dixstruct.h"
64 #include "dixevents.h"
66 #include "picturestr.h"
67 #include "extnsionst.h"
71 #include "damageextint.h"
73 #include <X11/extensions/compositeproto.h>
77 * enable this for debugging
79 #define COMPOSITE_DEBUG
82 typedef struct _CompClientWindow {
83 struct _CompClientWindow *next;
86 } CompClientWindowRec, *CompClientWindowPtr;
88 typedef struct _CompWindow {
90 DamagePtr damage; /* for automatic update mode */
91 Bool damageRegistered;
94 CompClientWindowPtr clients;
98 int borderClipX, borderClipY;
99 } CompWindowRec, *CompWindowPtr;
101 #define COMP_ORIGIN_INVALID 0x80000000
103 typedef struct _CompSubwindows {
105 CompClientWindowPtr clients;
106 } CompSubwindowsRec, *CompSubwindowsPtr;
108 #ifndef COMP_INCLUDE_RGB24_VISUAL
109 #define COMP_INCLUDE_RGB24_VISUAL 0
112 typedef struct _CompOverlayClientRec *CompOverlayClientPtr;
114 typedef struct _CompOverlayClientRec {
115 CompOverlayClientPtr pNext;
119 } CompOverlayClientRec;
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;
130 * Called from ConfigureWindow, these
131 * three track changes to the offscreen storage
134 ConfigNotifyProcPtr ConfigNotify;
135 MoveWindowProcPtr MoveWindow;
136 ResizeWindowProcPtr ResizeWindow;
137 ChangeBorderWidthProcPtr ChangeBorderWidth;
139 * Reparenting has an effect on Subwindows redirect
141 ReparentWindowProcPtr ReparentWindow;
144 * Colormaps for new visuals better not get installed
146 InstallColormapProcPtr InstallColormap;
149 * Fake backing store via automatic redirection
151 ChangeWindowAttributesProcPtr ChangeWindowAttributes;
153 ScreenBlockHandlerProcPtr BlockHandler;
154 CloseScreenProcPtr CloseScreen;
156 int numAlternateVisuals;
157 VisualID *alternateVisuals;
159 WindowPtr pOverlayWin;
161 CompOverlayClientPtr pOverlayClients;
163 } CompScreenRec, *CompScreenPtr;
165 extern DevPrivateKeyRec CompScreenPrivateKeyRec;
166 #define CompScreenPrivateKey (&CompScreenPrivateKeyRec)
168 extern DevPrivateKeyRec CompWindowPrivateKeyRec;
169 #define CompWindowPrivateKey (&CompWindowPrivateKeyRec)
171 extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
172 #define CompSubwindowsPrivateKey (&CompSubwindowsPrivateKeyRec)
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))
181 extern RESTYPE CompositeClientWindowType;
182 extern RESTYPE CompositeClientSubwindowsType;
183 extern RESTYPE CompositeClientOverlayType;
190 compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
193 compFreeClientWindow (WindowPtr pWin, XID id);
196 compUnredirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
199 compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
202 compFreeClientSubwindows (WindowPtr pWin, XID id);
205 compUnredirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update);
208 compRedirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
211 compUnredirectOneSubwindow (WindowPtr pParent, WindowPtr pWin);
214 compAllocPixmap (WindowPtr pWin);
217 compFreePixmap (WindowPtr pWin);
220 compReallocPixmap (WindowPtr pWin, int x, int y,
221 unsigned int w, unsigned int h, int bw);
228 CompositeExtensionInit (void);
235 compScreenInit (ScreenPtr pScreen);
242 compFreeOverlayClient (CompOverlayClientPtr pOcToDel);
245 compFindOverlayClient (ScreenPtr pScreen, ClientPtr pClient);
248 compCreateOverlayClient (ScreenPtr pScreen, ClientPtr pClient);
251 compCreateOverlayWindow (ScreenPtr pScreen);
254 compDestroyOverlayWindow (ScreenPtr pScreen);
260 #ifdef COMPOSITE_DEBUG
262 compCheckTree (ScreenPtr pScreen);
264 #define compCheckTree(s)
268 compWindowFormat (WindowPtr pWin);
271 compSetPixmap (WindowPtr pWin, PixmapPtr pPixmap);
274 compCheckRedirect (WindowPtr pWin);
277 compPositionWindow (WindowPtr pWin, int x, int y);
280 compRealizeWindow (WindowPtr pWin);
283 compUnrealizeWindow (WindowPtr pWin);
286 compClipNotify (WindowPtr pWin, int dx, int dy);
289 compMoveWindow (WindowPtr pWin, int x, int y, WindowPtr pSib, VTKind kind);
292 compResizeWindow (WindowPtr pWin, int x, int y,
293 unsigned int w, unsigned int h, WindowPtr pSib);
296 compChangeBorderWidth (WindowPtr pWin, unsigned int border_width);
299 compReparentWindow (WindowPtr pWin, WindowPtr pPriorParent);
302 compCreateWindow (WindowPtr pWin);
305 compDestroyWindow (WindowPtr pWin);
308 compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion);
311 compGetRedirectBorderClip (WindowPtr pWin);
314 compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
317 compWindowUpdate (WindowPtr pWin);
320 CompositeRealChildHead (WindowPtr pWin);
323 DeleteWindowNoInputDevices(pointer value, XID wid);
326 compConfigNotify(WindowPtr pWin, int x, int y, int w, int h,
327 int bw, WindowPtr pSib);
329 #endif /* _COMPINT_H_ */