a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/***********************************************************
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncCopyright 1987, 1998 The Open Group
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncthe above copyright notice appear in all copies and that both that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynccopyright notice and this permission notice appear in supporting
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncdocumentation.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncThe above copyright notice and this permission notice shall be included in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncall copies or substantial portions of the Software.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncin this Software without prior written authorization from The Open Group.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync All Rights Reserved
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncPermission to use, copy, modify, and distribute this software and its
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncdocumentation for any purpose and without fee is hereby granted,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncprovided that the above copyright notice appear in all copies and that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncboth that copyright notice and this permission notice appear in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncsupporting documentation, and that the name of Digital not be
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncused in advertising or publicity pertaining to distribution of the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncsoftware without specific, written prior permission.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncSOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync******************************************************************/
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef SCREENINTSTRUCT_H
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define SCREENINTSTRUCT_H
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "screenint.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "regionstr.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "colormap.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "cursor.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "validate.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <X11/Xproto.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "dix.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "privates.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _PixmapFormat {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned char depth;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned char bitsPerPixel;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned char scanlinePad;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} PixmapFormatRec;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _Visual {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VisualID vid;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short class;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short bitsPerRGBValue;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short ColormapEntries;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short nplanes; /* = log2 (ColormapEntries). This does not
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * imply that the screen has this many planes.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * it may have more or fewer */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long redMask, greenMask, blueMask;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int offsetRed, offsetGreen, offsetBlue;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} VisualRec;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _Depth {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned char depth;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short numVids;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VisualID *vids; /* block of visual ids for this depth */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} DepthRec;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _ScreenSaverStuff {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr pWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync XID wid;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync char blanked;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool (*ExternalScreenSaver) (ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*xstate */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool /*force */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} ScreenSaverStuffRec;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * There is a typedef for each screen function pointer so that code that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * needs to declare a screen function pointer (e.g. in a screen private
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * or as a local variable) can easily do so and retain full type checking.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*QueryBestSizeProcPtr) (int /*class */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned short * /*pwidth */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned short * /*pheight */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /*pScreen */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*SaveScreenProcPtr) (ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*on */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*GetImageProcPtr) (DrawablePtr /*pDrawable */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*sx */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*sy */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*w */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*h */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int /*format */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long /*planeMask */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync char * /*pdstLine */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*GetSpansProcPtr) (DrawablePtr /*pDrawable */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*wMax */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DDXPointPtr /*ppt */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int * /*pwidth */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*nspans */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync char * /*pdstStart */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*SourceValidateProcPtr) (DrawablePtr /*pDrawable */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*x */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*y */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*width */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*height */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int /*subWindowMode */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*CreateWindowProcPtr) (WindowPtr /*pWindow */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*DestroyWindowProcPtr) (WindowPtr /*pWindow */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*PositionWindowProcPtr) (WindowPtr /*pWindow */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*x */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*y */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*ChangeWindowAttributesProcPtr) (WindowPtr /*pWindow */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long /*mask */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*RealizeWindowProcPtr) (WindowPtr /*pWindow */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*UnrealizeWindowProcPtr) (WindowPtr /*pWindow */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*RestackWindowProcPtr) (WindowPtr /*pWindow */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*pOldNextSib */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef int (*ValidateTreeProcPtr) (WindowPtr /*pParent */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*pChild */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VTKind /*kind */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*pChild */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VTKind /*kind */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RegionPtr /*prgn */);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DDXPointRec /*ptOldOrg */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RegionPtr /*prgnSrc */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ClearToBackgroundProcPtr) (WindowPtr /*pWindow */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*x */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*y */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*w */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*h */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool /*generateExposures */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ClipNotifyProcPtr) (WindowPtr /*pWindow */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*dx */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*dy */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* pixmap will exist only for the duration of the current rendering operation */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define CREATE_PIXMAP_USAGE_SCRATCH 1
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* pixmap will be the backing pixmap for a redirected window */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* pixmap will contain a glyph */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* pixmap will be shared */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define CREATE_PIXMAP_USAGE_SHARED 4
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef PixmapPtr (*CreatePixmapProcPtr) (ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*width */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*height */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*depth */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned /*usage_hint */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*DestroyPixmapProcPtr) (PixmapPtr /*pPixmap */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*RealizeFontProcPtr) (ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync FontPtr /*pFont */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*UnrealizeFontProcPtr) (ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync FontPtr /*pFont */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ConstrainCursorProcPtr) (DeviceIntPtr /*pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BoxPtr /*pBox */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*CursorLimitsProcPtr) (DeviceIntPtr /* pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CursorPtr /*pCursor */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BoxPtr /*pHotBox */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BoxPtr /*pTopLeftBox */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*DisplayCursorProcPtr) (DeviceIntPtr /* pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CursorPtr /*pCursor */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*RealizeCursorProcPtr) (DeviceIntPtr /* pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CursorPtr /*pCursor */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*UnrealizeCursorProcPtr) (DeviceIntPtr /* pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CursorPtr /*pCursor */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*RecolorCursorProcPtr) (DeviceIntPtr /* pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CursorPtr /*pCursor */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool /*displayed */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*SetCursorPositionProcPtr) (DeviceIntPtr /* pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*x */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*y */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool /*generateEvent */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*DestroyColormapProcPtr) (ColormapPtr /*pColormap */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*InstallColormapProcPtr) (ColormapPtr /*pColormap */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*UninstallColormapProcPtr) (ColormapPtr /*pColormap */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef int (*ListInstalledColormapsProcPtr) (ScreenPtr /*pScreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync XID * /*pmaps */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*StoreColorsProcPtr) (ColormapPtr /*pColormap */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*ndef */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync xColorItem * /*pdef */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned short * /*pgreen */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned short * /*pblue */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VisualPtr /*pVisual */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *pTimeout,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *pReadmask);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long result,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *pReadMask);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*ModifyPixmapHeaderProcPtr) (PixmapPtr pPixmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int width,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int height,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int depth,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int bitsPerPixel,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int devKind,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *pPixData);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef PixmapPtr (*GetWindowPixmapProcPtr) (WindowPtr /*pWin */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*SetWindowPixmapProcPtr) (WindowPtr /*pWin */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr /*pPix */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef PixmapPtr (*GetScreenPixmapProcPtr) (ScreenPtr /*pScreen */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*SetScreenPixmapProcPtr) (PixmapPtr /*pPix */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*MarkWindowProcPtr) (WindowPtr /*pWin */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*MarkOverlappedWindowsProcPtr) (WindowPtr /*parent */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*firstChild */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr * /*pLayerWin */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef int (*ConfigNotifyProcPtr) (WindowPtr /*pWin */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*x */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*y */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*w */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*h */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*bw */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*pSib */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*MoveWindowProcPtr) (WindowPtr /*pWin */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*x */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*y */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*pSib */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VTKind /*kind */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ResizeWindowProcPtr) (WindowPtr /*pWin */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*x */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*y */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int /*w */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int /*h */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*pSib */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef WindowPtr (*GetLayerWindowProcPtr) (WindowPtr /*pWin */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*HandleExposuresProcPtr) (WindowPtr /*pWin */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ReparentWindowProcPtr) (WindowPtr /*pWin */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*pPriorParent */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*SetShapeProcPtr) (WindowPtr /*pWin */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /* kind */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ChangeBorderWidthProcPtr) (WindowPtr /*pWin */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int /*width */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*MarkUnrealizedWindowProcPtr) (WindowPtr /*pChild */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr /*pWin */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool /*fromConfigure */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*DeviceCursorInitializeProcPtr) (DeviceIntPtr /* pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /* pScreen */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr /* pScreen */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int *, int *);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int x, int y);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SpritePtr pSprite, int x, int y);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef int (*NameWindowPixmapProcPtr)(WindowPtr, PixmapPtr, CARD32);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* Wrapping Screen procedures
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync There are a few modules in the X server which dynamically add and
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync remove themselves from various screen procedure call chains.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync For example, the BlockHandler is dynamically modified by:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * xf86Rotate
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * miSprite
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * composite
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * render (for animated cursors)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Correctly manipulating this chain is complicated by the fact that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync the chain is constructed through a sequence of screen private
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync structures, each holding the next screen->proc pointer.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync To add a module to a screen->proc chain is fairly simple; just save
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync the current screen->proc value in the module screen private
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync and store the module's function in the screen->proc location.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Removing a screen proc is a bit trickier. It seems like all you
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync need to do is set the screen->proc pointer back to the value saved
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync in your screen private. However, if some other module has come
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync along and wrapped on top of you, then the right place to store the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync previous screen->proc value is actually in the wrapping module's
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync screen private structure(!). Of course, you have no idea what
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync other module may have wrapped on top, nor could you poke inside
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync its screen private in any case.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync To make this work, we restrict the unwrapping process to happen
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync during the invocation of the screen proc itself, and then we
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync require the screen proc to take some care when manipulating the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync screen proc functions pointers.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync The requirements are:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync 1) The screen proc must set the screen->proc pointer back to the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync value saved in its screen private before calling outside its
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync module.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync 2a) If the screen proc wants to be remove itself from the chain,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync it must not manipulate screen->proc pointer again before
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync returning.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync 2b) If the screen proc wants to remain in the chain, it must:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync 2b.1) Re-fetch the screen->proc pointer and store that in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync its screen private. This ensures that any changes
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync to the chain will be preserved.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync 2b.2) Set screen->proc back to itself
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync One key requirement here is that these steps must wrap not just
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync any invocation of the nested screen->proc value, but must nest
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync essentially any calls outside the current module. This ensures
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync that other modules can reliably manipulate screen->proc wrapping
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync using these same rules.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync For example, the animated cursor code in render has two macros,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Wrap and Unwrap.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync #define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Unwrap takes the screen private (as), the screen (s) and the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync member name (elt), and restores screen->proc to that saved in the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync screen private.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Wrap takes the screen private (as), the screen (s), the member
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync name (elt) and the wrapping function (func). It saves the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync current screen->proc value in the screen private, and then sets the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync screen->proc to the local wrapping function.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Within each of these functions, there's a pretty simple pattern:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Unwrap(as, pScreen, UnrealizeCursor);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync // Do local stuff, including possibly calling down through
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync // pScreen->UnrealizeCursor
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync The wrapping block handler is a bit different; it does the Unwrap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync the local operations and then only re-Wraps if the hook is still
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync required. Unwrap occurrs at the top of each function, just after
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync entry, and Wrap occurrs at the bottom of each function, just
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync before returning.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _Screen {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int myNum; /* index of this instance in Screens[] */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ATOM id;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short x, y, width, height;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short mmWidth, mmHeight;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short numDepths;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned char rootDepth;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DepthPtr allowedDepths;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long rootVisual;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long defColormap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short minInstalledCmaps, maxInstalledCmaps;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync char backingStoreSupport, saveUnderSupport;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned long whitePixel, blackPixel;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GCPtr GCperDepth[MAXFORMATS + 1];
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* next field is a stipple to use as default in
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync a GC. we don't build default tiles of all depths
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync because they are likely to be of a color
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync different from the default fg pixel, so
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync we don't win anything by building
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync a standard one.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr PixmapPerDepth[1];
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync void *devPrivate;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync short numVisuals;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync VisualPtr visuals;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowPtr root;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenSaverStuffRec screensaver;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DevPrivateSetRec screenSpecificPrivates[PRIVATE_LAST];
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Random screen procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CloseScreenProcPtr CloseScreen;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync QueryBestSizeProcPtr QueryBestSize;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SaveScreenProcPtr SaveScreen;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GetImageProcPtr GetImage;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GetSpansProcPtr GetSpans;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SourceValidateProcPtr SourceValidate;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Window Procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CreateWindowProcPtr CreateWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DestroyWindowProcPtr DestroyWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PositionWindowProcPtr PositionWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ChangeWindowAttributesProcPtr ChangeWindowAttributes;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RealizeWindowProcPtr RealizeWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync UnrealizeWindowProcPtr UnrealizeWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ValidateTreeProcPtr ValidateTree;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PostValidateTreeProcPtr PostValidateTree;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync WindowExposuresProcPtr WindowExposures;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CopyWindowProcPtr CopyWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ClearToBackgroundProcPtr ClearToBackground;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ClipNotifyProcPtr ClipNotify;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RestackWindowProcPtr RestackWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Pixmap procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CreatePixmapProcPtr CreatePixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DestroyPixmapProcPtr DestroyPixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Font procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RealizeFontProcPtr RealizeFont;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync UnrealizeFontProcPtr UnrealizeFont;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Cursor Procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ConstrainCursorProcPtr ConstrainCursor;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ConstrainCursorHarderProcPtr ConstrainCursorHarder;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CursorLimitsProcPtr CursorLimits;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DisplayCursorProcPtr DisplayCursor;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RealizeCursorProcPtr RealizeCursor;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync UnrealizeCursorProcPtr UnrealizeCursor;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RecolorCursorProcPtr RecolorCursor;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SetCursorPositionProcPtr SetCursorPosition;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* GC procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CreateGCProcPtr CreateGC;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Colormap procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CreateColormapProcPtr CreateColormap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DestroyColormapProcPtr DestroyColormap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync InstallColormapProcPtr InstallColormap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync UninstallColormapProcPtr UninstallColormap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ListInstalledColormapsProcPtr ListInstalledColormaps;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync StoreColorsProcPtr StoreColors;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ResolveColorProcPtr ResolveColor;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Region procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync BitmapToRegionProcPtr BitmapToRegion;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* os layer procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenBlockHandlerProcPtr BlockHandler;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenWakeupHandlerProcPtr WakeupHandler;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* anybody can get a piece of this array */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PrivateRec *devPrivates;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CreateScreenResourcesProcPtr CreateScreenResources;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GetWindowPixmapProcPtr GetWindowPixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SetWindowPixmapProcPtr SetWindowPixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GetScreenPixmapProcPtr GetScreenPixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SetScreenPixmapProcPtr SetScreenPixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync NameWindowPixmapProcPtr NameWindowPixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int totalPixmapSize;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync MarkWindowProcPtr MarkWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ConfigNotifyProcPtr ConfigNotify;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync MoveWindowProcPtr MoveWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ResizeWindowProcPtr ResizeWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync GetLayerWindowProcPtr GetLayerWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync HandleExposuresProcPtr HandleExposures;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ReparentWindowProcPtr ReparentWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SetShapeProcPtr SetShape;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ChangeBorderWidthProcPtr ChangeBorderWidth;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Device cursor procedures */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DeviceCursorInitializeProcPtr DeviceCursorInitialize;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync DeviceCursorCleanupProcPtr DeviceCursorCleanup;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* set it in driver side if X server can copy the framebuffer content.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Meant to be used together with '-background none' option, avoiding
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * malicious users to steal framebuffer's content if that would be the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * default */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool canDoBGNoneRoot;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync Bool isGPU;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct xorg_list unattached_list;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct xorg_list unattached_head;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr current_master;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct xorg_list output_slave_list;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct xorg_list output_head;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SharePixmapBackingProcPtr SharePixmapBacking;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync SetSharedPixmapBackingProcPtr SetSharedPixmapBacking;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync StartPixmapTrackingProcPtr StartPixmapTracking;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync StopPixmapTrackingProcPtr StopPixmapTracking;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct xorg_list pixmap_dirty_list;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct xorg_list offload_slave_list;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync struct xorg_list offload_head;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync XYToWindowProcPtr XYToWindow;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} ScreenRec;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncstatic inline RegionPtr
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncBitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync{
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync return (*(_pScreen)->BitmapToRegion) (pPix); /* no mi version?! */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync}
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _ScreenInfo {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int imageByteOrder;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int bitmapScanlineUnit;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int bitmapScanlinePad;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int bitmapBitOrder;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int numPixmapFormats;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapFormatRec formats[MAXFORMATS];
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int numScreens;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr screens[MAXSCREENS];
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int numGPUScreens;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr gpuscreens[MAXGPUSCREENS];
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int x; /* origin */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int y; /* origin */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int width; /* total width of all screens together */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int height; /* total height of all screens together */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} ScreenInfo;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT ScreenInfo screenInfo;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT void InitOutput(ScreenInfo * /*pScreenInfo */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int /*argc */ ,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync char ** /*argv */ );
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif /* SCREENINTSTRUCT_H */