1/***********************************************************
2
3Copyright 1987, 1998  The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25
26Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
27
28                        All Rights Reserved
29
30Permission to use, copy, modify, and distribute this software and its
31documentation for any purpose and without fee is hereby granted,
32provided that the above copyright notice appear in all copies and that
33both that copyright notice and this permission notice appear in
34supporting documentation, and that the name of Digital not be
35used in advertising or publicity pertaining to distribution of the
36software without specific, written prior permission.
37
38DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
44SOFTWARE.
45
46******************************************************************/
47
48#ifndef WINDOW_H
49#define WINDOW_H
50
51#include "misc.h"
52#include "region.h"
53#include "screenint.h"
54#include <X11/Xproto.h>
55
56#define TOTALLY_OBSCURED 0
57#define UNOBSCURED 1
58#define OBSCURED 2
59
60#define VisibilityNotViewable	3
61
62/* return values for tree-walking callback procedures */
63#define WT_STOPWALKING		0
64#define WT_WALKCHILDREN		1
65#define WT_DONTWALKCHILDREN	2
66#define WT_NOMATCH 3
67#define NullWindow ((WindowPtr) 0)
68
69/* Forward declaration, we can't include input.h here */
70struct _DeviceIntRec;
71struct _Cursor;
72
73typedef struct _BackingStore *BackingStorePtr;
74typedef struct _Window *WindowPtr;
75
76typedef int (*VisitWindowProcPtr)(
77    WindowPtr /*pWin*/,
78    pointer /*data*/);
79
80extern _X_EXPORT int TraverseTree(
81    WindowPtr /*pWin*/,
82    VisitWindowProcPtr /*func*/,
83    pointer /*data*/);
84
85extern _X_EXPORT int WalkTree(
86    ScreenPtr /*pScreen*/,
87    VisitWindowProcPtr /*func*/,
88    pointer /*data*/);
89
90extern _X_EXPORT Bool CreateRootWindow(
91    ScreenPtr /*pScreen*/);
92
93extern _X_EXPORT void InitRootWindow(
94    WindowPtr /*pWin*/);
95
96typedef WindowPtr (* RealChildHeadProc) (WindowPtr pWin);
97
98extern _X_EXPORT void RegisterRealChildHeadProc (RealChildHeadProc proc);
99
100extern _X_EXPORT WindowPtr RealChildHead(
101    WindowPtr /*pWin*/);
102
103extern _X_EXPORT WindowPtr CreateWindow(
104    Window /*wid*/,
105    WindowPtr /*pParent*/,
106    int /*x*/,
107    int /*y*/,
108    unsigned int /*w*/,
109    unsigned int /*h*/,
110    unsigned int /*bw*/,
111    unsigned int /*class*/,
112    Mask /*vmask*/,
113    XID* /*vlist*/,
114    int /*depth*/,
115    ClientPtr /*client*/,
116    VisualID /*visual*/,
117    int* /*error*/);
118
119extern _X_EXPORT int DeleteWindow(
120    pointer /*pWin*/,
121    XID /*wid*/);
122
123extern _X_EXPORT int DestroySubwindows(
124    WindowPtr /*pWin*/,
125    ClientPtr /*client*/);
126
127/* Quartz support on Mac OS X uses the HIToolbox
128   framework whose ChangeWindowAttributes function conflicts here. */
129#ifdef __APPLE__
130#define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes
131#endif
132extern _X_EXPORT int ChangeWindowAttributes(
133    WindowPtr /*pWin*/,
134    Mask /*vmask*/,
135    XID* /*vlist*/,
136    ClientPtr /*client*/);
137
138extern _X_EXPORT int ChangeWindowDeviceCursor(
139    WindowPtr /*pWin*/,
140    struct _DeviceIntRec* /*pDev*/,
141    struct _Cursor* /*pCursor*/);
142
143extern _X_EXPORT struct _Cursor* WindowGetDeviceCursor(
144    WindowPtr /*pWin*/,
145    struct _DeviceIntRec* /*pDev*/);
146
147/* Quartz support on Mac OS X uses the HIToolbox
148   framework whose GetWindowAttributes function conflicts here. */
149#ifdef __APPLE__
150#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x)
151extern void Darwin_X_GetWindowAttributes(
152#else
153extern _X_EXPORT void GetWindowAttributes(
154#endif
155    WindowPtr /*pWin*/,
156    ClientPtr /*client*/,
157    xGetWindowAttributesReply* /* wa */);
158
159extern _X_EXPORT void GravityTranslate(
160    int /*x*/,
161    int /*y*/,
162    int /*oldx*/,
163    int /*oldy*/,
164    int /*dw*/,
165    int /*dh*/,
166    unsigned /*gravity*/,
167    int* /*destx*/,
168    int* /*desty*/);
169
170extern _X_EXPORT int ConfigureWindow(
171    WindowPtr /*pWin*/,
172    Mask /*mask*/,
173    XID* /*vlist*/,
174    ClientPtr /*client*/);
175
176extern _X_EXPORT int CirculateWindow(
177    WindowPtr /*pParent*/,
178    int /*direction*/,
179    ClientPtr /*client*/);
180
181extern _X_EXPORT int ReparentWindow(
182    WindowPtr /*pWin*/,
183    WindowPtr /*pParent*/,
184    int /*x*/,
185    int /*y*/,
186    ClientPtr /*client*/);
187
188extern _X_EXPORT int MapWindow(
189    WindowPtr /*pWin*/,
190    ClientPtr /*client*/);
191
192extern _X_EXPORT void MapSubwindows(
193    WindowPtr /*pParent*/,
194    ClientPtr /*client*/);
195
196extern _X_EXPORT int UnmapWindow(
197    WindowPtr /*pWin*/,
198    Bool /*fromConfigure*/);
199
200extern _X_EXPORT void UnmapSubwindows(
201    WindowPtr /*pWin*/);
202
203extern _X_EXPORT void HandleSaveSet(
204    ClientPtr /*client*/);
205
206extern _X_EXPORT Bool PointInWindowIsVisible(
207    WindowPtr /*pWin*/,
208    int /*x*/,
209    int /*y*/);
210
211extern _X_EXPORT RegionPtr NotClippedByChildren(
212    WindowPtr /*pWin*/);
213
214extern _X_EXPORT void SendVisibilityNotify(
215    WindowPtr /*pWin*/);
216
217extern _X_EXPORT int dixSaveScreens(
218    ClientPtr client,
219    int on,
220    int mode);
221
222extern _X_EXPORT int SaveScreens(
223    int on,
224    int mode);
225
226extern _X_EXPORT WindowPtr FindWindowWithOptional(
227    WindowPtr /*w*/);
228
229extern _X_EXPORT void CheckWindowOptionalNeed(
230    WindowPtr /*w*/);
231
232extern _X_EXPORT Bool MakeWindowOptional(
233    WindowPtr /*pWin*/);
234
235extern _X_EXPORT WindowPtr MoveWindowInStack(
236    WindowPtr /*pWin*/,
237    WindowPtr /*pNextSib*/);
238
239extern _X_EXPORT void SetWinSize(
240    WindowPtr /*pWin*/);
241
242extern _X_EXPORT void SetBorderSize(
243    WindowPtr /*pWin*/);
244
245extern _X_EXPORT void ResizeChildrenWinSize(
246    WindowPtr /*pWin*/,
247    int /*dx*/,
248    int /*dy*/,
249    int /*dw*/,
250    int /*dh*/);
251
252extern _X_EXPORT void ShapeExtensionInit(void);
253
254extern _X_EXPORT void SendShapeNotify(
255    WindowPtr /* pWin */,
256    int /* which */ );
257
258extern _X_EXPORT RegionPtr CreateBoundingShape(
259    WindowPtr /* pWin */ );
260
261extern _X_EXPORT RegionPtr CreateClipShape(
262    WindowPtr /* pWin */ );
263
264extern _X_EXPORT void DisableMapUnmapEvents(
265    WindowPtr /* pWin */ );
266extern _X_EXPORT void EnableMapUnmapEvents(
267    WindowPtr /* pWin */ );
268
269#endif /* WINDOW_H */
270