b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XFree86$ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * All Rights Reserved.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Permission is hereby granted, free of charge, to any person obtaining
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * a copy of this software and associated documentation files (the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * "Software"), to deal in the Software without restriction, including
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * without limitation on the rights to use, copy, modify, merge,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * publish, distribute, sublicense, and/or sell copies of the Software,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * and to permit persons to whom the Software is furnished to do so,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * subject to the following conditions:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * The above copyright notice and this permission notice (including the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * next paragraph) shall be included in all copies or substantial
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * portions of the Software.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * SOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Kevin E. Martin <kem@redhat.com>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * David H. Dawes <dawes@xfree86.org>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Rickard E. (Rik) Faith <faith@redhat.com>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Main header file included by all other DMX-related files.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** \mainpage
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * - <a href="http://dmx.sourceforge.net">DMX Home Page</a>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * - <a href="http://sourceforge.net/projects/dmx">DMX Project Page (on
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Source Forge)</a>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * - <a href="http://dmx.sourceforge.net/dmx.html">Distributed Multihead
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * X design</a>, the design document for DMX
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * - <a href="http://dmx.sourceforge.net/DMXSpec.txt">Client-to-Server
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * DMX Extension to the X Protocol</a>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* Handle client-side include files in one place. */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef enum {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** Provide the typedef globally, but keep the contents opaque outside
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * of the input routines. \see dmxinput.h */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** Provide the typedef globally, but keep the contents opaque outside
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * of the XSync statistic routines. \see dmxstat.c */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** Global structure containing information about each backend screen. */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _DMXScreenInfo {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync const char *name; /**< Name from command line or config file */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*---------- Back-end X server information ----------*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Display *beDisplay; /**< Back-end X server's display */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int beNumDepths; /**< Number of depths on BE server */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int beNumPixmapFormats; /**< Number of pixmap formats on BE */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XPixmapFormatValues *bePixmapFormats; /**< Pixmap formats on BE */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XVisualInfo *beVisuals; /**< Visuals from BE server */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int beDefVisualIndex; /**< Default visual index of BE */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int beNumDefColormaps; /**< Number of default colormaps */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Colormap *beDefColormaps; /**< Default colormaps for DMX server */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel beBlackPixel; /**< Default black pixel for BE */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel beWhitePixel; /**< Default white pixel for BE */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*---------- Screen window information ----------*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Window scrnWin; /**< "Screen" window on backend display */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int scrnX; /**< X offset of "screen" WRT BE display */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int scrnY; /**< Y offset of "screen" WRT BE display */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** Default drawables for "screen" */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync struct _DMXScreenInfo *next; /**< List of "screens" on same display */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync struct _DMXScreenInfo *over; /**< List of "screens" that overlap */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*---------- Root window information ----------*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Window rootWin; /**< "Root" window on backend display */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int rootX; /**< X offset of "root" window WRT "screen"*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int rootY; /**< Y offset of "root" window WRT "screen"*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int rootXOrigin; /**< Global X origin of "root" window */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int rootYOrigin; /**< Global Y origin of "root" window */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*---------- Shadow framebuffer information ----------*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync void *shadow; /**< Shadow framebuffer data (if enabled) */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XlibGC shadowGC; /**< Default GC used by shadow FB code */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XImage *shadowFBImage; /**< Screen image used by shadow FB code */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /*---------- Other related information ----------*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int shared; /**< Non-zero if another Xdmx is running */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /* Support for cursors on overlapped
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * backend displays. */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int cursorNotShared; /* for overlapping screens on a backend */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PositionType where; /**< Relative layout information */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int whereRefScreen; /**< Relative layout information */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int savedTimeout; /**< Original screen saver timeout */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int dpmsCapable; /**< Non-zero if backend is DPMS capable */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int dpmsStandby; /**< Original DPMS standby value */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int dpmsSuspend; /**< Original DPMS suspend value */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool needsSync; /**< True if an XSync is pending */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** Visual information for glxProxy */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** FB config information for glxProxy */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /** Function pointers to wrapped screen
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * functions */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ChangeWindowAttributesProcPtr ChangeWindowAttributes;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync PaintWindowBackgroundProcPtr PaintWindowBackground;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* Global variables available to all Xserver/hw/dmx routines. */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int dmxNumScreens; /**< Number of dmxScreens */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern DMXScreenInfo *dmxScreens; /**< List of outputs */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * shadow frame-buffer
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * (deprecated) */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern XErrorEvent dmxLastErrorEvent; /**< Last error that
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * occurred */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * occurred */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * optimizations */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern Bool dmxSubdividePrimitives; /**< True if using the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * primitive subdivision
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * optimization */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern Bool dmxLazyWindowCreation; /**< True if using the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * lazy window creation
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * optimization */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * extension should be
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * used with the backend
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * servers */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * non-zero */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * support is enabled */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern Bool dmxGLXSwapGroupSupport; /**< True if glxProxy
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * support for swap
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * groups and barriers
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * is enabled */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * should force an XSync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * request after each
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * swap buffers call */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * should force a
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * glFinish request
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * after each swap
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * buffers call */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * path is set on the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * command line;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * otherwise, a string
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * of comma separated
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * paths built from the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * command line
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * specified font
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern Bool dmxIgnoreBadFontPaths; /**< True if bad font
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * paths should be
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * ignored during server
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern Bool dmxAddRemoveScreens; /**< True if add and
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * remove screens support
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * is enabled */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** Wrap screen or GC function pointer */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DMX_WRAP(_entry, _newfunc, _saved, _actual) \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/** Unwrap screen or GC function pointer */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* Define the MAXSCREENSALLOC/FREE macros, when MAXSCREENS patch has not
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * been applied to sources. */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define MAXSCREEN_MAKECONSTSTR2(x) MAXSCREEN_MAKECONSTSTR1(x)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync MAXSCREEN_MAKECONSTSTR2(__LINE__) ":" __FILE__ "] to allocate object: "
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync if (!o) { \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync if (!o && fatal) FatalError(MAXSCREEN_FAILED_TXT #o); \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync } while (0)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync if (!o) { \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync if (!o) return retval; \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync } while (0)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync if (o) xfree(o); \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync } while (0)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define MAXSCREENSALLOC(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 0)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define MAXSCREENSALLOC_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 1)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define MAXSCREENSALLOC_RETURN(o,r) _MAXSCREENSALLOCR(o,MAXSCREENS, (r))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define MAXSCREENSALLOCPLUSONE(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,0)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define MAXSCREENSALLOCPLUSONE_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,1)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define MAXSCREENSCALLOC(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),0)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define MAXSCREENSCALLOC_FATAL(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),1)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#endif /* DMX_H */