VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.3.0.0/dmx.h@ 41244

Last change on this file since 41244 was 25078, checked in by vboxsync, 15 years ago

Additions/x11/x11include: exported and set eol-style on new headers

  • Property svn:eol-style set to native
File size: 15.3 KB
Line 
1/* $XFree86$ */
2/*
3 * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina.
4 *
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation on the rights to use, copy, modify, merge,
11 * publish, distribute, sublicense, and/or sell copies of the Software,
12 * and to permit persons to whom the Software is furnished to do so,
13 * subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial
17 * portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
23 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
24 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * SOFTWARE.
27 */
28
29/*
30 * Authors:
31 * Kevin E. Martin <[email protected]>
32 * David H. Dawes <[email protected]>
33 * Rickard E. (Rik) Faith <[email protected]>
34 *
35 */
36
37/** \file
38 * Main header file included by all other DMX-related files.
39 */
40
41/** \mainpage
42 * - <a href="http://dmx.sourceforge.net">DMX Home Page</a>
43 * - <a href="http://sourceforge.net/projects/dmx">DMX Project Page (on
44 * Source Forge)</a>
45 * - <a href="http://dmx.sourceforge.net/dmx.html">Distributed Multihead
46 * X design</a>, the design document for DMX
47 * - <a href="http://dmx.sourceforge.net/DMXSpec.txt">Client-to-Server
48 * DMX Extension to the X Protocol</a>
49 */
50
51#ifndef DMX_H
52#define DMX_H
53
54#if HAVE_DMX_CONFIG_H
55#include <dmx-config.h>
56#endif
57
58#include "gcstruct.h"
59
60/* Handle client-side include files in one place. */
61#include "dmxclient.h"
62
63#include "globals.h"
64#include "scrnintstr.h"
65
66#ifdef RENDER
67#include "picturestr.h"
68#endif
69
70#ifdef GLXEXT
71#include <GL/glx.h>
72#include <GL/glxint.h>
73#endif
74
75typedef enum {
76 PosNone = -1,
77 PosAbsolute = 0,
78 PosRightOf,
79 PosLeftOf,
80 PosAbove,
81 PosBelow,
82 PosRelative
83} PositionType;
84
85/** Provide the typedef globally, but keep the contents opaque outside
86 * of the input routines. \see dmxinput.h */
87typedef struct _DMXInputInfo DMXInputInfo;
88
89/** Provide the typedef globally, but keep the contents opaque outside
90 * of the XSync statistic routines. \see dmxstat.c */
91typedef struct _DMXStatInfo DMXStatInfo;
92
93/** Global structure containing information about each backend screen. */
94typedef struct _DMXScreenInfo {
95 const char *name; /**< Name from command line or config file */
96 int index; /**< Index into dmxScreens global */
97
98 /*---------- Back-end X server information ----------*/
99
100 Display *beDisplay; /**< Back-end X server's display */
101 int beWidth; /**< Width of BE display */
102 int beHeight; /**< Height of BE display */
103 int beDepth; /**< Depth of BE display */
104 int beBPP; /**< Bits per pixel of BE display */
105 int beXDPI; /**< Horizontal dots per inch of BE */
106 int beYDPI; /**< Vertical dots per inch of BE */
107
108 int beNumDepths; /**< Number of depths on BE server */
109 int *beDepths; /**< Depths from BE server */
110
111 int beNumPixmapFormats; /**< Number of pixmap formats on BE */
112 XPixmapFormatValues *bePixmapFormats; /**< Pixmap formats on BE */
113
114 int beNumVisuals; /**< Number of visuals on BE */
115 XVisualInfo *beVisuals; /**< Visuals from BE server */
116 int beDefVisualIndex; /**< Default visual index of BE */
117
118 int beNumDefColormaps; /**< Number of default colormaps */
119 Colormap *beDefColormaps; /**< Default colormaps for DMX server */
120
121 Pixel beBlackPixel; /**< Default black pixel for BE */
122 Pixel beWhitePixel; /**< Default white pixel for BE */
123
124 /*---------- Screen window information ----------*/
125
126 Window scrnWin; /**< "Screen" window on backend display */
127 int scrnX; /**< X offset of "screen" WRT BE display */
128 int scrnY; /**< Y offset of "screen" WRT BE display */
129 int scrnWidth; /**< Width of "screen" */
130 int scrnHeight; /**< Height of "screen" */
131 int scrnXSign; /**< X offset sign of "screen" */
132 int scrnYSign; /**< Y offset sign of "screen" */
133
134 /** Default drawables for "screen" */
135 Drawable scrnDefDrawables[MAXFORMATS];
136
137 struct _DMXScreenInfo *next; /**< List of "screens" on same display */
138 struct _DMXScreenInfo *over; /**< List of "screens" that overlap */
139
140 /*---------- Root window information ----------*/
141
142 Window rootWin; /**< "Root" window on backend display */
143 int rootX; /**< X offset of "root" window WRT "screen"*/
144 int rootY; /**< Y offset of "root" window WRT "screen"*/
145 int rootWidth; /**< Width of "root" window */
146 int rootHeight; /**< Height of "root" window */
147
148 int rootXOrigin; /**< Global X origin of "root" window */
149 int rootYOrigin; /**< Global Y origin of "root" window */
150
151 /*---------- Shadow framebuffer information ----------*/
152
153 void *shadow; /**< Shadow framebuffer data (if enabled) */
154 XlibGC shadowGC; /**< Default GC used by shadow FB code */
155 XImage *shadowFBImage; /**< Screen image used by shadow FB code */
156
157 /*---------- Other related information ----------*/
158
159 int shared; /**< Non-zero if another Xdmx is running */
160
161 Bool WMRunningOnBE;
162
163 Cursor noCursor;
164 Cursor curCursor;
165 /* Support for cursors on overlapped
166 * backend displays. */
167 CursorPtr cursor;
168 int cursorVisible;
169 int cursorNotShared; /* for overlapping screens on a backend */
170
171 PositionType where; /**< Relative layout information */
172 int whereX; /**< Relative layout information */
173 int whereY; /**< Relative layout information */
174 int whereRefScreen; /**< Relative layout information */
175
176 int savedTimeout; /**< Original screen saver timeout */
177 int dpmsCapable; /**< Non-zero if backend is DPMS capable */
178 int dpmsEnabled; /**< Non-zero if DPMS enabled */
179 int dpmsStandby; /**< Original DPMS standby value */
180 int dpmsSuspend; /**< Original DPMS suspend value */
181 int dpmsOff; /**< Original DPMS off value */
182
183 DMXStatInfo *stat; /**< Statistics about XSync */
184 Bool needsSync; /**< True if an XSync is pending */
185
186#ifdef GLXEXT
187 /** Visual information for glxProxy */
188 int numGlxVisuals;
189 __GLXvisualConfig *glxVisuals;
190 int glxMajorOpcode;
191 int glxErrorBase;
192
193 /** FB config information for glxProxy */
194 __GLXFBConfig *fbconfigs;
195 int numFBConfigs;
196#endif
197
198 /** Function pointers to wrapped screen
199 * functions */
200 CloseScreenProcPtr CloseScreen;
201 SaveScreenProcPtr SaveScreen;
202
203 CreateGCProcPtr CreateGC;
204
205 CreateWindowProcPtr CreateWindow;
206 DestroyWindowProcPtr DestroyWindow;
207 PositionWindowProcPtr PositionWindow;
208 ChangeWindowAttributesProcPtr ChangeWindowAttributes;
209 RealizeWindowProcPtr RealizeWindow;
210 UnrealizeWindowProcPtr UnrealizeWindow;
211 RestackWindowProcPtr RestackWindow;
212 WindowExposuresProcPtr WindowExposures;
213 PaintWindowBackgroundProcPtr PaintWindowBackground;
214 PaintWindowBorderProcPtr PaintWindowBorder;
215 CopyWindowProcPtr CopyWindow;
216
217 ResizeWindowProcPtr ResizeWindow;
218 ReparentWindowProcPtr ReparentWindow;
219
220 ChangeBorderWidthProcPtr ChangeBorderWidth;
221
222 GetImageProcPtr GetImage;
223 GetSpansProcPtr GetSpans;
224
225 CreatePixmapProcPtr CreatePixmap;
226 DestroyPixmapProcPtr DestroyPixmap;
227 BitmapToRegionProcPtr BitmapToRegion;
228
229 RealizeFontProcPtr RealizeFont;
230 UnrealizeFontProcPtr UnrealizeFont;
231
232 CreateColormapProcPtr CreateColormap;
233 DestroyColormapProcPtr DestroyColormap;
234 InstallColormapProcPtr InstallColormap;
235 StoreColorsProcPtr StoreColors;
236
237#ifdef SHAPE
238 SetShapeProcPtr SetShape;
239#endif
240
241#ifdef RENDER
242 CreatePictureProcPtr CreatePicture;
243 DestroyPictureProcPtr DestroyPicture;
244 ChangePictureClipProcPtr ChangePictureClip;
245 DestroyPictureClipProcPtr DestroyPictureClip;
246
247 ChangePictureProcPtr ChangePicture;
248 ValidatePictureProcPtr ValidatePicture;
249
250 CompositeProcPtr Composite;
251 GlyphsProcPtr Glyphs;
252 CompositeRectsProcPtr CompositeRects;
253
254 InitIndexedProcPtr InitIndexed;
255 CloseIndexedProcPtr CloseIndexed;
256 UpdateIndexedProcPtr UpdateIndexed;
257
258 TrapezoidsProcPtr Trapezoids;
259 TrianglesProcPtr Triangles;
260 TriStripProcPtr TriStrip;
261 TriFanProcPtr TriFan;
262#endif
263} DMXScreenInfo;
264
265/* Global variables available to all Xserver/hw/dmx routines. */
266extern int dmxNumScreens; /**< Number of dmxScreens */
267extern DMXScreenInfo *dmxScreens; /**< List of outputs */
268extern int dmxShadowFB; /**< Non-zero if using
269 * shadow frame-buffer
270 * (deprecated) */
271extern XErrorEvent dmxLastErrorEvent; /**< Last error that
272 * occurred */
273extern Bool dmxErrorOccurred; /**< True if an error
274 * occurred */
275extern Bool dmxOffScreenOpt; /**< True if using off
276 * screen
277 * optimizations */
278extern Bool dmxSubdividePrimitives; /**< True if using the
279 * primitive subdivision
280 * optimization */
281extern Bool dmxLazyWindowCreation; /**< True if using the
282 * lazy window creation
283 * optimization */
284extern Bool dmxUseXKB; /**< True if the XKB
285 * extension should be
286 * used with the backend
287 * servers */
288extern int dmxDepth; /**< Requested depth if
289 * non-zero */
290#ifdef GLXEXT
291extern Bool dmxGLXProxy; /**< True if glxProxy
292 * support is enabled */
293extern Bool dmxGLXSwapGroupSupport; /**< True if glxProxy
294 * support for swap
295 * groups and barriers
296 * is enabled */
297extern Bool dmxGLXSyncSwap; /**< True if glxProxy
298 * should force an XSync
299 * request after each
300 * swap buffers call */
301extern Bool dmxGLXFinishSwap; /**< True if glxProxy
302 * should force a
303 * glFinish request
304 * after each swap
305 * buffers call */
306#endif
307extern char *dmxFontPath; /**< NULL if no font
308 * path is set on the
309 * command line;
310 * otherwise, a string
311 * of comma separated
312 * paths built from the
313 * command line
314 * specified font
315 * paths */
316extern Bool dmxIgnoreBadFontPaths; /**< True if bad font
317 * paths should be
318 * ignored during server
319 * init */
320extern Bool dmxAddRemoveScreens; /**< True if add and
321 * remove screens support
322 * is enabled */
323
324/** Wrap screen or GC function pointer */
325#define DMX_WRAP(_entry, _newfunc, _saved, _actual) \
326do { \
327 (_saved)->_entry = (_actual)->_entry; \
328 (_actual)->_entry = (_newfunc); \
329} while (0)
330
331/** Unwrap screen or GC function pointer */
332#define DMX_UNWRAP(_entry, _saved, _actual) \
333do { \
334 (_actual)->_entry = (_saved)->_entry; \
335} while (0)
336
337/* Define the MAXSCREENSALLOC/FREE macros, when MAXSCREENS patch has not
338 * been applied to sources. */
339#ifdef MAXSCREENS
340#define MAXSCREEN_MAKECONSTSTR1(x) #x
341#define MAXSCREEN_MAKECONSTSTR2(x) MAXSCREEN_MAKECONSTSTR1(x)
342
343#define MAXSCREEN_FAILED_TXT "Failed at [" \
344 MAXSCREEN_MAKECONSTSTR2(__LINE__) ":" __FILE__ "] to allocate object: "
345
346#define _MAXSCREENSALLOCF(o,size,fatal) \
347 do { \
348 if (!o) { \
349 o = xalloc((size) * sizeof(*(o))); \
350 if (o) memset(o, 0, (size) * sizeof(*(o))); \
351 if (!o && fatal) FatalError(MAXSCREEN_FAILED_TXT #o); \
352 } \
353 } while (0)
354#define _MAXSCREENSALLOCR(o,size,retval) \
355 do { \
356 if (!o) { \
357 o = xalloc((size) * sizeof(*(o))); \
358 if (o) memset(o, 0, (size) * sizeof(*(o))); \
359 if (!o) return retval; \
360 } \
361 } while (0)
362
363#define MAXSCREENSFREE(o) \
364 do { \
365 if (o) xfree(o); \
366 o = NULL; \
367 } while (0)
368
369#define MAXSCREENSALLOC(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 0)
370#define MAXSCREENSALLOC_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 1)
371#define MAXSCREENSALLOC_RETURN(o,r) _MAXSCREENSALLOCR(o,MAXSCREENS, (r))
372#define MAXSCREENSALLOCPLUSONE(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,0)
373#define MAXSCREENSALLOCPLUSONE_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,1)
374#define MAXSCREENSCALLOC(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),0)
375#define MAXSCREENSCALLOC_FATAL(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),1)
376#endif
377
378#endif /* DMX_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette