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 2505b261ecSmrgCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. 2605b261ecSmrg 2705b261ecSmrg All Rights Reserved 2805b261ecSmrg 2935c4bbdfSmrgPermission to use, copy, modify, and distribute this software and its 3035c4bbdfSmrgdocumentation for any purpose and without fee is hereby granted, 3105b261ecSmrgprovided that the above copyright notice appear in all copies and that 3235c4bbdfSmrgboth that copyright notice and this permission notice appear in 3305b261ecSmrgsupporting documentation, and that the name of Digital not be 3405b261ecSmrgused in advertising or publicity pertaining to distribution of the 3535c4bbdfSmrgsoftware without specific, written prior permission. 3605b261ecSmrg 3705b261ecSmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 3805b261ecSmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 3905b261ecSmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 4005b261ecSmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 4105b261ecSmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 4205b261ecSmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 4305b261ecSmrgSOFTWARE. 4405b261ecSmrg 4505b261ecSmrg******************************************************************/ 4605b261ecSmrg 4705b261ecSmrg#ifndef WINDOW_H 4805b261ecSmrg#define WINDOW_H 4905b261ecSmrg 5005b261ecSmrg#include "misc.h" 5105b261ecSmrg#include "region.h" 5205b261ecSmrg#include "screenint.h" 5305b261ecSmrg#include <X11/Xproto.h> 5405b261ecSmrg 5505b261ecSmrg#define TOTALLY_OBSCURED 0 5605b261ecSmrg#define UNOBSCURED 1 5705b261ecSmrg#define OBSCURED 2 5805b261ecSmrg 5905b261ecSmrg#define VisibilityNotViewable 3 6005b261ecSmrg 6105b261ecSmrg/* return values for tree-walking callback procedures */ 6205b261ecSmrg#define WT_STOPWALKING 0 6305b261ecSmrg#define WT_WALKCHILDREN 1 6405b261ecSmrg#define WT_DONTWALKCHILDREN 2 6505b261ecSmrg#define WT_NOMATCH 3 6605b261ecSmrg#define NullWindow ((WindowPtr) 0) 6705b261ecSmrg 684642e01fSmrg/* Forward declaration, we can't include input.h here */ 694642e01fSmrgstruct _DeviceIntRec; 704642e01fSmrgstruct _Cursor; 714642e01fSmrg 7205b261ecSmrgtypedef struct _BackingStore *BackingStorePtr; 7305b261ecSmrgtypedef struct _Window *WindowPtr; 7405b261ecSmrg 7535c4bbdfSmrgenum RootClipMode { 7635c4bbdfSmrg ROOT_CLIP_NONE = 0, /**< resize the root window to 0x0 */ 7735c4bbdfSmrg ROOT_CLIP_FULL = 1, /**< resize the root window to fit screen */ 7835c4bbdfSmrg ROOT_CLIP_INPUT_ONLY = 2, /**< as above, but no rendering to screen */ 7935c4bbdfSmrg}; 8035c4bbdfSmrg 8135c4bbdfSmrgtypedef int (*VisitWindowProcPtr) (WindowPtr pWin, 8235c4bbdfSmrg void *data); 8335c4bbdfSmrg 8435c4bbdfSmrgextern _X_EXPORT int TraverseTree(WindowPtr pWin, 8535c4bbdfSmrg VisitWindowProcPtr func, 8635c4bbdfSmrg void *data); 8735c4bbdfSmrg 8835c4bbdfSmrgextern _X_EXPORT int WalkTree(ScreenPtr pScreen, 8935c4bbdfSmrg VisitWindowProcPtr func, 9035c4bbdfSmrg void *data); 9135c4bbdfSmrg 9235c4bbdfSmrgextern _X_EXPORT Bool CreateRootWindow(ScreenPtr /*pScreen */ ); 9335c4bbdfSmrg 9435c4bbdfSmrgextern _X_EXPORT void InitRootWindow(WindowPtr /*pWin */ ); 9535c4bbdfSmrg 9635c4bbdfSmrgtypedef WindowPtr (*RealChildHeadProc) (WindowPtr pWin); 9735c4bbdfSmrg 9835c4bbdfSmrgextern _X_EXPORT void RegisterRealChildHeadProc(RealChildHeadProc proc); 9935c4bbdfSmrg 10035c4bbdfSmrgextern _X_EXPORT WindowPtr RealChildHead(WindowPtr /*pWin */ ); 10135c4bbdfSmrg 10235c4bbdfSmrgextern _X_EXPORT WindowPtr CreateWindow(Window /*wid */ , 10335c4bbdfSmrg WindowPtr /*pParent */ , 10435c4bbdfSmrg int /*x */ , 10535c4bbdfSmrg int /*y */ , 10635c4bbdfSmrg unsigned int /*w */ , 10735c4bbdfSmrg unsigned int /*h */ , 10835c4bbdfSmrg unsigned int /*bw */ , 10935c4bbdfSmrg unsigned int /*class */ , 11035c4bbdfSmrg Mask /*vmask */ , 11135c4bbdfSmrg XID * /*vlist */ , 11235c4bbdfSmrg int /*depth */ , 11335c4bbdfSmrg ClientPtr /*client */ , 11435c4bbdfSmrg VisualID /*visual */ , 11535c4bbdfSmrg int * /*error */ ); 11635c4bbdfSmrg 11735c4bbdfSmrgextern _X_EXPORT int DeleteWindow(void *pWin, 11835c4bbdfSmrg XID wid); 11935c4bbdfSmrg 12035c4bbdfSmrgextern _X_EXPORT int DestroySubwindows(WindowPtr /*pWin */ , 12135c4bbdfSmrg ClientPtr /*client */ ); 12205b261ecSmrg 12305b261ecSmrg/* Quartz support on Mac OS X uses the HIToolbox 12405b261ecSmrg framework whose ChangeWindowAttributes function conflicts here. */ 1254642e01fSmrg#ifdef __APPLE__ 12605b261ecSmrg#define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes 12705b261ecSmrg#endif 12835c4bbdfSmrgextern _X_EXPORT int ChangeWindowAttributes(WindowPtr /*pWin */ , 12935c4bbdfSmrg Mask /*vmask */ , 13035c4bbdfSmrg XID * /*vlist */ , 13135c4bbdfSmrg ClientPtr /*client */ ); 13205b261ecSmrg 13335c4bbdfSmrgextern _X_EXPORT int ChangeWindowDeviceCursor(WindowPtr /*pWin */ , 13435c4bbdfSmrg struct _DeviceIntRec * /*pDev */ , 13535c4bbdfSmrg struct _Cursor * /*pCursor */ ); 1364642e01fSmrg 13735c4bbdfSmrgextern _X_EXPORT struct _Cursor *WindowGetDeviceCursor(WindowPtr /*pWin */ , 13835c4bbdfSmrg struct _DeviceIntRec * 13935c4bbdfSmrg /*pDev */ ); 1404642e01fSmrg 14105b261ecSmrg/* Quartz support on Mac OS X uses the HIToolbox 14205b261ecSmrg framework whose GetWindowAttributes function conflicts here. */ 1434642e01fSmrg#ifdef __APPLE__ 14405b261ecSmrg#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x) 14505b261ecSmrgextern void Darwin_X_GetWindowAttributes( 14605b261ecSmrg#else 1476747b715Smrgextern _X_EXPORT void GetWindowAttributes( 14805b261ecSmrg#endif 14935c4bbdfSmrg WindowPtr /*pWin */ , 15035c4bbdfSmrg ClientPtr /*client */ , 15135c4bbdfSmrg xGetWindowAttributesReply * 15235c4bbdfSmrg /* wa */ ); 15335c4bbdfSmrg 15435c4bbdfSmrgextern _X_EXPORT void GravityTranslate(int /*x */ , 15535c4bbdfSmrg int /*y */ , 15635c4bbdfSmrg int /*oldx */ , 15735c4bbdfSmrg int /*oldy */ , 15835c4bbdfSmrg int /*dw */ , 15935c4bbdfSmrg int /*dh */ , 16035c4bbdfSmrg unsigned /*gravity */ , 16135c4bbdfSmrg int * /*destx */ , 16235c4bbdfSmrg int * /*desty */ ); 16335c4bbdfSmrg 16435c4bbdfSmrgextern _X_EXPORT int ConfigureWindow(WindowPtr /*pWin */ , 16535c4bbdfSmrg Mask /*mask */ , 16635c4bbdfSmrg XID * /*vlist */ , 16735c4bbdfSmrg ClientPtr /*client */ ); 16835c4bbdfSmrg 16935c4bbdfSmrgextern _X_EXPORT int CirculateWindow(WindowPtr /*pParent */ , 17035c4bbdfSmrg int /*direction */ , 17135c4bbdfSmrg ClientPtr /*client */ ); 17235c4bbdfSmrg 17335c4bbdfSmrgextern _X_EXPORT int ReparentWindow(WindowPtr /*pWin */ , 17435c4bbdfSmrg WindowPtr /*pParent */ , 17535c4bbdfSmrg int /*x */ , 17635c4bbdfSmrg int /*y */ , 17735c4bbdfSmrg ClientPtr /*client */ ); 17835c4bbdfSmrg 17935c4bbdfSmrgextern _X_EXPORT int MapWindow(WindowPtr /*pWin */ , 18035c4bbdfSmrg ClientPtr /*client */ ); 18135c4bbdfSmrg 18235c4bbdfSmrgextern _X_EXPORT void MapSubwindows(WindowPtr /*pParent */ , 18335c4bbdfSmrg ClientPtr /*client */ ); 18435c4bbdfSmrg 18535c4bbdfSmrgextern _X_EXPORT int UnmapWindow(WindowPtr /*pWin */ , 18635c4bbdfSmrg Bool /*fromConfigure */ ); 18735c4bbdfSmrg 18835c4bbdfSmrgextern _X_EXPORT void UnmapSubwindows(WindowPtr /*pWin */ ); 18935c4bbdfSmrg 19035c4bbdfSmrgextern _X_EXPORT void HandleSaveSet(ClientPtr /*client */ ); 19135c4bbdfSmrg 19235c4bbdfSmrgextern _X_EXPORT Bool PointInWindowIsVisible(WindowPtr /*pWin */ , 19335c4bbdfSmrg int /*x */ , 19435c4bbdfSmrg int /*y */ ); 19535c4bbdfSmrg 19635c4bbdfSmrgextern _X_EXPORT RegionPtr NotClippedByChildren(WindowPtr /*pWin */ ); 19735c4bbdfSmrg 19835c4bbdfSmrgextern _X_EXPORT void SendVisibilityNotify(WindowPtr /*pWin */ ); 19935c4bbdfSmrg 20035c4bbdfSmrgextern _X_EXPORT int dixSaveScreens(ClientPtr client, int on, int mode); 20135c4bbdfSmrg 20235c4bbdfSmrgextern _X_EXPORT int SaveScreens(int on, int mode); 20335c4bbdfSmrg 20435c4bbdfSmrgextern _X_EXPORT WindowPtr FindWindowWithOptional(WindowPtr /*w */ ); 20535c4bbdfSmrg 20635c4bbdfSmrgextern _X_EXPORT void CheckWindowOptionalNeed(WindowPtr /*w */ ); 20735c4bbdfSmrg 20835c4bbdfSmrgextern _X_EXPORT Bool MakeWindowOptional(WindowPtr /*pWin */ ); 20935c4bbdfSmrg 21035c4bbdfSmrgextern _X_EXPORT WindowPtr MoveWindowInStack(WindowPtr /*pWin */ , 21135c4bbdfSmrg WindowPtr /*pNextSib */ ); 21235c4bbdfSmrg 21335c4bbdfSmrgextern _X_EXPORT void SetWinSize(WindowPtr /*pWin */ ); 21435c4bbdfSmrg 21535c4bbdfSmrgextern _X_EXPORT void SetBorderSize(WindowPtr /*pWin */ ); 21635c4bbdfSmrg 21735c4bbdfSmrgextern _X_EXPORT void ResizeChildrenWinSize(WindowPtr /*pWin */ , 21835c4bbdfSmrg int /*dx */ , 21935c4bbdfSmrg int /*dy */ , 22035c4bbdfSmrg int /*dw */ , 22135c4bbdfSmrg int /*dh */ ); 22235c4bbdfSmrg 22335c4bbdfSmrgextern _X_EXPORT void SendShapeNotify(WindowPtr /* pWin */ , 22435c4bbdfSmrg int /* which */); 22535c4bbdfSmrg 22635c4bbdfSmrgextern _X_EXPORT RegionPtr CreateBoundingShape(WindowPtr /* pWin */ ); 22735c4bbdfSmrg 22835c4bbdfSmrgextern _X_EXPORT RegionPtr CreateClipShape(WindowPtr /* pWin */ ); 22905b261ecSmrg 23035c4bbdfSmrgextern _X_EXPORT void SetRootClip(ScreenPtr pScreen, int enable); 23135c4bbdfSmrgextern _X_EXPORT void PrintWindowTree(void); 23235c4bbdfSmrgextern _X_EXPORT void PrintPassiveGrabs(void); 23305b261ecSmrg 23435c4bbdfSmrgextern _X_EXPORT VisualPtr WindowGetVisual(WindowPtr /*pWin*/); 23535c4bbdfSmrg#endif /* WINDOW_H */ 236