65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * All Rights Reserved.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Permission is hereby granted, free of charge, to any person obtaining
65fea56f17cd614bc8908264df980a62e1931468vboxsync * a copy of this software and associated documentation files (the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * "Software"), to deal in the Software without restriction, including
65fea56f17cd614bc8908264df980a62e1931468vboxsync * without limitation on the rights to use, copy, modify, merge,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * publish, distribute, sublicense, and/or sell copies of the Software,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * and to permit persons to whom the Software is furnished to do so,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * subject to the following conditions:
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * The above copyright notice and this permission notice (including the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * next paragraph) shall be included in all copies or substantial
65fea56f17cd614bc8908264df980a62e1931468vboxsync * portions of the Software.
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
65fea56f17cd614bc8908264df980a62e1931468vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
65fea56f17cd614bc8908264df980a62e1931468vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
65fea56f17cd614bc8908264df980a62e1931468vboxsync * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
65fea56f17cd614bc8908264df980a62e1931468vboxsync * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
65fea56f17cd614bc8908264df980a62e1931468vboxsync * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
65fea56f17cd614bc8908264df980a62e1931468vboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65fea56f17cd614bc8908264df980a62e1931468vboxsync * SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Authors:
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Kevin E. Martin <kem@redhat.com>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * David H. Dawes <dawes@xfree86.org>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Rickard E. (Rik) Faith <faith@redhat.com>
65fea56f17cd614bc8908264df980a62e1931468vboxsync *
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** \file
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Main header file included by all other DMX-related files.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** \mainpage
65fea56f17cd614bc8908264df980a62e1931468vboxsync * - <a href="http://dmx.sourceforge.net">DMX Home Page</a>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * - <a href="http://sourceforge.net/projects/dmx">DMX Project Page (on
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Source Forge)</a>
65fea56f17cd614bc8908264df980a62e1931468vboxsync * - <a href="http://dmx.sourceforge.net/dmx.html">Distributed Multihead
65fea56f17cd614bc8908264df980a62e1931468vboxsync * X design</a>, the design document for DMX
65fea56f17cd614bc8908264df980a62e1931468vboxsync * - <a href="http://dmx.sourceforge.net/DMXSpec.txt">Client-to-Server
65fea56f17cd614bc8908264df980a62e1931468vboxsync * DMX Extension to the X Protocol</a>
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef DMX_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DMX_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if HAVE_DMX_CONFIG_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <dmx-config.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "gcstruct.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Handle client-side include files in one place. */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "dmxclient.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "globals.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "scrnintstr.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include "picturestr.h"
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef GLXEXT
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <GL/glx.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <GL/glxint.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef enum {
65fea56f17cd614bc8908264df980a62e1931468vboxsync PosNone = -1,
65fea56f17cd614bc8908264df980a62e1931468vboxsync PosAbsolute = 0,
65fea56f17cd614bc8908264df980a62e1931468vboxsync PosRightOf,
65fea56f17cd614bc8908264df980a62e1931468vboxsync PosLeftOf,
65fea56f17cd614bc8908264df980a62e1931468vboxsync PosAbove,
65fea56f17cd614bc8908264df980a62e1931468vboxsync PosBelow,
65fea56f17cd614bc8908264df980a62e1931468vboxsync PosRelative
65fea56f17cd614bc8908264df980a62e1931468vboxsync} PositionType;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** Provide the typedef globally, but keep the contents opaque outside
65fea56f17cd614bc8908264df980a62e1931468vboxsync * of the input routines. \see dmxinput.h */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _DMXInputInfo DMXInputInfo;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** Provide the typedef globally, but keep the contents opaque outside
65fea56f17cd614bc8908264df980a62e1931468vboxsync * of the XSync statistic routines. \see dmxstat.c */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _DMXStatInfo DMXStatInfo;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** Global structure containing information about each backend screen. */
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _DMXScreenInfo {
65fea56f17cd614bc8908264df980a62e1931468vboxsync const char *name; /**< Name from command line or config file */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int index; /**< Index into dmxScreens global */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*---------- Back-end X server information ----------*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync Display *beDisplay; /**< Back-end X server's display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beWidth; /**< Width of BE display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beHeight; /**< Height of BE display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beDepth; /**< Depth of BE display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beBPP; /**< Bits per pixel of BE display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beXDPI; /**< Horizontal dots per inch of BE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beYDPI; /**< Vertical dots per inch of BE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beNumDepths; /**< Number of depths on BE server */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int *beDepths; /**< Depths from BE server */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beNumPixmapFormats; /**< Number of pixmap formats on BE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync XPixmapFormatValues *bePixmapFormats; /**< Pixmap formats on BE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beNumVisuals; /**< Number of visuals on BE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync XVisualInfo *beVisuals; /**< Visuals from BE server */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beDefVisualIndex; /**< Default visual index of BE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync int beNumDefColormaps; /**< Number of default colormaps */
65fea56f17cd614bc8908264df980a62e1931468vboxsync Colormap *beDefColormaps; /**< Default colormaps for DMX server */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync Pixel beBlackPixel; /**< Default black pixel for BE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync Pixel beWhitePixel; /**< Default white pixel for BE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*---------- Screen window information ----------*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync Window scrnWin; /**< "Screen" window on backend display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int scrnX; /**< X offset of "screen" WRT BE display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int scrnY; /**< Y offset of "screen" WRT BE display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int scrnWidth; /**< Width of "screen" */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int scrnHeight; /**< Height of "screen" */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int scrnXSign; /**< X offset sign of "screen" */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int scrnYSign; /**< Y offset sign of "screen" */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /** Default drawables for "screen" */
65fea56f17cd614bc8908264df980a62e1931468vboxsync Drawable scrnDefDrawables[MAXFORMATS];
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync struct _DMXScreenInfo *next; /**< List of "screens" on same display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync struct _DMXScreenInfo *over; /**< List of "screens" that overlap */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*---------- Root window information ----------*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync Window rootWin; /**< "Root" window on backend display */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int rootX; /**< X offset of "root" window WRT "screen"*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync int rootY; /**< Y offset of "root" window WRT "screen"*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync int rootWidth; /**< Width of "root" window */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int rootHeight; /**< Height of "root" window */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync int rootXOrigin; /**< Global X origin of "root" window */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int rootYOrigin; /**< Global Y origin of "root" window */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*---------- Shadow framebuffer information ----------*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync void *shadow; /**< Shadow framebuffer data (if enabled) */
65fea56f17cd614bc8908264df980a62e1931468vboxsync XlibGC shadowGC; /**< Default GC used by shadow FB code */
65fea56f17cd614bc8908264df980a62e1931468vboxsync XImage *shadowFBImage; /**< Screen image used by shadow FB code */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /*---------- Other related information ----------*/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync int shared; /**< Non-zero if another Xdmx is running */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync Bool WMRunningOnBE;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync Cursor noCursor;
65fea56f17cd614bc8908264df980a62e1931468vboxsync Cursor curCursor;
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* Support for cursors on overlapped
65fea56f17cd614bc8908264df980a62e1931468vboxsync * backend displays. */
65fea56f17cd614bc8908264df980a62e1931468vboxsync CursorPtr cursor;
65fea56f17cd614bc8908264df980a62e1931468vboxsync int cursorVisible;
65fea56f17cd614bc8908264df980a62e1931468vboxsync int cursorNotShared; /* for overlapping screens on a backend */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync PositionType where; /**< Relative layout information */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int whereX; /**< Relative layout information */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int whereY; /**< Relative layout information */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int whereRefScreen; /**< Relative layout information */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync int savedTimeout; /**< Original screen saver timeout */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int dpmsCapable; /**< Non-zero if backend is DPMS capable */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int dpmsEnabled; /**< Non-zero if DPMS enabled */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int dpmsStandby; /**< Original DPMS standby value */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int dpmsSuspend; /**< Original DPMS suspend value */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int dpmsOff; /**< Original DPMS off value */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync DMXStatInfo *stat; /**< Statistics about XSync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync Bool needsSync; /**< True if an XSync is pending */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef GLXEXT
65fea56f17cd614bc8908264df980a62e1931468vboxsync /** Visual information for glxProxy */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int numGlxVisuals;
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXvisualConfig *glxVisuals;
65fea56f17cd614bc8908264df980a62e1931468vboxsync int glxMajorOpcode;
65fea56f17cd614bc8908264df980a62e1931468vboxsync int glxErrorBase;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /** FB config information for glxProxy */
65fea56f17cd614bc8908264df980a62e1931468vboxsync __GLXFBConfig *fbconfigs;
65fea56f17cd614bc8908264df980a62e1931468vboxsync int numFBConfigs;
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync /** Function pointers to wrapped screen
65fea56f17cd614bc8908264df980a62e1931468vboxsync * functions */
65fea56f17cd614bc8908264df980a62e1931468vboxsync CloseScreenProcPtr CloseScreen;
65fea56f17cd614bc8908264df980a62e1931468vboxsync SaveScreenProcPtr SaveScreen;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync CreateGCProcPtr CreateGC;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync CreateWindowProcPtr CreateWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync DestroyWindowProcPtr DestroyWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync PositionWindowProcPtr PositionWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync ChangeWindowAttributesProcPtr ChangeWindowAttributes;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RealizeWindowProcPtr RealizeWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync UnrealizeWindowProcPtr UnrealizeWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync RestackWindowProcPtr RestackWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync WindowExposuresProcPtr WindowExposures;
65fea56f17cd614bc8908264df980a62e1931468vboxsync CopyWindowProcPtr CopyWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync ResizeWindowProcPtr ResizeWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync ReparentWindowProcPtr ReparentWindow;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync ChangeBorderWidthProcPtr ChangeBorderWidth;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync GetImageProcPtr GetImage;
65fea56f17cd614bc8908264df980a62e1931468vboxsync GetSpansProcPtr GetSpans;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync CreatePixmapProcPtr CreatePixmap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync DestroyPixmapProcPtr DestroyPixmap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync BitmapToRegionProcPtr BitmapToRegion;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync RealizeFontProcPtr RealizeFont;
65fea56f17cd614bc8908264df980a62e1931468vboxsync UnrealizeFontProcPtr UnrealizeFont;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync CreateColormapProcPtr CreateColormap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync DestroyColormapProcPtr DestroyColormap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync InstallColormapProcPtr InstallColormap;
65fea56f17cd614bc8908264df980a62e1931468vboxsync StoreColorsProcPtr StoreColors;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync SetShapeProcPtr SetShape;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync CreatePictureProcPtr CreatePicture;
65fea56f17cd614bc8908264df980a62e1931468vboxsync DestroyPictureProcPtr DestroyPicture;
65fea56f17cd614bc8908264df980a62e1931468vboxsync ChangePictureClipProcPtr ChangePictureClip;
65fea56f17cd614bc8908264df980a62e1931468vboxsync DestroyPictureClipProcPtr DestroyPictureClip;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync ChangePictureProcPtr ChangePicture;
65fea56f17cd614bc8908264df980a62e1931468vboxsync ValidatePictureProcPtr ValidatePicture;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync CompositeProcPtr Composite;
65fea56f17cd614bc8908264df980a62e1931468vboxsync GlyphsProcPtr Glyphs;
65fea56f17cd614bc8908264df980a62e1931468vboxsync CompositeRectsProcPtr CompositeRects;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync InitIndexedProcPtr InitIndexed;
65fea56f17cd614bc8908264df980a62e1931468vboxsync CloseIndexedProcPtr CloseIndexed;
65fea56f17cd614bc8908264df980a62e1931468vboxsync UpdateIndexedProcPtr UpdateIndexed;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync TrapezoidsProcPtr Trapezoids;
65fea56f17cd614bc8908264df980a62e1931468vboxsync TrianglesProcPtr Triangles;
65fea56f17cd614bc8908264df980a62e1931468vboxsync} DMXScreenInfo;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Global variables available to all Xserver/hw/dmx routines. */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern int dmxNumScreens; /**< Number of dmxScreens */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern DMXScreenInfo *dmxScreens; /**< List of outputs */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern XErrorEvent dmxLastErrorEvent; /**< Last error that
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * occurred */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxErrorOccurred; /**< True if an error
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * occurred */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxOffScreenOpt; /**< True if using off
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * screen
65fea56f17cd614bc8908264df980a62e1931468vboxsync * optimizations */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxSubdividePrimitives; /**< True if using the
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * primitive subdivision
65fea56f17cd614bc8908264df980a62e1931468vboxsync * optimization */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxLazyWindowCreation; /**< True if using the
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * lazy window creation
65fea56f17cd614bc8908264df980a62e1931468vboxsync * optimization */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxUseXKB; /**< True if the XKB
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * extension should be
65fea56f17cd614bc8908264df980a62e1931468vboxsync * used with the backend
65fea56f17cd614bc8908264df980a62e1931468vboxsync * servers */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern int dmxDepth; /**< Requested depth if
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * non-zero */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef GLXEXT
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxGLXProxy; /**< True if glxProxy
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * support is enabled */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxGLXSwapGroupSupport; /**< True if glxProxy
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * support for swap
65fea56f17cd614bc8908264df980a62e1931468vboxsync * groups and barriers
65fea56f17cd614bc8908264df980a62e1931468vboxsync * is enabled */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxGLXSyncSwap; /**< True if glxProxy
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * should force an XSync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * request after each
65fea56f17cd614bc8908264df980a62e1931468vboxsync * swap buffers call */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxGLXFinishSwap; /**< True if glxProxy
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * should force a
65fea56f17cd614bc8908264df980a62e1931468vboxsync * glFinish request
65fea56f17cd614bc8908264df980a62e1931468vboxsync * after each swap
65fea56f17cd614bc8908264df980a62e1931468vboxsync * buffers call */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern char *dmxFontPath; /**< NULL if no font
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * path is set on the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * command line;
65fea56f17cd614bc8908264df980a62e1931468vboxsync * otherwise, a string
65fea56f17cd614bc8908264df980a62e1931468vboxsync * of comma separated
65fea56f17cd614bc8908264df980a62e1931468vboxsync * paths built from the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * command line
65fea56f17cd614bc8908264df980a62e1931468vboxsync * specified font
65fea56f17cd614bc8908264df980a62e1931468vboxsync * paths */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxIgnoreBadFontPaths; /**< True if bad font
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * paths should be
65fea56f17cd614bc8908264df980a62e1931468vboxsync * ignored during server
65fea56f17cd614bc8908264df980a62e1931468vboxsync * init */
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern Bool dmxAddRemoveScreens; /**< True if add and
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync * remove screens support
65fea56f17cd614bc8908264df980a62e1931468vboxsync * is enabled */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** Wrap screen or GC function pointer */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DMX_WRAP(_entry, _newfunc, _saved, _actual) \
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdo { \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (_saved)->_entry = (_actual)->_entry; \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (_actual)->_entry = (_newfunc); \
65fea56f17cd614bc8908264df980a62e1931468vboxsync} while (0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/** Unwrap screen or GC function pointer */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define DMX_UNWRAP(_entry, _saved, _actual) \
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdo { \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (_actual)->_entry = (_saved)->_entry; \
65fea56f17cd614bc8908264df980a62e1931468vboxsync} while (0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* Define the MAXSCREENSALLOC/FREE macros, when MAXSCREENS patch has not
65fea56f17cd614bc8908264df980a62e1931468vboxsync * been applied to sources. */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef MAXSCREENS
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREEN_MAKECONSTSTR1(x) #x
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREEN_MAKECONSTSTR2(x) MAXSCREEN_MAKECONSTSTR1(x)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREEN_FAILED_TXT "Failed at [" \
65fea56f17cd614bc8908264df980a62e1931468vboxsync MAXSCREEN_MAKECONSTSTR2(__LINE__) ":" __FILE__ "] to allocate object: "
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define _MAXSCREENSALLOCF(o,size,fatal) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync do { \
65fea56f17cd614bc8908264df980a62e1931468vboxsync if (!o) { \
65fea56f17cd614bc8908264df980a62e1931468vboxsync o = calloc((size), sizeof(*(o))); \
65fea56f17cd614bc8908264df980a62e1931468vboxsync if (!o && fatal) FatalError(MAXSCREEN_FAILED_TXT #o); \
65fea56f17cd614bc8908264df980a62e1931468vboxsync } \
65fea56f17cd614bc8908264df980a62e1931468vboxsync } while (0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define _MAXSCREENSALLOCR(o,size,retval) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync do { \
65fea56f17cd614bc8908264df980a62e1931468vboxsync if (!o) { \
65fea56f17cd614bc8908264df980a62e1931468vboxsync o = calloc((size), sizeof(*(o))); \
65fea56f17cd614bc8908264df980a62e1931468vboxsync if (!o) return retval; \
65fea56f17cd614bc8908264df980a62e1931468vboxsync } \
65fea56f17cd614bc8908264df980a62e1931468vboxsync } while (0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREENSFREE(o) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync do { \
65fea56f17cd614bc8908264df980a62e1931468vboxsync free(o); \
65fea56f17cd614bc8908264df980a62e1931468vboxsync o = NULL; \
65fea56f17cd614bc8908264df980a62e1931468vboxsync } while (0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREENSALLOC(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREENSALLOC_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 1)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREENSALLOC_RETURN(o,r) _MAXSCREENSALLOCR(o,MAXSCREENS, (r))
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREENSALLOCPLUSONE(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREENSALLOCPLUSONE_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,1)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREENSCALLOC(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),0)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define MAXSCREENSCALLOC_FATAL(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),1)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern DevPrivateKeyRec dmxGCPrivateKeyRec;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define dmxGCPrivateKey (&dmxGCPrivateKeyRec) /**< Private index for GCs */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern DevPrivateKeyRec dmxWinPrivateKeyRec;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define dmxWinPrivateKey (&dmxWinPrivateKeyRec) /**< Private index for Windows */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern DevPrivateKeyRec dmxPixPrivateKeyRec;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define dmxPixPrivateKey (&dmxPixPrivateKeyRec) /**< Private index for Pixmaps */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern int dmxFontPrivateIndex; /**< Private index for Fonts */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern DevPrivateKeyRec dmxScreenPrivateKeyRec;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define dmxScreenPrivateKey (&dmxScreenPrivateKeyRec) /**< Private index for Screens */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern DevPrivateKeyRec dmxColormapPrivateKeyRec;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define dmxColormapPrivateKey (&dmxColormapPrivateKeyRec) /**< Private index for Colormaps */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern DevPrivateKeyRec dmxPictPrivateKeyRec;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define dmxPictPrivateKey (&dmxPictPrivateKeyRec) /**< Private index for Picts */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec;
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec) /**< Private index for GlyphSets */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncvoid DMXExtensionInit(void);
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* DMX_H */