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