1 | /* $XFree86$ */
|
---|
2 | /*
|
---|
3 | * Copyright 2001-2004 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 | *
|
---|
33 | */
|
---|
34 |
|
---|
35 | /** \file
|
---|
36 | * Interface for window support. \see dmxwindow.c */
|
---|
37 |
|
---|
38 | #ifndef DMXWINDOW_H
|
---|
39 | #define DMXWINDOW_H
|
---|
40 |
|
---|
41 | #include "windowstr.h"
|
---|
42 |
|
---|
43 | /** Window private area. */
|
---|
44 | typedef struct _dmxWinPriv {
|
---|
45 | Window window;
|
---|
46 | Bool offscreen;
|
---|
47 | Bool mapped;
|
---|
48 | Bool restacked;
|
---|
49 | unsigned long attribMask;
|
---|
50 | Colormap cmap;
|
---|
51 | Visual *visual;
|
---|
52 | #ifdef SHAPE
|
---|
53 | Bool isShaped;
|
---|
54 | #endif
|
---|
55 | #ifdef RENDER
|
---|
56 | Bool hasPict;
|
---|
57 | #endif
|
---|
58 | #ifdef GLXEXT
|
---|
59 | void *swapGroup;
|
---|
60 | int barrier;
|
---|
61 | void (*windowDestroyed)(WindowPtr);
|
---|
62 | void (*windowUnmapped)(WindowPtr);
|
---|
63 | #endif
|
---|
64 | } dmxWinPrivRec, *dmxWinPrivPtr;
|
---|
65 |
|
---|
66 |
|
---|
67 | extern Bool dmxInitWindow(ScreenPtr pScreen);
|
---|
68 |
|
---|
69 | extern Window dmxCreateRootWindow(WindowPtr pWindow);
|
---|
70 |
|
---|
71 | extern void dmxGetDefaultWindowAttributes(WindowPtr pWindow,
|
---|
72 | Colormap *cmap,
|
---|
73 | Visual **visual);
|
---|
74 | extern void dmxCreateAndRealizeWindow(WindowPtr pWindow, Bool doSync);
|
---|
75 |
|
---|
76 | extern Bool dmxCreateWindow(WindowPtr pWindow);
|
---|
77 | extern Bool dmxDestroyWindow(WindowPtr pWindow);
|
---|
78 | extern Bool dmxPositionWindow(WindowPtr pWindow, int x, int y);
|
---|
79 | extern Bool dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask);
|
---|
80 | extern Bool dmxRealizeWindow(WindowPtr pWindow);
|
---|
81 | extern Bool dmxUnrealizeWindow(WindowPtr pWindow);
|
---|
82 | extern void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib);
|
---|
83 | extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn,
|
---|
84 | RegionPtr other_exposed);
|
---|
85 | extern void dmxPaintWindowBackground(WindowPtr pWindow, RegionPtr pRegion,
|
---|
86 | int what);
|
---|
87 | extern void dmxPaintWindowBorder(WindowPtr pWindow, RegionPtr pRegion,
|
---|
88 | int what);
|
---|
89 | extern void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg,
|
---|
90 | RegionPtr prgnSrc);
|
---|
91 |
|
---|
92 | extern void dmxResizeWindow(WindowPtr pWindow, int x, int y,
|
---|
93 | unsigned int w, unsigned int h, WindowPtr pSib);
|
---|
94 | extern void dmxReparentWindow(WindowPtr pWindow, WindowPtr pPriorParent);
|
---|
95 |
|
---|
96 | extern void dmxChangeBorderWidth(WindowPtr pWindow, unsigned int width);
|
---|
97 |
|
---|
98 | extern void dmxResizeScreenWindow(ScreenPtr pScreen,
|
---|
99 | int x, int y, int w, int h);
|
---|
100 | extern void dmxResizeRootWindow(WindowPtr pRoot,
|
---|
101 | int x, int y, int w, int h);
|
---|
102 |
|
---|
103 | extern Bool dmxBEDestroyWindow(WindowPtr pWindow);
|
---|
104 |
|
---|
105 | #ifdef SHAPE
|
---|
106 | /* Support for shape extension */
|
---|
107 | extern void dmxSetShape(WindowPtr pWindow);
|
---|
108 | #endif
|
---|
109 |
|
---|
110 | /** Private index. \see dmxwindow.c \see dmxscrinit.c */
|
---|
111 | extern int dmxWinPrivateIndex;
|
---|
112 |
|
---|
113 | /** Get window private pointer. */
|
---|
114 | #define DMX_GET_WINDOW_PRIV(_pWin) \
|
---|
115 | ((dmxWinPrivPtr)(_pWin)->devPrivates[dmxWinPrivateIndex].ptr)
|
---|
116 |
|
---|
117 | /* All of these macros are only used in dmxwindow.c */
|
---|
118 | #define DMX_WINDOW_FUNC_PROLOGUE(_pGC) \
|
---|
119 | do { \
|
---|
120 | dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(_pGC); \
|
---|
121 | DMX_UNWRAP(funcs, pGCPriv, (_pGC)); \
|
---|
122 | if (pGCPriv->ops) \
|
---|
123 | DMX_UNWRAP(ops, pGCPriv, (_pGC)); \
|
---|
124 | } while (0)
|
---|
125 |
|
---|
126 | #define DMX_WINDOW_FUNC_EPILOGUE(_pGC) \
|
---|
127 | do { \
|
---|
128 | dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(_pGC); \
|
---|
129 | DMX_WRAP(funcs, &dmxGCFuncs, pGCPriv, (_pGC)); \
|
---|
130 | if (pGCPriv->ops) \
|
---|
131 | DMX_WRAP(ops, &dmxGCOps, pGCPriv, (_pGC)); \
|
---|
132 | } while (0)
|
---|
133 |
|
---|
134 | #define DMX_WINDOW_X1(_pWin) \
|
---|
135 | ((_pWin)->drawable.x - wBorderWidth(_pWin))
|
---|
136 | #define DMX_WINDOW_Y1(_pWin) \
|
---|
137 | ((_pWin)->drawable.y - wBorderWidth(_pWin))
|
---|
138 | #define DMX_WINDOW_X2(_pWin) \
|
---|
139 | ((_pWin)->drawable.x + wBorderWidth(_pWin) + (_pWin)->drawable.width)
|
---|
140 | #define DMX_WINDOW_Y2(_pWin) \
|
---|
141 | ((_pWin)->drawable.y + wBorderWidth(_pWin) + (_pWin)->drawable.height)
|
---|
142 |
|
---|
143 | #define DMX_WINDOW_OFFSCREEN(_pWin) \
|
---|
144 | (DMX_WINDOW_X1(_pWin) >= (_pWin)->drawable.pScreen->width || \
|
---|
145 | DMX_WINDOW_Y1(_pWin) >= (_pWin)->drawable.pScreen->height || \
|
---|
146 | DMX_WINDOW_X2(_pWin) <= 0 || \
|
---|
147 | DMX_WINDOW_Y2(_pWin) <= 0)
|
---|
148 |
|
---|
149 | #endif /* DMXWINDOW_H */
|
---|