Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00050 #ifndef DMX_H
00051 #define DMX_H
00052
00053 #if HAVE_DMX_CONFIG_H
00054 #include <dmx-config.h>
00055 #endif
00056
00057 #include "gcstruct.h"
00058
00059
00060 #include "dmxclient.h"
00061
00062 #include "globals.h"
00063 #include "scrnintstr.h"
00064
00065 #include "picturestr.h"
00066
00067 #ifdef GLXEXT
00068 #include <GL/glx.h>
00069 #include <GL/glxint.h>
00070 #endif
00071
00072 typedef enum {
00073 PosNone = -1,
00074 PosAbsolute = 0,
00075 PosRightOf,
00076 PosLeftOf,
00077 PosAbove,
00078 PosBelow,
00079 PosRelative
00080 } PositionType;
00081
00084 typedef struct _DMXInputInfo DMXInputInfo;
00085
00088 typedef struct _DMXStatInfo DMXStatInfo;
00089
00091 typedef struct _DMXScreenInfo {
00092 const char *name;
00093 int index;
00095
00096
00097 Display *beDisplay;
00098 int beWidth;
00099 int beHeight;
00100 int beDepth;
00101 int beBPP;
00102 int beXDPI;
00103 int beYDPI;
00105 int beNumDepths;
00106 int *beDepths;
00108 int beNumPixmapFormats;
00109 XPixmapFormatValues *bePixmapFormats;
00111 int beNumVisuals;
00112 XVisualInfo *beVisuals;
00113 int beDefVisualIndex;
00115 int beNumDefColormaps;
00116 Colormap *beDefColormaps;
00118 Pixel beBlackPixel;
00119 Pixel beWhitePixel;
00121
00122
00123 Window scrnWin;
00124 int scrnX;
00125 int scrnY;
00126 int scrnWidth;
00127 int scrnHeight;
00128 int scrnXSign;
00129 int scrnYSign;
00132 Drawable scrnDefDrawables[MAXFORMATS];
00133
00134 struct _DMXScreenInfo *next;
00135 struct _DMXScreenInfo *over;
00137
00138
00139 Window rootWin;
00140 int rootX;
00141 int rootY;
00142 int rootWidth;
00143 int rootHeight;
00145 int rootXOrigin;
00146 int rootYOrigin;
00148
00149
00150 void *shadow;
00151 XlibGC shadowGC;
00152 XImage *shadowFBImage;
00154
00155
00156 int shared;
00158 Bool WMRunningOnBE;
00159
00160 Cursor noCursor;
00161 Cursor curCursor;
00162
00163
00164 CursorPtr cursor;
00165 int cursorVisible;
00166 int cursorNotShared;
00167
00168 PositionType where;
00169 int whereX;
00170 int whereY;
00171 int whereRefScreen;
00173 int savedTimeout;
00174 int dpmsCapable;
00175 int dpmsEnabled;
00176 int dpmsStandby;
00177 int dpmsSuspend;
00178 int dpmsOff;
00180 DMXStatInfo *stat;
00181 Bool needsSync;
00183 #ifdef GLXEXT
00184
00185 int numGlxVisuals;
00186 __GLXvisualConfig *glxVisuals;
00187 int glxMajorOpcode;
00188 int glxErrorBase;
00189
00191 __GLXFBConfig *fbconfigs;
00192 int numFBConfigs;
00193 #endif
00194
00197 CloseScreenProcPtr CloseScreen;
00198 SaveScreenProcPtr SaveScreen;
00199
00200 CreateGCProcPtr CreateGC;
00201
00202 CreateWindowProcPtr CreateWindow;
00203 DestroyWindowProcPtr DestroyWindow;
00204 PositionWindowProcPtr PositionWindow;
00205 ChangeWindowAttributesProcPtr ChangeWindowAttributes;
00206 RealizeWindowProcPtr RealizeWindow;
00207 UnrealizeWindowProcPtr UnrealizeWindow;
00208 RestackWindowProcPtr RestackWindow;
00209 WindowExposuresProcPtr WindowExposures;
00210 CopyWindowProcPtr CopyWindow;
00211
00212 ResizeWindowProcPtr ResizeWindow;
00213 ReparentWindowProcPtr ReparentWindow;
00214
00215 ChangeBorderWidthProcPtr ChangeBorderWidth;
00216
00217 GetImageProcPtr GetImage;
00218 GetSpansProcPtr GetSpans;
00219
00220 CreatePixmapProcPtr CreatePixmap;
00221 DestroyPixmapProcPtr DestroyPixmap;
00222 BitmapToRegionProcPtr BitmapToRegion;
00223
00224 RealizeFontProcPtr RealizeFont;
00225 UnrealizeFontProcPtr UnrealizeFont;
00226
00227 CreateColormapProcPtr CreateColormap;
00228 DestroyColormapProcPtr DestroyColormap;
00229 InstallColormapProcPtr InstallColormap;
00230 StoreColorsProcPtr StoreColors;
00231
00232 SetShapeProcPtr SetShape;
00233
00234 CreatePictureProcPtr CreatePicture;
00235 DestroyPictureProcPtr DestroyPicture;
00236 ChangePictureClipProcPtr ChangePictureClip;
00237 DestroyPictureClipProcPtr DestroyPictureClip;
00238
00239 ChangePictureProcPtr ChangePicture;
00240 ValidatePictureProcPtr ValidatePicture;
00241
00242 CompositeProcPtr Composite;
00243 GlyphsProcPtr Glyphs;
00244 CompositeRectsProcPtr CompositeRects;
00245
00246 InitIndexedProcPtr InitIndexed;
00247 CloseIndexedProcPtr CloseIndexed;
00248 UpdateIndexedProcPtr UpdateIndexed;
00249
00250 TrapezoidsProcPtr Trapezoids;
00251 TrianglesProcPtr Triangles;
00252 TriStripProcPtr TriStrip;
00253 TriFanProcPtr TriFan;
00254 } DMXScreenInfo;
00255
00256
00257 extern int dmxNumScreens;
00258 extern DMXScreenInfo *dmxScreens;
00259 extern int dmxShadowFB;
00262 extern XErrorEvent dmxLastErrorEvent;
00264 extern Bool dmxErrorOccurred;
00266 extern Bool dmxOffScreenOpt;
00269 extern Bool dmxSubdividePrimitives;
00272 extern Bool dmxLazyWindowCreation;
00275 extern Bool dmxUseXKB;
00279 extern int dmxDepth;
00281 #ifdef GLXEXT
00282 extern Bool dmxGLXProxy;
00284 extern Bool dmxGLXSwapGroupSupport;
00288 extern Bool dmxGLXSyncSwap;
00292 extern Bool dmxGLXFinishSwap;
00297 #endif
00298 extern char *dmxFontPath;
00307 extern Bool dmxIgnoreBadFontPaths;
00311 extern Bool dmxAddRemoveScreens;
00316 #define DMX_WRAP(_entry, _newfunc, _saved, _actual) \
00317 do { \
00318 (_saved)->_entry = (_actual)->_entry; \
00319 (_actual)->_entry = (_newfunc); \
00320 } while (0)
00321
00323 #define DMX_UNWRAP(_entry, _saved, _actual) \
00324 do { \
00325 (_actual)->_entry = (_saved)->_entry; \
00326 } while (0)
00327
00328
00329
00330 #ifdef MAXSCREENS
00331 #define MAXSCREEN_MAKECONSTSTR1(x) #x
00332 #define MAXSCREEN_MAKECONSTSTR2(x) MAXSCREEN_MAKECONSTSTR1(x)
00333
00334 #define MAXSCREEN_FAILED_TXT "Failed at [" \
00335 MAXSCREEN_MAKECONSTSTR2(__LINE__) ":" __FILE__ "] to allocate object: "
00336
00337 #define _MAXSCREENSALLOCF(o,size,fatal) \
00338 do { \
00339 if (!o) { \
00340 o = calloc((size), sizeof(*(o))); \
00341 if (!o && fatal) FatalError(MAXSCREEN_FAILED_TXT #o); \
00342 } \
00343 } while (0)
00344 #define _MAXSCREENSALLOCR(o,size,retval) \
00345 do { \
00346 if (!o) { \
00347 o = calloc((size), sizeof(*(o))); \
00348 if (!o) return retval; \
00349 } \
00350 } while (0)
00351
00352 #define MAXSCREENSFREE(o) \
00353 do { \
00354 free(o); \
00355 o = NULL; \
00356 } while (0)
00357
00358 #define MAXSCREENSALLOC(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 0)
00359 #define MAXSCREENSALLOC_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS, 1)
00360 #define MAXSCREENSALLOC_RETURN(o,r) _MAXSCREENSALLOCR(o,MAXSCREENS, (r))
00361 #define MAXSCREENSALLOCPLUSONE(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,0)
00362 #define MAXSCREENSALLOCPLUSONE_FATAL(o) _MAXSCREENSALLOCF(o,MAXSCREENS+1,1)
00363 #define MAXSCREENSCALLOC(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),0)
00364 #define MAXSCREENSCALLOC_FATAL(o,m) _MAXSCREENSALLOCF(o,MAXSCREENS*(m),1)
00365 #endif
00366
00367 extern DevPrivateKeyRec dmxGCPrivateKeyRec;
00368 #define dmxGCPrivateKey (&dmxGCPrivateKeyRec)
00370 extern DevPrivateKeyRec dmxWinPrivateKeyRec;
00371 #define dmxWinPrivateKey (&dmxWinPrivateKeyRec)
00373 extern DevPrivateKeyRec dmxPixPrivateKeyRec;
00374 #define dmxPixPrivateKey (&dmxPixPrivateKeyRec)
00376 extern int dmxFontPrivateIndex;
00378 extern DevPrivateKeyRec dmxScreenPrivateKeyRec;
00379 #define dmxScreenPrivateKey (&dmxScreenPrivateKeyRec)
00381 extern DevPrivateKeyRec dmxColormapPrivateKeyRec;
00382 #define dmxColormapPrivateKey (&dmxColormapPrivateKeyRec)
00384 extern DevPrivateKeyRec dmxPictPrivateKeyRec;
00385 #define dmxPictPrivateKey (&dmxPictPrivateKeyRec)
00387 extern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec;
00388 #define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec)
00390 #endif