f78b12e570284aa8291f4ca1add24937fd107403vboxsync/***********************************************************
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCopyright 1987, 1998 The Open Group
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncthe above copyright notice appear in all copies and that both that
f78b12e570284aa8291f4ca1add24937fd107403vboxsynccopyright notice and this permission notice appear in supporting
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncThe above copyright notice and this permission notice shall be included in
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncall copies or substantial portions of the Software.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncin this Software without prior written authorization from The Open Group.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync All Rights Reserved
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPermission to use, copy, modify, and distribute this software and its
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncdocumentation for any purpose and without fee is hereby granted,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncprovided that the above copyright notice appear in all copies and that
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncboth that copyright notice and this permission notice appear in
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncsupporting documentation, and that the name of Digital not be
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncused in advertising or publicity pertaining to distribution of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncsoftware without specific, written prior permission.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncSOFTWARE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync******************************************************************/
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifndef WINDOWSTRUCT_H
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define WINDOWSTRUCT_H
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "window.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "pixmapstr.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "regionstr.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "cursor.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "property.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "resource.h" /* for ROOT_WINDOW_ID_BASE */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "dix.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "privates.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "miscstruct.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <X11/Xprotostr.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include "opaque.h"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GuaranteeNothing 0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define GuaranteeVisBack 1
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define SameBackground(as, a, bs, b) \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ((as) == (bs) && ((as) == None || \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync (as) == ParentRelative || \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync SamePixUnion(a,b,as == BackgroundPixel)))
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define SameBorder(as, a, bs, b) \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync EqualPixUnion(as, a, bs, b)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* used as NULL-terminated list */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _DevCursorNode {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CursorPtr cursor;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DeviceIntPtr dev;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync struct _DevCursorNode* next;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} DevCursNodeRec, *DevCursNodePtr, *DevCursorList;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _WindowOpt {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CursorPtr cursor; /* default: window.cursorNone */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync VisualID visual; /* default: same as parent */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Colormap colormap; /* default: same as parent */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Mask dontPropagateMask; /* default: window.dontPropagate */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Mask otherEventMasks; /* default: 0 */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync struct _OtherClients *otherClients; /* default: NULL */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync struct _GrabRec *passiveGrabs; /* default: NULL */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PropertyPtr userProps; /* default: NULL */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned long backingBitPlanes; /* default: ~0L */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned long backingPixel; /* default: 0 */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionPtr boundingShape; /* default: NULL */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionPtr clipShape; /* default: NULL */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionPtr inputShape; /* default: NULL */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync struct _OtherInputMasks *inputMasks; /* default: NULL */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DevCursorList deviceCursors; /* default: NULL */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} WindowOptRec, *WindowOptPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define BackgroundPixel 2L
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define BackgroundPixmap 3L
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * The redirectDraw field can have one of three values:
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * RedirectDrawNone
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * A normal window; painted into the same pixmap as the parent
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * and clipping parent and siblings to its geometry. These
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * windows get a clip list equal to the intersection of their
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * geometry with the parent geometry, minus the geometry
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * of overlapping None and Clipped siblings.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * RedirectDrawAutomatic
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * A redirected window which clips parent and sibling drawing.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Contents for these windows are manage inside the server.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * These windows get an internal clip list equal to their
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * geometry.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * RedirectDrawManual
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * A redirected window which does not clip parent and sibling
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * drawing; the window must be represented within the parent
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * geometry by the client performing the redirection management.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Contents for these windows are managed outside the server.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * These windows get an internal clip list equal to their
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * geometry.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define RedirectDrawNone 0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define RedirectDrawAutomatic 1
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define RedirectDrawManual 2
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _Window {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DrawableRec drawable;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PrivateRec *devPrivates;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync WindowPtr parent; /* ancestor chain */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync WindowPtr nextSib; /* next lower sibling */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync WindowPtr prevSib; /* next higher sibling */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync WindowPtr firstChild; /* top-most child */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync WindowPtr lastChild; /* bottom-most child */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionRec clipList; /* clipping rectangle for output */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionRec borderClip; /* NotClippedByChildren + border */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync union _Validate *valdata;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionRec winSize;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionRec borderSize;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DDXPointRec origin; /* position relative to parent */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned short borderWidth;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned short deliverableEvents; /* all masks from all clients */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync Mask eventMask; /* mask from the creating client */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PixUnion background;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync PixUnion border;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync pointer backStorage; /* null when BS disabled */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync WindowOptPtr optional;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned borderIsPixel:1;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned cursorIsNone:1; /* else real cursor (might inherit) */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned backingStore:2;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned saveUnder:1;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned DIXsaveUnder:1;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned bitGravity:4;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned winGravity:4;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned overrideRedirect:1;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned visibility:2;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned mapped:1;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned realized:1; /* ancestors are all mapped */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned viewable:1; /* realized && InputOutput */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned dontPropagate:3;/* index into DontPropagateMasks */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned forcedBS:1; /* system-supplied backingStore */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned redirectDraw:2; /* COMPOSITE rendering redirect */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned forcedBG:1; /* must have an opaque background */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifdef ROOTLESS
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned rootlessUnhittable:1; /* doesn't hit-test */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifdef COMPOSITE
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned damagedDescendants:1; /* some descendants are damaged */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned inhibitBGPaint:1; /* paint the background? */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} WindowRec;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Ok, a bunch of macros for accessing the optional record
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * fields (or filling the appropriate default value)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Mask DontPropagateMasks[];
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wTrackParent(w,field) ((w)->optional ? \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync (w)->optional->field \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync : FindWindowWithOptional(w)->optional->field)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wUseDefault(w,field,def) ((w)->optional ? \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync (w)->optional->field \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync : def)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wVisual(w) wTrackParent(w, visual)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wCursor(w) ((w)->cursorIsNone ? None : wTrackParent(w, cursor))
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wColormap(w) ((w)->drawable.class == InputOnly ? None : wTrackParent(w, colormap))
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wDontPropagateMask(w) wUseDefault(w, dontPropagateMask, DontPropagateMasks[(w)->dontPropagate])
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wOtherEventMasks(w) wUseDefault(w, otherEventMasks, 0)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wOtherClients(w) wUseDefault(w, otherClients, NULL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wOtherInputMasks(w) wUseDefault(w, inputMasks, NULL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wPassiveGrabs(w) wUseDefault(w, passiveGrabs, NULL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wUserProps(w) wUseDefault(w, userProps, NULL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wBackingBitPlanes(w) wUseDefault(w, backingBitPlanes, ~0L)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wBackingPixel(w) wUseDefault(w, backingPixel, 0)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wBoundingShape(w) wUseDefault(w, boundingShape, NULL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wClipShape(w) wUseDefault(w, clipShape, NULL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wInputShape(w) wUseDefault(w, inputShape, NULL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wClient(w) (clients[CLIENT_ID((w)->drawable.id)])
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define wBorderWidth(w) ((int) (w)->borderWidth)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* true when w needs a border drawn. */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define HasBorder(w) ((w)->borderWidth || wClipShape(w))
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct _ScreenSaverStuff *ScreenSaverStuffPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define SCREEN_IS_BLANKED 0
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define SCREEN_ISNT_SAVED 1
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define SCREEN_IS_TILED 2
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define SCREEN_IS_BLACK 3
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define HasSaverWindow(pScreen) (pScreen->screensaver.pWindow != NullWindow)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int screenIsSaved;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif /* WINDOWSTRUCT_H */