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