2 * Copyright (c) 2006, Oracle and/or its affiliates. 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>
74 #include "compositeext.h"
78 * enable this for debugging
80 #define COMPOSITE_DEBUG
83 typedef struct _CompClientWindow
{
84 struct _CompClientWindow
*next
;
87 } CompClientWindowRec
, *CompClientWindowPtr
;
89 typedef struct _CompWindow
{
91 DamagePtr damage
; /* for automatic update mode */
92 Bool damageRegistered
;
95 CompClientWindowPtr clients
;
99 int borderClipX
, borderClipY
;
100 } CompWindowRec
, *CompWindowPtr
;
102 #define COMP_ORIGIN_INVALID 0x80000000
104 typedef struct _CompSubwindows
{
106 CompClientWindowPtr clients
;
107 } CompSubwindowsRec
, *CompSubwindowsPtr
;
109 #ifndef COMP_INCLUDE_RGB24_VISUAL
110 #define COMP_INCLUDE_RGB24_VISUAL 0
113 typedef struct _CompOverlayClientRec
*CompOverlayClientPtr
;
115 typedef struct _CompOverlayClientRec
{
116 CompOverlayClientPtr pNext
;
120 } CompOverlayClientRec
;
122 typedef struct _CompScreen
{
123 PositionWindowProcPtr PositionWindow
;
124 CopyWindowProcPtr CopyWindow
;
125 CreateWindowProcPtr CreateWindow
;
126 DestroyWindowProcPtr DestroyWindow
;
127 RealizeWindowProcPtr RealizeWindow
;
128 UnrealizeWindowProcPtr UnrealizeWindow
;
129 ClipNotifyProcPtr ClipNotify
;
131 * Called from ConfigureWindow, these
132 * three track changes to the offscreen storage
135 ConfigNotifyProcPtr ConfigNotify
;
136 MoveWindowProcPtr MoveWindow
;
137 ResizeWindowProcPtr ResizeWindow
;
138 ChangeBorderWidthProcPtr ChangeBorderWidth
;
140 * Reparenting has an effect on Subwindows redirect
142 ReparentWindowProcPtr ReparentWindow
;
145 * Colormaps for new visuals better not get installed
147 InstallColormapProcPtr InstallColormap
;
150 * Fake backing store via automatic redirection
152 ChangeWindowAttributesProcPtr ChangeWindowAttributes
;
154 ScreenBlockHandlerProcPtr BlockHandler
;
155 CloseScreenProcPtr CloseScreen
;
156 int numAlternateVisuals
;
157 VisualID
*alternateVisuals
;
159 WindowPtr pOverlayWin
;
161 CompOverlayClientPtr pOverlayClients
;
163 GetImageProcPtr GetImage
;
164 SourceValidateProcPtr SourceValidate
;
165 } CompScreenRec
, *CompScreenPtr
;
167 extern DevPrivateKeyRec CompScreenPrivateKeyRec
;
169 #define CompScreenPrivateKey (&CompScreenPrivateKeyRec)
171 extern DevPrivateKeyRec CompWindowPrivateKeyRec
;
173 #define CompWindowPrivateKey (&CompWindowPrivateKeyRec)
175 extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec
;
177 #define CompSubwindowsPrivateKey (&CompSubwindowsPrivateKeyRec)
179 #define GetCompScreen(s) ((CompScreenPtr) \
180 dixLookupPrivate(&(s)->devPrivates, CompScreenPrivateKey))
181 #define GetCompWindow(w) ((CompWindowPtr) \
182 dixLookupPrivate(&(w)->devPrivates, CompWindowPrivateKey))
183 #define GetCompSubwindows(w) ((CompSubwindowsPtr) \
184 dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey))
186 extern RESTYPE CompositeClientSubwindowsType
;
187 extern RESTYPE CompositeClientOverlayType
;
194 compRedirectWindow(ClientPtr pClient
, WindowPtr pWin
, int update
);
197 compFreeClientWindow(WindowPtr pWin
, XID id
);
200 compUnredirectWindow(ClientPtr pClient
, WindowPtr pWin
, int update
);
203 compRedirectSubwindows(ClientPtr pClient
, WindowPtr pWin
, int update
);
206 compFreeClientSubwindows(WindowPtr pWin
, XID id
);
209 compUnredirectSubwindows(ClientPtr pClient
, WindowPtr pWin
, int update
);
212 compRedirectOneSubwindow(WindowPtr pParent
, WindowPtr pWin
);
215 compUnredirectOneSubwindow(WindowPtr pParent
, WindowPtr pWin
);
218 compAllocPixmap(WindowPtr pWin
);
221 compSetParentPixmap(WindowPtr pWin
);
224 compRestoreWindow(WindowPtr pWin
, PixmapPtr pPixmap
);
228 compReallocPixmap(WindowPtr pWin
, int x
, int y
,
229 unsigned int w
, unsigned int h
, int bw
);
236 compScreenInit(ScreenPtr pScreen
);
243 compFreeOverlayClient(CompOverlayClientPtr pOcToDel
);
246 compFindOverlayClient(ScreenPtr pScreen
, ClientPtr pClient
);
249 compCreateOverlayClient(ScreenPtr pScreen
, ClientPtr pClient
);
252 compCreateOverlayWindow(ScreenPtr pScreen
);
255 compDestroyOverlayWindow(ScreenPtr pScreen
);
261 #ifdef COMPOSITE_DEBUG
263 compCheckTree(ScreenPtr pScreen
);
265 #define compCheckTree(s)
269 compSetPixmap(WindowPtr pWin
, PixmapPtr pPixmap
);
272 compCheckRedirect(WindowPtr pWin
);
275 compPositionWindow(WindowPtr pWin
, int x
, int y
);
278 compRealizeWindow(WindowPtr pWin
);
281 compUnrealizeWindow(WindowPtr pWin
);
284 compClipNotify(WindowPtr pWin
, int dx
, int dy
);
287 compMoveWindow(WindowPtr pWin
, int x
, int y
, WindowPtr pSib
, VTKind kind
);
291 compResizeWindow(WindowPtr pWin
, int x
, int y
,
292 unsigned int w
, unsigned int h
, WindowPtr pSib
);
295 compChangeBorderWidth(WindowPtr pWin
, unsigned int border_width
);
298 compReparentWindow(WindowPtr pWin
, WindowPtr pPriorParent
);
301 compCreateWindow(WindowPtr pWin
);
304 compDestroyWindow(WindowPtr pWin
);
307 compSetRedirectBorderClip(WindowPtr pWin
, RegionPtr pRegion
);
310 compGetRedirectBorderClip(WindowPtr pWin
);
313 compCopyWindow(WindowPtr pWin
, DDXPointRec ptOldOrg
, RegionPtr prgnSrc
);
316 compPaintChildrenToWindow(WindowPtr pWin
);
319 CompositeRealChildHead(WindowPtr pWin
);
322 DeleteWindowNoInputDevices(pointer value
, XID wid
);
326 compConfigNotify(WindowPtr pWin
, int x
, int y
, int w
, int h
,
327 int bw
, WindowPtr pSib
);
329 void PanoramiXCompositeInit(void);
330 void PanoramiXCompositeReset(void);
332 #endif /* _COMPINT_H_ */