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