~ubuntu-branches/ubuntu/karmic/virtualbox-ose/karmic-updates

« back to all changes in this revision

Viewing changes to src/VBox/Additions/x11/x11include/1.4/xorg/windowstr.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-09-14 18:25:07 UTC
  • mfrom: (0.4.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090914182507-c98g07mq16hjmn6d
Tags: 3.0.6-dfsg-1ubuntu1
* Merge from debian unstable (LP: #429697), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
  - virtualbox, virtualbox-* (names of the upstream proprietary packages)
    conflict with virtualbox-ose (LP: #379878)
* Make debug package depend on normal or guest utils package
* Drop patches/22-pulseaudio-stubs.dpatch (applied upstream)
* Rename Ubuntu specific patches to uXX-*.dpatch
* Fix lintian warnings in maintainer scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***********************************************************
2
 
 
3
 
Copyright 1987, 1998  The Open Group
4
 
 
5
 
Permission to use, copy, modify, distribute, and sell this software and its
6
 
documentation for any purpose is hereby granted without fee, provided that
7
 
the above copyright notice appear in all copies and that both that
8
 
copyright notice and this permission notice appear in supporting
9
 
documentation.
10
 
 
11
 
The above copyright notice and this permission notice shall be included in
12
 
all copies or substantial portions of the Software.
13
 
 
14
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17
 
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18
 
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
 
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
 
 
21
 
Except as contained in this notice, the name of The Open Group shall not be
22
 
used in advertising or otherwise to promote the sale, use or other dealings
23
 
in this Software without prior written authorization from The Open Group.
24
 
 
25
 
 
26
 
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
27
 
 
28
 
                        All Rights Reserved
29
 
 
30
 
Permission to use, copy, modify, and distribute this software and its 
31
 
documentation for any purpose and without fee is hereby granted, 
32
 
provided that the above copyright notice appear in all copies and that
33
 
both that copyright notice and this permission notice appear in 
34
 
supporting documentation, and that the name of Digital not be
35
 
used in advertising or publicity pertaining to distribution of the
36
 
software without specific, written prior permission.  
37
 
 
38
 
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39
 
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40
 
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41
 
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42
 
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43
 
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
44
 
SOFTWARE.
45
 
 
46
 
******************************************************************/
47
 
 
48
 
#ifndef WINDOWSTRUCT_H
49
 
#define WINDOWSTRUCT_H
50
 
 
51
 
#include "window.h"
52
 
#include "pixmapstr.h"
53
 
#include "regionstr.h"
54
 
#include "cursor.h"
55
 
#include "property.h"
56
 
#include "resource.h"   /* for ROOT_WINDOW_ID_BASE */
57
 
#include "dix.h"
58
 
#include "miscstruct.h"
59
 
#include <X11/Xprotostr.h>
60
 
#include "opaque.h"
61
 
 
62
 
#define GuaranteeNothing        0
63
 
#define GuaranteeVisBack        1
64
 
 
65
 
#define SameBackground(as, a, bs, b)                            \
66
 
    ((as) == (bs) && ((as) == None ||                           \
67
 
                      (as) == ParentRelative ||                 \
68
 
                      SamePixUnion(a,b,as == BackgroundPixel)))
69
 
 
70
 
#define SameBorder(as, a, bs, b)                                \
71
 
    EqualPixUnion(as, a, bs, b)
72
 
 
73
 
typedef struct _WindowOpt {
74
 
    VisualID            visual;            /* default: same as parent */
75
 
    CursorPtr           cursor;            /* default: window.cursorNone */
76
 
    Colormap            colormap;          /* default: same as parent */
77
 
    Mask                dontPropagateMask; /* default: window.dontPropagate */
78
 
    Mask                otherEventMasks;   /* default: 0 */
79
 
    struct _OtherClients *otherClients;    /* default: NULL */
80
 
    struct _GrabRec     *passiveGrabs;     /* default: NULL */
81
 
    PropertyPtr         userProps;         /* default: NULL */
82
 
    unsigned long       backingBitPlanes;  /* default: ~0L */
83
 
    unsigned long       backingPixel;      /* default: 0 */
84
 
#ifdef SHAPE
85
 
    RegionPtr           boundingShape;     /* default: NULL */
86
 
    RegionPtr           clipShape;         /* default: NULL */
87
 
    RegionPtr           inputShape;        /* default: NULL */
88
 
#endif
89
 
#ifdef XINPUT
90
 
    struct _OtherInputMasks *inputMasks;   /* default: NULL */
91
 
#endif
92
 
} WindowOptRec, *WindowOptPtr;
93
 
 
94
 
#define BackgroundPixel     2L
95
 
#define BackgroundPixmap    3L
96
 
 
97
 
/*
98
 
 * The redirectDraw field can have one of three values:
99
 
 *
100
 
 *  RedirectDrawNone
101
 
 *      A normal window; painted into the same pixmap as the parent
102
 
 *      and clipping parent and siblings to its geometry. These
103
 
 *      windows get a clip list equal to the intersection of their
104
 
 *      geometry with the parent geometry, minus the geometry
105
 
 *      of overlapping None and Clipped siblings.
106
 
 *  RedirectDrawAutomatic
107
 
 *      A redirected window which clips parent and sibling drawing.
108
 
 *      Contents for these windows are manage inside the server.
109
 
 *      These windows get an internal clip list equal to their
110
 
 *      geometry.
111
 
 *  RedirectDrawManual
112
 
 *      A redirected window which does not clip parent and sibling
113
 
 *      drawing; the window must be represented within the parent
114
 
 *      geometry by the client performing the redirection management.
115
 
 *      Contents for these windows are managed outside the server.
116
 
 *      These windows get an internal clip list equal to their
117
 
 *      geometry.
118
 
 */
119
 
 
120
 
#define RedirectDrawNone        0
121
 
#define RedirectDrawAutomatic   1
122
 
#define RedirectDrawManual      2
123
 
 
124
 
typedef struct _Window {
125
 
    DrawableRec         drawable;
126
 
    WindowPtr           parent;         /* ancestor chain */
127
 
    WindowPtr           nextSib;        /* next lower sibling */
128
 
    WindowPtr           prevSib;        /* next higher sibling */
129
 
    WindowPtr           firstChild;     /* top-most child */
130
 
    WindowPtr           lastChild;      /* bottom-most child */
131
 
    RegionRec           clipList;       /* clipping rectangle for output */
132
 
    RegionRec           borderClip;     /* NotClippedByChildren + border */
133
 
    union _Validate     *valdata;
134
 
    RegionRec           winSize;
135
 
    RegionRec           borderSize;
136
 
    DDXPointRec         origin;         /* position relative to parent */
137
 
    unsigned short      borderWidth;
138
 
    unsigned short      deliverableEvents;
139
 
    Mask                eventMask;
140
 
    PixUnion            background;
141
 
    PixUnion            border;
142
 
    pointer             backStorage;    /* null when BS disabled */
143
 
    WindowOptPtr        optional;
144
 
    unsigned            backgroundState:2; /* None, Relative, Pixel, Pixmap */
145
 
    unsigned            borderIsPixel:1;
146
 
    unsigned            cursorIsNone:1; /* else real cursor (might inherit) */
147
 
    unsigned            backingStore:2;
148
 
    unsigned            saveUnder:1;
149
 
    unsigned            DIXsaveUnder:1;
150
 
    unsigned            bitGravity:4;
151
 
    unsigned            winGravity:4;
152
 
    unsigned            overrideRedirect:1;
153
 
    unsigned            visibility:2;
154
 
    unsigned            mapped:1;
155
 
    unsigned            realized:1;     /* ancestors are all mapped */
156
 
    unsigned            viewable:1;     /* realized && InputOutput */
157
 
    unsigned            dontPropagate:3;/* index into DontPropagateMasks */
158
 
    unsigned            forcedBS:1;     /* system-supplied backingStore */
159
 
#ifdef COMPOSITE
160
 
    unsigned            redirectDraw:2; /* rendering is redirected from here */
161
 
#endif
162
 
    DevUnion            *devPrivates;
163
 
} WindowRec;
164
 
 
165
 
/*
166
 
 * Ok, a bunch of macros for accessing the optional record
167
 
 * fields (or filling the appropriate default value)
168
 
 */
169
 
 
170
 
extern Mask         DontPropagateMasks[];
171
 
 
172
 
#define wTrackParent(w,field)   ((w)->optional ? \
173
 
                                    (w)->optional->field \
174
 
                                 : FindWindowWithOptional(w)->optional->field)
175
 
#define wUseDefault(w,field,def)        ((w)->optional ? \
176
 
                                    (w)->optional->field \
177
 
                                 : def)
178
 
 
179
 
#define wVisual(w)              wTrackParent(w, visual)
180
 
#define wCursor(w)              ((w)->cursorIsNone ? None : wTrackParent(w, cursor))
181
 
#define wColormap(w)            ((w)->drawable.class == InputOnly ? None : wTrackParent(w, colormap))
182
 
#define wDontPropagateMask(w)   wUseDefault(w, dontPropagateMask, DontPropagateMasks[(w)->dontPropagate])
183
 
#define wOtherEventMasks(w)     wUseDefault(w, otherEventMasks, 0)
184
 
#define wOtherClients(w)        wUseDefault(w, otherClients, NULL)
185
 
#ifdef XINPUT
186
 
#define wOtherInputMasks(w)     wUseDefault(w, inputMasks, NULL)
187
 
#else
188
 
#define wOtherInputMasks(w)     NULL
189
 
#endif
190
 
#define wPassiveGrabs(w)        wUseDefault(w, passiveGrabs, NULL)
191
 
#define wUserProps(w)           wUseDefault(w, userProps, NULL)
192
 
#define wBackingBitPlanes(w)    wUseDefault(w, backingBitPlanes, ~0L)
193
 
#define wBackingPixel(w)        wUseDefault(w, backingPixel, 0)
194
 
#ifdef SHAPE
195
 
#define wBoundingShape(w)       wUseDefault(w, boundingShape, NULL)
196
 
#define wClipShape(w)           wUseDefault(w, clipShape, NULL)
197
 
#define wInputShape(w)          wUseDefault(w, inputShape, NULL)
198
 
#endif
199
 
#define wClient(w)              (clients[CLIENT_ID((w)->drawable.id)])
200
 
#define wBorderWidth(w)         ((int) (w)->borderWidth)
201
 
 
202
 
/* true when w needs a border drawn. */
203
 
 
204
 
#ifdef SHAPE
205
 
#define HasBorder(w)    ((w)->borderWidth || wClipShape(w))
206
 
#else
207
 
#define HasBorder(w)    ((w)->borderWidth)
208
 
#endif
209
 
 
210
 
typedef struct _ScreenSaverStuff {
211
 
    WindowPtr pWindow;
212
 
    XID       wid;
213
 
    char      blanked;
214
 
    Bool      (*ExternalScreenSaver)(
215
 
        ScreenPtr       /*pScreen*/,
216
 
        int             /*xstate*/,
217
 
        Bool            /*force*/);
218
 
} ScreenSaverStuffRec, *ScreenSaverStuffPtr;
219
 
 
220
 
#define SCREEN_IS_BLANKED   0
221
 
#define SCREEN_ISNT_SAVED   1
222
 
#define SCREEN_IS_TILED     2
223
 
#define SCREEN_IS_BLACK     3
224
 
 
225
 
#define HasSaverWindow(i)   (savedScreenInfo[i].pWindow != NullWindow)
226
 
 
227
 
extern int screenIsSaved;
228
 
extern ScreenSaverStuffRec savedScreenInfo[MAXSCREENS];
229
 
 
230
 
/*
231
 
 * this is the configuration parameter "NO_BACK_SAVE"
232
 
 * it means that any existant backing store should not 
233
 
 * be used to implement save unders.
234
 
 */
235
 
 
236
 
#ifndef NO_BACK_SAVE
237
 
#define DO_SAVE_UNDERS(pWin)    ((pWin)->drawable.pScreen->saveUnderSupport ==\
238
 
                                 USE_DIX_SAVE_UNDERS)
239
 
/*
240
 
 * saveUnderSupport is set to this magic value when using DIXsaveUnders
241
 
 */
242
 
 
243
 
#define USE_DIX_SAVE_UNDERS     0x40
244
 
#endif
245
 
 
246
 
extern int numSaveUndersViewable;
247
 
extern int deltaSaveUndersViewable;
248
 
 
249
 
#ifdef XEVIE
250
 
extern WindowPtr xeviewin;
251
 
#endif
252
 
 
253
 
#endif /* WINDOWSTRUCT_H */