1 | /***********************************************************
|
---|
2 |
|
---|
3 | Copyright 1987, 1998 The Open Group
|
---|
4 |
|
---|
5 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
6 | documentation for any purpose is hereby granted without fee, provided that
|
---|
7 | the above copyright notice appear in all copies and that both that
|
---|
8 | copyright notice and this permission notice appear in supporting
|
---|
9 | documentation.
|
---|
10 |
|
---|
11 | The above copyright notice and this permission notice shall be included in
|
---|
12 | all copies or substantial portions of the Software.
|
---|
13 |
|
---|
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
17 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
20 |
|
---|
21 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
22 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
23 | in this Software without prior written authorization from The Open Group.
|
---|
24 |
|
---|
25 |
|
---|
26 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
---|
27 |
|
---|
28 | All Rights Reserved
|
---|
29 |
|
---|
30 | Permission to use, copy, modify, and distribute this software and its
|
---|
31 | documentation for any purpose and without fee is hereby granted,
|
---|
32 | provided that the above copyright notice appear in all copies and that
|
---|
33 | both that copyright notice and this permission notice appear in
|
---|
34 | supporting documentation, and that the name of Digital not be
|
---|
35 | used in advertising or publicity pertaining to distribution of the
|
---|
36 | software without specific, written prior permission.
|
---|
37 |
|
---|
38 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
---|
39 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
---|
40 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
---|
41 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
42 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
43 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
44 | SOFTWARE.
|
---|
45 |
|
---|
46 | ******************************************************************/
|
---|
47 |
|
---|
48 | #ifndef WINDOWSTRUCT_H
|
---|
49 | #define WINDOWSTRUCT_H
|
---|
50 |
|
---|
51 | #include "window.h"
|
---|
52 | #include "pixmapstr.h"
|
---|
53 | #include "regionstr.h"
|
---|
54 | #include "cursor.h"
|
---|
55 | #include "property.h"
|
---|
56 | #include "resource.h" /* for ROOT_WINDOW_ID_BASE */
|
---|
57 | #include "dix.h"
|
---|
58 | #include "privates.h"
|
---|
59 | #include "miscstruct.h"
|
---|
60 | #include <X11/Xprotostr.h>
|
---|
61 | #include "opaque.h"
|
---|
62 |
|
---|
63 | #define GuaranteeNothing 0
|
---|
64 | #define GuaranteeVisBack 1
|
---|
65 |
|
---|
66 | #define SameBackground(as, a, bs, b) \
|
---|
67 | ((as) == (bs) && ((as) == None || \
|
---|
68 | (as) == ParentRelative || \
|
---|
69 | SamePixUnion(a,b,as == BackgroundPixel)))
|
---|
70 |
|
---|
71 | #define SameBorder(as, a, bs, b) \
|
---|
72 | EqualPixUnion(as, a, bs, b)
|
---|
73 |
|
---|
74 | /* used as NULL-terminated list */
|
---|
75 | typedef struct _DevCursorNode {
|
---|
76 | CursorPtr cursor;
|
---|
77 | DeviceIntPtr dev;
|
---|
78 | struct _DevCursorNode* next;
|
---|
79 | } DevCursNodeRec, *DevCursNodePtr, *DevCursorList;
|
---|
80 |
|
---|
81 | typedef struct _WindowOpt {
|
---|
82 | CursorPtr cursor; /* default: window.cursorNone */
|
---|
83 | VisualID visual; /* default: same as parent */
|
---|
84 | Colormap colormap; /* default: same as parent */
|
---|
85 | Mask dontPropagateMask; /* default: window.dontPropagate */
|
---|
86 | Mask otherEventMasks; /* default: 0 */
|
---|
87 | struct _OtherClients *otherClients; /* default: NULL */
|
---|
88 | struct _GrabRec *passiveGrabs; /* default: NULL */
|
---|
89 | PropertyPtr userProps; /* default: NULL */
|
---|
90 | unsigned long backingBitPlanes; /* default: ~0L */
|
---|
91 | unsigned long backingPixel; /* default: 0 */
|
---|
92 | RegionPtr boundingShape; /* default: NULL */
|
---|
93 | RegionPtr clipShape; /* default: NULL */
|
---|
94 | RegionPtr inputShape; /* default: NULL */
|
---|
95 | struct _OtherInputMasks *inputMasks; /* default: NULL */
|
---|
96 | DevCursorList deviceCursors; /* default: NULL */
|
---|
97 | } WindowOptRec, *WindowOptPtr;
|
---|
98 |
|
---|
99 | #define BackgroundPixel 2L
|
---|
100 | #define BackgroundPixmap 3L
|
---|
101 |
|
---|
102 | /*
|
---|
103 | * The redirectDraw field can have one of three values:
|
---|
104 | *
|
---|
105 | * RedirectDrawNone
|
---|
106 | * A normal window; painted into the same pixmap as the parent
|
---|
107 | * and clipping parent and siblings to its geometry. These
|
---|
108 | * windows get a clip list equal to the intersection of their
|
---|
109 | * geometry with the parent geometry, minus the geometry
|
---|
110 | * of overlapping None and Clipped siblings.
|
---|
111 | * RedirectDrawAutomatic
|
---|
112 | * A redirected window which clips parent and sibling drawing.
|
---|
113 | * Contents for these windows are manage inside the server.
|
---|
114 | * These windows get an internal clip list equal to their
|
---|
115 | * geometry.
|
---|
116 | * RedirectDrawManual
|
---|
117 | * A redirected window which does not clip parent and sibling
|
---|
118 | * drawing; the window must be represented within the parent
|
---|
119 | * geometry by the client performing the redirection management.
|
---|
120 | * Contents for these windows are managed outside the server.
|
---|
121 | * These windows get an internal clip list equal to their
|
---|
122 | * geometry.
|
---|
123 | */
|
---|
124 |
|
---|
125 | #define RedirectDrawNone 0
|
---|
126 | #define RedirectDrawAutomatic 1
|
---|
127 | #define RedirectDrawManual 2
|
---|
128 |
|
---|
129 | typedef struct _Window {
|
---|
130 | DrawableRec drawable;
|
---|
131 | PrivateRec *devPrivates;
|
---|
132 | WindowPtr parent; /* ancestor chain */
|
---|
133 | WindowPtr nextSib; /* next lower sibling */
|
---|
134 | WindowPtr prevSib; /* next higher sibling */
|
---|
135 | WindowPtr firstChild; /* top-most child */
|
---|
136 | WindowPtr lastChild; /* bottom-most child */
|
---|
137 | RegionRec clipList; /* clipping rectangle for output */
|
---|
138 | RegionRec borderClip; /* NotClippedByChildren + border */
|
---|
139 | union _Validate *valdata;
|
---|
140 | RegionRec winSize;
|
---|
141 | RegionRec borderSize;
|
---|
142 | DDXPointRec origin; /* position relative to parent */
|
---|
143 | unsigned short borderWidth;
|
---|
144 | unsigned short deliverableEvents; /* all masks from all clients */
|
---|
145 | Mask eventMask; /* mask from the creating client */
|
---|
146 | PixUnion background;
|
---|
147 | PixUnion border;
|
---|
148 | pointer backStorage; /* null when BS disabled */
|
---|
149 | WindowOptPtr optional;
|
---|
150 | unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */
|
---|
151 | unsigned borderIsPixel:1;
|
---|
152 | unsigned cursorIsNone:1; /* else real cursor (might inherit) */
|
---|
153 | unsigned backingStore:2;
|
---|
154 | unsigned saveUnder:1;
|
---|
155 | unsigned DIXsaveUnder:1;
|
---|
156 | unsigned bitGravity:4;
|
---|
157 | unsigned winGravity:4;
|
---|
158 | unsigned overrideRedirect:1;
|
---|
159 | unsigned visibility:2;
|
---|
160 | unsigned mapped:1;
|
---|
161 | unsigned realized:1; /* ancestors are all mapped */
|
---|
162 | unsigned viewable:1; /* realized && InputOutput */
|
---|
163 | unsigned dontPropagate:3;/* index into DontPropagateMasks */
|
---|
164 | unsigned forcedBS:1; /* system-supplied backingStore */
|
---|
165 | unsigned redirectDraw:2; /* COMPOSITE rendering redirect */
|
---|
166 | unsigned forcedBG:1; /* must have an opaque background */
|
---|
167 | #ifdef ROOTLESS
|
---|
168 | unsigned rootlessUnhittable:1; /* doesn't hit-test */
|
---|
169 | #endif
|
---|
170 | #ifdef COMPOSITE
|
---|
171 | unsigned damagedDescendants:1; /* some descendants are damaged */
|
---|
172 | #endif
|
---|
173 | } WindowRec;
|
---|
174 |
|
---|
175 | /*
|
---|
176 | * Ok, a bunch of macros for accessing the optional record
|
---|
177 | * fields (or filling the appropriate default value)
|
---|
178 | */
|
---|
179 |
|
---|
180 | extern _X_EXPORT Mask DontPropagateMasks[];
|
---|
181 |
|
---|
182 | #define wTrackParent(w,field) ((w)->optional ? \
|
---|
183 | (w)->optional->field \
|
---|
184 | : FindWindowWithOptional(w)->optional->field)
|
---|
185 | #define wUseDefault(w,field,def) ((w)->optional ? \
|
---|
186 | (w)->optional->field \
|
---|
187 | : def)
|
---|
188 |
|
---|
189 | #define wVisual(w) wTrackParent(w, visual)
|
---|
190 | #define wCursor(w) ((w)->cursorIsNone ? None : wTrackParent(w, cursor))
|
---|
191 | #define wColormap(w) ((w)->drawable.class == InputOnly ? None : wTrackParent(w, colormap))
|
---|
192 | #define wDontPropagateMask(w) wUseDefault(w, dontPropagateMask, DontPropagateMasks[(w)->dontPropagate])
|
---|
193 | #define wOtherEventMasks(w) wUseDefault(w, otherEventMasks, 0)
|
---|
194 | #define wOtherClients(w) wUseDefault(w, otherClients, NULL)
|
---|
195 | #define wOtherInputMasks(w) wUseDefault(w, inputMasks, NULL)
|
---|
196 | #define wPassiveGrabs(w) wUseDefault(w, passiveGrabs, NULL)
|
---|
197 | #define wUserProps(w) wUseDefault(w, userProps, NULL)
|
---|
198 | #define wBackingBitPlanes(w) wUseDefault(w, backingBitPlanes, ~0L)
|
---|
199 | #define wBackingPixel(w) wUseDefault(w, backingPixel, 0)
|
---|
200 | #define wBoundingShape(w) wUseDefault(w, boundingShape, NULL)
|
---|
201 | #define wClipShape(w) wUseDefault(w, clipShape, NULL)
|
---|
202 | #define wInputShape(w) wUseDefault(w, inputShape, NULL)
|
---|
203 | #define wClient(w) (clients[CLIENT_ID((w)->drawable.id)])
|
---|
204 | #define wBorderWidth(w) ((int) (w)->borderWidth)
|
---|
205 |
|
---|
206 | /* true when w needs a border drawn. */
|
---|
207 |
|
---|
208 | #define HasBorder(w) ((w)->borderWidth || wClipShape(w))
|
---|
209 |
|
---|
210 | typedef struct _ScreenSaverStuff *ScreenSaverStuffPtr;
|
---|
211 |
|
---|
212 | #define SCREEN_IS_BLANKED 0
|
---|
213 | #define SCREEN_ISNT_SAVED 1
|
---|
214 | #define SCREEN_IS_TILED 2
|
---|
215 | #define SCREEN_IS_BLACK 3
|
---|
216 |
|
---|
217 | #define HasSaverWindow(pScreen) (pScreen->screensaver.pWindow != NullWindow)
|
---|
218 |
|
---|
219 | extern _X_EXPORT int screenIsSaved;
|
---|
220 |
|
---|
221 | #endif /* WINDOWSTRUCT_H */
|
---|