window.h revision 05b261ec
105b261ecSmrg/***********************************************************
205b261ecSmrg
305b261ecSmrgCopyright 1987, 1998  The Open Group
405b261ecSmrg
505b261ecSmrgPermission to use, copy, modify, distribute, and sell this software and its
605b261ecSmrgdocumentation for any purpose is hereby granted without fee, provided that
705b261ecSmrgthe above copyright notice appear in all copies and that both that
805b261ecSmrgcopyright notice and this permission notice appear in supporting
905b261ecSmrgdocumentation.
1005b261ecSmrg
1105b261ecSmrgThe above copyright notice and this permission notice shall be included in
1205b261ecSmrgall copies or substantial portions of the Software.
1305b261ecSmrg
1405b261ecSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1505b261ecSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1605b261ecSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
1705b261ecSmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1805b261ecSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1905b261ecSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2005b261ecSmrg
2105b261ecSmrgExcept as contained in this notice, the name of The Open Group shall not be
2205b261ecSmrgused in advertising or otherwise to promote the sale, use or other dealings
2305b261ecSmrgin this Software without prior written authorization from The Open Group.
2405b261ecSmrg
2505b261ecSmrg
2605b261ecSmrgCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
2705b261ecSmrg
2805b261ecSmrg                        All Rights Reserved
2905b261ecSmrg
3005b261ecSmrgPermission to use, copy, modify, and distribute this software and its
3105b261ecSmrgdocumentation for any purpose and without fee is hereby granted,
3205b261ecSmrgprovided that the above copyright notice appear in all copies and that
3305b261ecSmrgboth that copyright notice and this permission notice appear in
3405b261ecSmrgsupporting documentation, and that the name of Digital not be
3505b261ecSmrgused in advertising or publicity pertaining to distribution of the
3605b261ecSmrgsoftware without specific, written prior permission.
3705b261ecSmrg
3805b261ecSmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
3905b261ecSmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
4005b261ecSmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
4105b261ecSmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
4205b261ecSmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
4305b261ecSmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
4405b261ecSmrgSOFTWARE.
4505b261ecSmrg
4605b261ecSmrg******************************************************************/
4705b261ecSmrg
4805b261ecSmrg#ifndef WINDOW_H
4905b261ecSmrg#define WINDOW_H
5005b261ecSmrg
5105b261ecSmrg#include "misc.h"
5205b261ecSmrg#include "region.h"
5305b261ecSmrg#include "screenint.h"
5405b261ecSmrg#include <X11/Xproto.h>
5505b261ecSmrg
5605b261ecSmrg#define TOTALLY_OBSCURED 0
5705b261ecSmrg#define UNOBSCURED 1
5805b261ecSmrg#define OBSCURED 2
5905b261ecSmrg
6005b261ecSmrg#define VisibilityNotViewable	3
6105b261ecSmrg
6205b261ecSmrg/* return values for tree-walking callback procedures */
6305b261ecSmrg#define WT_STOPWALKING		0
6405b261ecSmrg#define WT_WALKCHILDREN		1
6505b261ecSmrg#define WT_DONTWALKCHILDREN	2
6605b261ecSmrg#define WT_NOMATCH 3
6705b261ecSmrg#define NullWindow ((WindowPtr) 0)
6805b261ecSmrg
6905b261ecSmrgtypedef struct _BackingStore *BackingStorePtr;
7005b261ecSmrgtypedef struct _Window *WindowPtr;
7105b261ecSmrg
7205b261ecSmrgtypedef int (*VisitWindowProcPtr)(
7305b261ecSmrg    WindowPtr /*pWin*/,
7405b261ecSmrg    pointer /*data*/);
7505b261ecSmrg
7605b261ecSmrgextern int TraverseTree(
7705b261ecSmrg    WindowPtr /*pWin*/,
7805b261ecSmrg    VisitWindowProcPtr /*func*/,
7905b261ecSmrg    pointer /*data*/);
8005b261ecSmrg
8105b261ecSmrgextern int WalkTree(
8205b261ecSmrg    ScreenPtr /*pScreen*/,
8305b261ecSmrg    VisitWindowProcPtr /*func*/,
8405b261ecSmrg    pointer /*data*/);
8505b261ecSmrg
8605b261ecSmrgextern WindowPtr AllocateWindow(
8705b261ecSmrg    ScreenPtr /*pScreen*/);
8805b261ecSmrg
8905b261ecSmrgextern Bool CreateRootWindow(
9005b261ecSmrg    ScreenPtr /*pScreen*/);
9105b261ecSmrg
9205b261ecSmrgextern void InitRootWindow(
9305b261ecSmrg    WindowPtr /*pWin*/);
9405b261ecSmrg
9505b261ecSmrgtypedef WindowPtr (* RealChildHeadProc) (WindowPtr pWin);
9605b261ecSmrg
9705b261ecSmrgvoid RegisterRealChildHeadProc (RealChildHeadProc proc);
9805b261ecSmrg
9905b261ecSmrgextern WindowPtr RealChildHead(
10005b261ecSmrg    WindowPtr /*pWin*/);
10105b261ecSmrg
10205b261ecSmrgextern WindowPtr CreateWindow(
10305b261ecSmrg    Window /*wid*/,
10405b261ecSmrg    WindowPtr /*pParent*/,
10505b261ecSmrg    int /*x*/,
10605b261ecSmrg    int /*y*/,
10705b261ecSmrg    unsigned int /*w*/,
10805b261ecSmrg    unsigned int /*h*/,
10905b261ecSmrg    unsigned int /*bw*/,
11005b261ecSmrg    unsigned int /*class*/,
11105b261ecSmrg    Mask /*vmask*/,
11205b261ecSmrg    XID* /*vlist*/,
11305b261ecSmrg    int /*depth*/,
11405b261ecSmrg    ClientPtr /*client*/,
11505b261ecSmrg    VisualID /*visual*/,
11605b261ecSmrg    int* /*error*/);
11705b261ecSmrg
11805b261ecSmrgextern int DeleteWindow(
11905b261ecSmrg    pointer /*pWin*/,
12005b261ecSmrg    XID /*wid*/);
12105b261ecSmrg
12205b261ecSmrgextern void DestroySubwindows(
12305b261ecSmrg    WindowPtr /*pWin*/,
12405b261ecSmrg    ClientPtr /*client*/);
12505b261ecSmrg
12605b261ecSmrg/* Quartz support on Mac OS X uses the HIToolbox
12705b261ecSmrg   framework whose ChangeWindowAttributes function conflicts here. */
12805b261ecSmrg#ifdef __DARWIN__
12905b261ecSmrg#define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes
13005b261ecSmrg#endif
13105b261ecSmrgextern int ChangeWindowAttributes(
13205b261ecSmrg    WindowPtr /*pWin*/,
13305b261ecSmrg    Mask /*vmask*/,
13405b261ecSmrg    XID* /*vlist*/,
13505b261ecSmrg    ClientPtr /*client*/);
13605b261ecSmrg
13705b261ecSmrg/* Quartz support on Mac OS X uses the HIToolbox
13805b261ecSmrg   framework whose GetWindowAttributes function conflicts here. */
13905b261ecSmrg#ifdef __DARWIN__
14005b261ecSmrg#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x)
14105b261ecSmrgextern void Darwin_X_GetWindowAttributes(
14205b261ecSmrg#else
14305b261ecSmrgextern void GetWindowAttributes(
14405b261ecSmrg#endif
14505b261ecSmrg    WindowPtr /*pWin*/,
14605b261ecSmrg    ClientPtr /*client*/,
14705b261ecSmrg    xGetWindowAttributesReply* /* wa */);
14805b261ecSmrg
14905b261ecSmrgextern RegionPtr CreateUnclippedWinSize(
15005b261ecSmrg    WindowPtr /*pWin*/);
15105b261ecSmrg
15205b261ecSmrgextern void GravityTranslate(
15305b261ecSmrg    int /*x*/,
15405b261ecSmrg    int /*y*/,
15505b261ecSmrg    int /*oldx*/,
15605b261ecSmrg    int /*oldy*/,
15705b261ecSmrg    int /*dw*/,
15805b261ecSmrg    int /*dh*/,
15905b261ecSmrg    unsigned /*gravity*/,
16005b261ecSmrg    int* /*destx*/,
16105b261ecSmrg    int* /*desty*/);
16205b261ecSmrg
16305b261ecSmrgextern int ConfigureWindow(
16405b261ecSmrg    WindowPtr /*pWin*/,
16505b261ecSmrg    Mask /*mask*/,
16605b261ecSmrg    XID* /*vlist*/,
16705b261ecSmrg    ClientPtr /*client*/);
16805b261ecSmrg
16905b261ecSmrgextern int CirculateWindow(
17005b261ecSmrg    WindowPtr /*pParent*/,
17105b261ecSmrg    int /*direction*/,
17205b261ecSmrg    ClientPtr /*client*/);
17305b261ecSmrg
17405b261ecSmrgextern int ReparentWindow(
17505b261ecSmrg    WindowPtr /*pWin*/,
17605b261ecSmrg    WindowPtr /*pParent*/,
17705b261ecSmrg    int /*x*/,
17805b261ecSmrg    int /*y*/,
17905b261ecSmrg    ClientPtr /*client*/);
18005b261ecSmrg
18105b261ecSmrgextern int MapWindow(
18205b261ecSmrg    WindowPtr /*pWin*/,
18305b261ecSmrg    ClientPtr /*client*/);
18405b261ecSmrg
18505b261ecSmrgextern void MapSubwindows(
18605b261ecSmrg    WindowPtr /*pParent*/,
18705b261ecSmrg    ClientPtr /*client*/);
18805b261ecSmrg
18905b261ecSmrgextern int UnmapWindow(
19005b261ecSmrg    WindowPtr /*pWin*/,
19105b261ecSmrg    Bool /*fromConfigure*/);
19205b261ecSmrg
19305b261ecSmrgextern void UnmapSubwindows(
19405b261ecSmrg    WindowPtr /*pWin*/);
19505b261ecSmrg
19605b261ecSmrgextern void HandleSaveSet(
19705b261ecSmrg    ClientPtr /*client*/);
19805b261ecSmrg
19905b261ecSmrgextern Bool PointInWindowIsVisible(
20005b261ecSmrg    WindowPtr /*pWin*/,
20105b261ecSmrg    int /*x*/,
20205b261ecSmrg    int /*y*/);
20305b261ecSmrg
20405b261ecSmrgextern RegionPtr NotClippedByChildren(
20505b261ecSmrg    WindowPtr /*pWin*/);
20605b261ecSmrg
20705b261ecSmrgextern void SendVisibilityNotify(
20805b261ecSmrg    WindowPtr /*pWin*/);
20905b261ecSmrg
21005b261ecSmrgextern void SaveScreens(
21105b261ecSmrg    int /*on*/,
21205b261ecSmrg    int /*mode*/);
21305b261ecSmrg
21405b261ecSmrgextern WindowPtr FindWindowWithOptional(
21505b261ecSmrg    WindowPtr /*w*/);
21605b261ecSmrg
21705b261ecSmrgextern void CheckWindowOptionalNeed(
21805b261ecSmrg    WindowPtr /*w*/);
21905b261ecSmrg
22005b261ecSmrgextern Bool MakeWindowOptional(
22105b261ecSmrg    WindowPtr /*pWin*/);
22205b261ecSmrg
22305b261ecSmrgextern WindowPtr MoveWindowInStack(
22405b261ecSmrg    WindowPtr /*pWin*/,
22505b261ecSmrg    WindowPtr /*pNextSib*/);
22605b261ecSmrg
22705b261ecSmrgvoid SetWinSize(
22805b261ecSmrg    WindowPtr /*pWin*/);
22905b261ecSmrg
23005b261ecSmrgvoid SetBorderSize(
23105b261ecSmrg    WindowPtr /*pWin*/);
23205b261ecSmrg
23305b261ecSmrgvoid ResizeChildrenWinSize(
23405b261ecSmrg    WindowPtr /*pWin*/,
23505b261ecSmrg    int /*dx*/,
23605b261ecSmrg    int /*dy*/,
23705b261ecSmrg    int /*dw*/,
23805b261ecSmrg    int /*dh*/);
23905b261ecSmrg
24005b261ecSmrgextern void ShapeExtensionInit(void);
24105b261ecSmrg
24205b261ecSmrgextern void SendShapeNotify(
24305b261ecSmrg    WindowPtr /* pWin */,
24405b261ecSmrg    int /* which */ );
24505b261ecSmrg
24605b261ecSmrgextern RegionPtr CreateBoundingShape(
24705b261ecSmrg    WindowPtr /* pWin */ );
24805b261ecSmrg
24905b261ecSmrgextern RegionPtr CreateClipShape(
25005b261ecSmrg    WindowPtr /* pWin */ );
25105b261ecSmrg
25205b261ecSmrgextern void DisableMapUnmapEvents(
25305b261ecSmrg    WindowPtr /* pWin */ );
25405b261ecSmrgextern void EnableMapUnmapEvents(
25505b261ecSmrg    WindowPtr /* pWin */ );
25605b261ecSmrg
25705b261ecSmrg#endif /* WINDOW_H */
258