VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.3.0.0/dbestruct.h@ 81245

最後變更 在這個檔案從81245是 25078,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: exported and set eol-style on new headers

  • 屬性 svn:eol-style 設為 native
檔案大小: 6.9 KB
 
1/******************************************************************************
2 *
3 * Copyright (c) 1994, 1995 Hewlett-Packard Company
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Except as contained in this notice, the name of the Hewlett-Packard
25 * Company shall not be used in advertising or otherwise to promote the
26 * sale, use or other dealings in this Software without prior written
27 * authorization from the Hewlett-Packard Company.
28 *
29 * Header file for DIX-related DBE
30 *
31 *****************************************************************************/
32/* $XFree86$ */
33
34#ifndef DBE_STRUCT_H
35#define DBE_STRUCT_H
36
37
38/* INCLUDES */
39
40#define NEED_DBE_PROTOCOL
41#include <X11/extensions/Xdbeproto.h>
42#include "windowstr.h"
43
44
45/* DEFINES */
46
47#define DBE_SCREEN_PRIV(pScreen) \
48 ((dbeScreenPrivIndex < 0) ? \
49 NULL : \
50 ((DbeScreenPrivPtr)((pScreen)->devPrivates[dbeScreenPrivIndex].ptr)))
51
52#define DBE_SCREEN_PRIV_FROM_DRAWABLE(pDrawable) \
53 DBE_SCREEN_PRIV((pDrawable)->pScreen)
54
55#define DBE_SCREEN_PRIV_FROM_WINDOW_PRIV(pDbeWindowPriv) \
56 DBE_SCREEN_PRIV((pDbeWindowPriv)->pWindow->drawable.pScreen)
57
58#define DBE_SCREEN_PRIV_FROM_WINDOW(pWindow) \
59 DBE_SCREEN_PRIV((pWindow)->drawable.pScreen)
60
61#define DBE_SCREEN_PRIV_FROM_PIXMAP(pPixmap) \
62 DBE_SCREEN_PRIV((pPixmap)->drawable.pScreen)
63
64#define DBE_SCREEN_PRIV_FROM_GC(pGC)\
65 DBE_SCREEN_PRIV((pGC)->pScreen)
66
67#define DBE_WINDOW_PRIV(pWindow)\
68 ((dbeWindowPrivIndex < 0) ? \
69 NULL : \
70 ((DbeWindowPrivPtr)(pWindow->devPrivates[dbeWindowPrivIndex].ptr)))
71
72/* Initial size of the buffer ID array in the window priv. */
73#define DBE_INIT_MAX_IDS 2
74
75/* Reallocation increment for the buffer ID array. */
76#define DBE_INCR_MAX_IDS 4
77
78/* Marker for free elements in the buffer ID array. */
79#define DBE_FREE_ID_ELEMENT 0
80
81
82/* TYPEDEFS */
83
84/* Record used to pass swap information between DIX and DDX swapping
85 * procedures.
86 */
87typedef struct _DbeSwapInfoRec
88{
89 WindowPtr pWindow;
90 unsigned char swapAction;
91
92} DbeSwapInfoRec, *DbeSwapInfoPtr;
93
94/*
95 ******************************************************************************
96 ** Per-window data
97 ******************************************************************************
98 */
99
100typedef struct _DbeWindowPrivRec
101{
102 /* A pointer to the window with which the DBE window private (buffer) is
103 * associated.
104 */
105 WindowPtr pWindow;
106
107 /* Last known swap action for this buffer. Legal values for this field
108 * are XdbeUndefined, XdbeBackground, XdbeUntouched, and XdbeCopied.
109 */
110 unsigned char swapAction;
111
112 /* Last known buffer size.
113 */
114 unsigned short width, height;
115
116 /* Coordinates used for static gravity when the window is positioned.
117 */
118 short x, y;
119
120 /* Number of XIDs associated with this buffer.
121 */
122 int nBufferIDs;
123
124 /* Capacity of the current buffer ID array, IDs. */
125 int maxAvailableIDs;
126
127 /* Pointer to the array of buffer IDs. This initially points to initIDs.
128 * When the static limit of the initIDs array is reached, the array is
129 * reallocated and this pointer is set to the new array instead of initIDs.
130 */
131 XID *IDs;
132
133 /* Initial array of buffer IDs. We are defining the XID array within the
134 * window priv to optimize for data locality. In most cases, only one
135 * buffer will be associated with a window. Having the array declared
136 * here can prevent us from accessing the data in another memory page,
137 * possibly resulting in a page swap and loss of performance. Initially we
138 * will use this array to store buffer IDs. For situations where we have
139 * more IDs than can fit in this static array, we will allocate a larger
140 * array to use, possibly suffering a performance loss.
141 */
142 XID initIDs[DBE_INIT_MAX_IDS];
143
144 /* Device-specific private information.
145 */
146 DevUnion *devPrivates;
147
148} DbeWindowPrivRec, *DbeWindowPrivPtr;
149
150
151/*
152 ******************************************************************************
153 ** Per-screen data
154 ******************************************************************************
155 */
156
157typedef struct _DbeScreenPrivRec
158{
159 /* Info for creating window privs */
160 int winPrivPrivLen; /* Length of privs in DbeWindowPrivRec */
161 unsigned int *winPrivPrivSizes; /* Array of private record sizes */
162 unsigned int totalWinPrivSize; /* PrivRec + size of all priv priv ptrs */
163
164 /* Resources created by DIX to be used by DDX */
165 RESTYPE dbeDrawableResType;
166 RESTYPE dbeWindowPrivResType;
167
168 /* Private indices created by DIX to be used by DDX */
169 int dbeScreenPrivIndex;
170 int dbeWindowPrivIndex;
171
172 /* Wrapped functions
173 * It is the responsibilty of the DDX layer to wrap PositionWindow().
174 * DbeExtensionInit wraps DestroyWindow().
175 */
176 PositionWindowProcPtr PositionWindow;
177 DestroyWindowProcPtr DestroyWindow;
178
179 /* Per-screen DIX routines */
180 Bool (*SetupBackgroundPainter)(
181 WindowPtr /*pWin*/,
182 GCPtr /*pGC*/
183);
184 DbeWindowPrivPtr (*AllocWinPriv)(
185 ScreenPtr /*pScreen*/
186);
187 int (*AllocWinPrivPrivIndex)(
188 void
189);
190 Bool (*AllocWinPrivPriv)(
191 ScreenPtr /*pScreen*/,
192 int /*index*/,
193 unsigned /*amount*/
194);
195
196 /* Per-screen DDX routines */
197 Bool (*GetVisualInfo)(
198 ScreenPtr /*pScreen*/,
199 XdbeScreenVisualInfo * /*pVisInfo*/
200);
201 int (*AllocBackBufferName)(
202 WindowPtr /*pWin*/,
203 XID /*bufId*/,
204 int /*swapAction*/
205);
206 int (*SwapBuffers)(
207 ClientPtr /*client*/,
208 int * /*pNumWindows*/,
209 DbeSwapInfoPtr /*swapInfo*/
210);
211 void (*BeginIdiom)(
212 ClientPtr /*client*/
213);
214 void (*EndIdiom)(
215 ClientPtr /*client*/
216);
217 void (*WinPrivDelete)(
218 DbeWindowPrivPtr /*pDbeWindowPriv*/,
219 XID /*bufId*/
220);
221 void (*ResetProc)(
222 ScreenPtr /*pScreen*/
223);
224 void (*ValidateBuffer)(
225 WindowPtr /*pWin*/,
226 XID /*bufId*/,
227 Bool /*dstbuffer*/
228);
229
230 /* Device-specific private information.
231 */
232 DevUnion *devPrivates;
233
234} DbeScreenPrivRec, *DbeScreenPrivPtr;
235
236#endif /* DBE_STRUCT_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette