Distributed Multihead X  1.16.4
dmx.h
Go to the documentation of this file.
1 /*
2  * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina.
3  *
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation on the rights to use, copy, modify, merge,
10  * publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so,
12  * subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the
15  * next paragraph) shall be included in all copies or substantial
16  * portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  */
27 
28 /*
29  * Authors:
30  * Kevin E. Martin <kem@redhat.com>
31  * David H. Dawes <dawes@xfree86.org>
32  * Rickard E. (Rik) Faith <faith@redhat.com>
33  *
34  */
35 
50 #ifndef DMX_H
51 #define DMX_H
52 
53 #if HAVE_DMX_CONFIG_H
54 #include <dmx-config.h>
55 #endif
56 
57 #include "gcstruct.h"
58 
59 /* Handle client-side include files in one place. */
60 #include "dmxclient.h"
61 
62 #include "globals.h"
63 #include "scrnintstr.h"
64 
65 #include "picturestr.h"
66 
67 #ifdef GLXEXT
68 #include <GL/glx.h>
69 #include <GL/glxint.h>
70 #endif
71 
72 typedef enum {
73  PosNone = -1,
80 } PositionType;
81 
84 typedef struct _DMXInputInfo DMXInputInfo;
85 
88 typedef struct _DMXStatInfo DMXStatInfo;
89 
91 typedef struct _DMXScreenInfo {
92  const char *name;
93  int index;
95  /*---------- Back-end X server information ----------*/
96 
97  Display *beDisplay;
98  int beWidth;
99  int beHeight;
100  int beDepth;
101  int beBPP;
102  int beXDPI;
103  int beYDPI;
106  int *beDepths;
109  XPixmapFormatValues *bePixmapFormats;
112  XVisualInfo *beVisuals;
116  Colormap *beDefColormaps;
118  Pixel beBlackPixel;
119  Pixel beWhitePixel;
121  /*---------- Screen window information ----------*/
122 
123  Window scrnWin;
124  int scrnX;
125  int scrnY;
126  int scrnWidth;
128  int scrnXSign;
129  int scrnYSign;
132  Drawable scrnDefDrawables[MAXFORMATS];
133 
137  /*---------- Root window information ----------*/
138 
139  Window rootWin;
140  int rootX;
141  int rootY;
142  int rootWidth;
148  /*---------- Shadow framebuffer information ----------*/
149 
150  void *shadow;
151  XlibGC shadowGC;
152  XImage *shadowFBImage;
154  /*---------- Other related information ----------*/
155 
156  int shared;
159 
160  Cursor noCursor;
161  Cursor curCursor;
162  /* Support for cursors on overlapped
163  * backend displays. */
164  CursorPtr cursor;
166  int cursorNotShared; /* for overlapping screens on a backend */
167 
169  int whereX;
170  int whereY;
178  int dpmsOff;
181  Bool needsSync;
183 #ifdef GLXEXT
184 
185  int numGlxVisuals;
186  __GLXvisualConfig *glxVisuals;
187  int glxMajorOpcode;
188  int glxErrorBase;
189 
191  __GLXFBConfig *fbconfigs;
192  int numFBConfigs;
193 #endif
194 
197  CloseScreenProcPtr CloseScreen;
198  SaveScreenProcPtr SaveScreen;
199 
200  CreateGCProcPtr CreateGC;
201 
202  CreateWindowProcPtr CreateWindow;
203  DestroyWindowProcPtr DestroyWindow;
204  PositionWindowProcPtr PositionWindow;
205  ChangeWindowAttributesProcPtr ChangeWindowAttributes;
206  RealizeWindowProcPtr RealizeWindow;
207  UnrealizeWindowProcPtr UnrealizeWindow;
208  RestackWindowProcPtr RestackWindow;
209  WindowExposuresProcPtr WindowExposures;
210  CopyWindowProcPtr CopyWindow;
211 
212  ResizeWindowProcPtr ResizeWindow;
213  ReparentWindowProcPtr ReparentWindow;
214 
215  ChangeBorderWidthProcPtr ChangeBorderWidth;
216 
217  GetImageProcPtr GetImage;
218  GetSpansProcPtr GetSpans;
219 
220  CreatePixmapProcPtr CreatePixmap;
221  DestroyPixmapProcPtr DestroyPixmap;
222  BitmapToRegionProcPtr BitmapToRegion;
223 
224  RealizeFontProcPtr RealizeFont;
225  UnrealizeFontProcPtr UnrealizeFont;
226 
227  CreateColormapProcPtr CreateColormap;
228  DestroyColormapProcPtr DestroyColormap;
229  InstallColormapProcPtr InstallColormap;
230  StoreColorsProcPtr StoreColors;
231 
232  SetShapeProcPtr SetShape;
233 
234  CreatePictureProcPtr CreatePicture;
235  DestroyPictureProcPtr DestroyPicture;
236  ChangePictureClipProcPtr ChangePictureClip;
237  DestroyPictureClipProcPtr DestroyPictureClip;
238 
239  ChangePictureProcPtr ChangePicture;
240  ValidatePictureProcPtr ValidatePicture;
241 
242  CompositeProcPtr Composite;
243  GlyphsProcPtr Glyphs;
244  CompositeRectsProcPtr CompositeRects;
245 
246  InitIndexedProcPtr InitIndexed;
247  CloseIndexedProcPtr CloseIndexed;
248  UpdateIndexedProcPtr UpdateIndexed;
249 
250  TrapezoidsProcPtr Trapezoids;
251  TrianglesProcPtr Triangles;
252 } DMXScreenInfo;
253 
254 /* Global variables available to all Xserver/hw/dmx routines. */
255 extern int dmxNumScreens;
256 extern DMXScreenInfo *dmxScreens;
257 extern XErrorEvent dmxLastErrorEvent;
260 extern Bool dmxErrorOccurred;
263 extern Bool dmxOffScreenOpt;
267 extern Bool dmxSubdividePrimitives;
271 extern Bool dmxLazyWindowCreation;
275 extern Bool dmxUseXKB;
280 extern int dmxDepth;
283 #ifdef GLXEXT
284 extern Bool dmxGLXProxy;
287 extern Bool dmxGLXSwapGroupSupport;
292 extern Bool dmxGLXSyncSwap;
297 extern Bool dmxGLXFinishSwap;
303 #endif
304 extern char *dmxFontPath;
314 extern Bool dmxIgnoreBadFontPaths;
319 extern Bool dmxAddRemoveScreens;
325 #define DMX_WRAP(_entry, _newfunc, _saved, _actual) \
326 do { \
327  (_saved)->_entry = (_actual)->_entry; \
328  (_actual)->_entry = (_newfunc); \
329 } while (0)
330 
332 #define DMX_UNWRAP(_entry, _saved, _actual) \
333 do { \
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 = calloc((size), sizeof(*(o))); \
350  if (!o && fatal) FatalError(MAXSCREEN_FAILED_TXT #o); \
351  } \
352  } while (0)
353 #define _MAXSCREENSALLOCR(o,size,retval) \
354  do { \
355  if (!o) { \
356  o = calloc((size), sizeof(*(o))); \
357  if (!o) return retval; \
358  } \
359  } while (0)
360 
361 #define MAXSCREENSFREE(o) \
362  do { \
363  free(o); \
364  o = NULL; \
365  } while (0)
366 
367 #define MAXSCREENSALLOC(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 0)
368 #define MAXSCREENSALLOC_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 1)
369 #define MAXSCREENSALLOC_RETURN(o,r) _MAXSCREENSALLOCR(o,MAXSCREENS, (r))
370 #define MAXSCREENSALLOCPLUSONE(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,0)
371 #define MAXSCREENSALLOCPLUSONE_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,1)
372 #define MAXSCREENSCALLOC(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),0)
373 #define MAXSCREENSCALLOC_FATAL(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),1)
374 #endif
375 
376 extern DevPrivateKeyRec dmxGCPrivateKeyRec;
377 
378 #define dmxGCPrivateKey (&dmxGCPrivateKeyRec)
380 extern DevPrivateKeyRec dmxWinPrivateKeyRec;
381 
382 #define dmxWinPrivateKey (&dmxWinPrivateKeyRec)
384 extern DevPrivateKeyRec dmxPixPrivateKeyRec;
385 
386 #define dmxPixPrivateKey (&dmxPixPrivateKeyRec)
388 extern int dmxFontPrivateIndex;
390 extern DevPrivateKeyRec dmxScreenPrivateKeyRec;
391 
392 #define dmxScreenPrivateKey (&dmxScreenPrivateKeyRec)
394 extern DevPrivateKeyRec dmxColormapPrivateKeyRec;
395 
396 #define dmxColormapPrivateKey (&dmxColormapPrivateKeyRec)
398 extern DevPrivateKeyRec dmxPictPrivateKeyRec;
399 
400 #define dmxPictPrivateKey (&dmxPictPrivateKeyRec)
402 extern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec;
403 
404 #define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec)
406 void DMXExtensionInit(void);
407 
408 #endif /* DMX_H */
int scrnY
Definition: dmx.h:125
Bool dmxSubdividePrimitives
Definition: dmxinit.c:92
int dpmsOff
Definition: dmx.h:178
CreateColormapProcPtr CreateColormap
Definition: dmx.h:227
Definition: dmx.h:79
GetSpansProcPtr GetSpans
Definition: dmx.h:218
int index
Definition: dmx.h:93
UnrealizeFontProcPtr UnrealizeFont
Definition: dmx.h:225
ResizeWindowProcPtr ResizeWindow
Definition: dmx.h:212
int whereRefScreen
Definition: dmx.h:171
int rootYOrigin
Definition: dmx.h:146
int dpmsStandby
Definition: dmx.h:176
ReparentWindowProcPtr ReparentWindow
Definition: dmx.h:213
DMXStatInfo * stat
Definition: dmx.h:180
Definition: dmxinput.h:84
Definition: dmx.h:76
struct _DMXScreenInfo * next
Definition: dmx.h:134
ChangeBorderWidthProcPtr ChangeBorderWidth
Definition: dmx.h:215
PositionWindowProcPtr PositionWindow
Definition: dmx.h:204
Definition: dmx.h:78
int rootY
Definition: dmx.h:141
RealizeFontProcPtr RealizeFont
Definition: dmx.h:224
CreateGCProcPtr CreateGC
Definition: dmx.h:200
ChangeWindowAttributesProcPtr ChangeWindowAttributes
Definition: dmx.h:205
CreatePixmapProcPtr CreatePixmap
Definition: dmx.h:220
InitIndexedProcPtr InitIndexed
Definition: dmx.h:246
static Bool dmxGLXProxy
Definition: dmxinit.c:101
XlibGC shadowGC
Definition: dmx.h:151
CloseIndexedProcPtr CloseIndexed
Definition: dmx.h:247
struct _DMXScreenInfo * over
Definition: dmx.h:135
PositionType
Definition: dmx.h:72
int beNumVisuals
Definition: dmx.h:111
XErrorEvent dmxLastErrorEvent
Definition: dmxinit.c:85
CreatePictureProcPtr CreatePicture
Definition: dmx.h:234
CursorPtr cursor
Definition: dmx.h:164
int dpmsEnabled
Definition: dmx.h:175
Pixel beBlackPixel
Definition: dmx.h:118
Definition: dmxstat.c:62
int beDepth
Definition: dmx.h:100
ChangePictureClipProcPtr ChangePictureClip
Definition: dmx.h:236
int whereX
Definition: dmx.h:169
int beBPP
Definition: dmx.h:101
int dmxNumScreens
Definition: dmxinit.c:79
int scrnYSign
Definition: dmx.h:129
RealizeWindowProcPtr RealizeWindow
Definition: dmx.h:206
GlyphsProcPtr Glyphs
Definition: dmx.h:243
Definition: dmx.h:77
int beXDPI
Definition: dmx.h:102
Window scrnWin
Definition: dmx.h:123
int scrnX
Definition: dmx.h:124
int beNumDefColormaps
Definition: dmx.h:115
struct _DMXScreenInfo DMXScreenInfo
SetShapeProcPtr SetShape
Definition: dmx.h:232
Bool dmxAddRemoveScreens
Definition: dmxinit.c:116
Bool dmxOffScreenOpt
Definition: dmxinit.c:90
GetImageProcPtr GetImage
Definition: dmx.h:217
int beWidth
Definition: dmx.h:98
int scrnXSign
Definition: dmx.h:128
ChangePictureProcPtr ChangePicture
Definition: dmx.h:239
CloseScreenProcPtr CloseScreen
Definition: dmx.h:197
Bool needsSync
Definition: dmx.h:181
CompositeProcPtr Composite
Definition: dmx.h:242
Bool WMRunningOnBE
Definition: dmx.h:158
SaveScreenProcPtr SaveScreen
Definition: dmx.h:198
DestroyColormapProcPtr DestroyColormap
Definition: dmx.h:228
InstallColormapProcPtr InstallColormap
Definition: dmx.h:229
int cursorVisible
Definition: dmx.h:165
DestroyWindowProcPtr DestroyWindow
Definition: dmx.h:203
DevPrivateKeyRec dmxGCPrivateKeyRec
Definition: dmxscrinit.c:67
int beYDPI
Definition: dmx.h:103
int dmxDepth
Definition: dmxinit.c:98
int scrnWidth
Definition: dmx.h:126
int whereY
Definition: dmx.h:170
int rootHeight
Definition: dmx.h:143
WindowExposuresProcPtr WindowExposures
Definition: dmx.h:209
Pixel beWhitePixel
Definition: dmx.h:119
Definition: dmx.h:91
Display * beDisplay
Definition: dmx.h:97
XPixmapFormatValues * bePixmapFormats
Definition: dmx.h:109
int rootXOrigin
Definition: dmx.h:145
TrianglesProcPtr Triangles
Definition: dmx.h:251
Colormap * beDefColormaps
Definition: dmx.h:116
BitmapToRegionProcPtr BitmapToRegion
Definition: dmx.h:222
int dpmsCapable
Definition: dmx.h:174
CreateWindowProcPtr CreateWindow
Definition: dmx.h:202
Bool dmxErrorOccurred
Definition: dmxinit.c:86
StoreColorsProcPtr StoreColors
Definition: dmx.h:230
Window rootWin
Definition: dmx.h:139
DestroyPictureClipProcPtr DestroyPictureClip
Definition: dmx.h:237
CopyWindowProcPtr CopyWindow
Definition: dmx.h:210
Definition: dmx.h:73
void * shadow
Definition: dmx.h:150
CompositeRectsProcPtr CompositeRects
Definition: dmx.h:244
Definition: dmx.h:75
int rootX
Definition: dmx.h:140
int rootWidth
Definition: dmx.h:142
DestroyPictureProcPtr DestroyPicture
Definition: dmx.h:235
Bool dmxIgnoreBadFontPaths
Definition: dmxinit.c:114
XVisualInfo * beVisuals
Definition: dmx.h:112
Bool dmxLazyWindowCreation
Definition: dmxinit.c:94
int beNumPixmapFormats
Definition: dmx.h:108
int beDefVisualIndex
Definition: dmx.h:113
int cursorNotShared
Definition: dmx.h:166
UpdateIndexedProcPtr UpdateIndexed
Definition: dmx.h:248
int beNumDepths
Definition: dmx.h:105
Cursor curCursor
Definition: dmx.h:161
int savedTimeout
Definition: dmx.h:173
Drawable scrnDefDrawables[MAXFORMATS]
Definition: dmx.h:132
const char * name
Definition: dmx.h:92
Definition: dmx.h:74
TrapezoidsProcPtr Trapezoids
Definition: dmx.h:250
int beHeight
Definition: dmx.h:99
RestackWindowProcPtr RestackWindow
Definition: dmx.h:208
ValidatePictureProcPtr ValidatePicture
Definition: dmx.h:240
Bool dmxUseXKB
Definition: dmxinit.c:96
int shared
Definition: dmx.h:156
char * dmxFontPath
Definition: dmxinit.c:88
DestroyPixmapProcPtr DestroyPixmap
Definition: dmx.h:221
UnrealizeWindowProcPtr UnrealizeWindow
Definition: dmx.h:207
int scrnHeight
Definition: dmx.h:127
int dpmsSuspend
Definition: dmx.h:177
PositionType where
Definition: dmx.h:168
XImage * shadowFBImage
Definition: dmx.h:152
DMXScreenInfo * dmxScreens
Definition: dmxinit.c:80
Cursor noCursor
Definition: dmx.h:160
int * beDepths
Definition: dmx.h:106

Generated on Tue Aug 18 2015 01:27:31 for Distributed Multihead X by doxygen 1.8.8