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
00037 #ifndef DMXWINDOW_H
00038 #define DMXWINDOW_H
00039
00040 #include "windowstr.h"
00041
00043 typedef struct _dmxWinPriv {
00044 Window window;
00045 Bool offscreen;
00046 Bool mapped;
00047 Bool restacked;
00048 unsigned long attribMask;
00049 Colormap cmap;
00050 Visual *visual;
00051 Bool isShaped;
00052 #ifdef RENDER
00053 Bool hasPict;
00054 #endif
00055 #ifdef GLXEXT
00056 void *swapGroup;
00057 int barrier;
00058 void (*windowDestroyed)(WindowPtr);
00059 void (*windowUnmapped)(WindowPtr);
00060 #endif
00061 } dmxWinPrivRec, *dmxWinPrivPtr;
00062
00063
00064 extern Bool dmxInitWindow(ScreenPtr pScreen);
00065
00066 extern Window dmxCreateRootWindow(WindowPtr pWindow);
00067
00068 extern void dmxGetDefaultWindowAttributes(WindowPtr pWindow,
00069 Colormap *cmap,
00070 Visual **visual);
00071 extern void dmxCreateAndRealizeWindow(WindowPtr pWindow, Bool doSync);
00072
00073 extern Bool dmxCreateWindow(WindowPtr pWindow);
00074 extern Bool dmxDestroyWindow(WindowPtr pWindow);
00075 extern Bool dmxPositionWindow(WindowPtr pWindow, int x, int y);
00076 extern Bool dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask);
00077 extern Bool dmxRealizeWindow(WindowPtr pWindow);
00078 extern Bool dmxUnrealizeWindow(WindowPtr pWindow);
00079 extern void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib);
00080 extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn,
00081 RegionPtr other_exposed);
00082 extern void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg,
00083 RegionPtr prgnSrc);
00084
00085 extern void dmxResizeWindow(WindowPtr pWindow, int x, int y,
00086 unsigned int w, unsigned int h, WindowPtr pSib);
00087 extern void dmxReparentWindow(WindowPtr pWindow, WindowPtr pPriorParent);
00088
00089 extern void dmxChangeBorderWidth(WindowPtr pWindow, unsigned int width);
00090
00091 extern void dmxResizeScreenWindow(ScreenPtr pScreen,
00092 int x, int y, int w, int h);
00093 extern void dmxResizeRootWindow(WindowPtr pRoot,
00094 int x, int y, int w, int h);
00095
00096 extern Bool dmxBEDestroyWindow(WindowPtr pWindow);
00097
00098
00099 extern void dmxSetShape(WindowPtr pWindow);
00100
00102 extern DevPrivateKey dmxWinPrivateKey;
00103
00105 #define DMX_GET_WINDOW_PRIV(_pWin) ((dmxWinPrivPtr) \
00106 dixLookupPrivate(&(_pWin)->devPrivates, dmxWinPrivateKey))
00107
00108
00109 #define DMX_WINDOW_FUNC_PROLOGUE(_pGC) \
00110 do { \
00111 dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(_pGC); \
00112 DMX_UNWRAP(funcs, pGCPriv, (_pGC)); \
00113 if (pGCPriv->ops) \
00114 DMX_UNWRAP(ops, pGCPriv, (_pGC)); \
00115 } while (0)
00116
00117 #define DMX_WINDOW_FUNC_EPILOGUE(_pGC) \
00118 do { \
00119 dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(_pGC); \
00120 DMX_WRAP(funcs, &dmxGCFuncs, pGCPriv, (_pGC)); \
00121 if (pGCPriv->ops) \
00122 DMX_WRAP(ops, &dmxGCOps, pGCPriv, (_pGC)); \
00123 } while (0)
00124
00125 #define DMX_WINDOW_X1(_pWin) \
00126 ((_pWin)->drawable.x - wBorderWidth(_pWin))
00127 #define DMX_WINDOW_Y1(_pWin) \
00128 ((_pWin)->drawable.y - wBorderWidth(_pWin))
00129 #define DMX_WINDOW_X2(_pWin) \
00130 ((_pWin)->drawable.x + wBorderWidth(_pWin) + (_pWin)->drawable.width)
00131 #define DMX_WINDOW_Y2(_pWin) \
00132 ((_pWin)->drawable.y + wBorderWidth(_pWin) + (_pWin)->drawable.height)
00133
00134 #define DMX_WINDOW_OFFSCREEN(_pWin) \
00135 (DMX_WINDOW_X1(_pWin) >= (_pWin)->drawable.pScreen->width || \
00136 DMX_WINDOW_Y1(_pWin) >= (_pWin)->drawable.pScreen->height || \
00137 DMX_WINDOW_X2(_pWin) <= 0 || \
00138 DMX_WINDOW_Y2(_pWin) <= 0)
00139
00140 #endif