1 | /** @file
|
---|
2 | * VBox Remote Desktop Extension (VRDE) - Graphics Orders Structures.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox base platform packages, as
|
---|
9 | * available from https://www.virtualbox.org.
|
---|
10 | *
|
---|
11 | * This program is free software; you can redistribute it and/or
|
---|
12 | * modify it under the terms of the GNU General Public License
|
---|
13 | * as published by the Free Software Foundation, in version 3 of the
|
---|
14 | * License.
|
---|
15 | *
|
---|
16 | * This program is distributed in the hope that it will be useful, but
|
---|
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
19 | * General Public License for more details.
|
---|
20 | *
|
---|
21 | * You should have received a copy of the GNU General Public License
|
---|
22 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
23 | *
|
---|
24 | * The contents of this file may alternatively be used under the terms
|
---|
25 | * of the Common Development and Distribution License Version 1.0
|
---|
26 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
27 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
28 | * CDDL are applicable instead of those of the GPL.
|
---|
29 | *
|
---|
30 | * You may elect to license modified versions of this file under the
|
---|
31 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
32 | *
|
---|
33 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
34 | */
|
---|
35 |
|
---|
36 | #ifndef VBOX_INCLUDED_RemoteDesktop_VRDEOrders_h
|
---|
37 | #define VBOX_INCLUDED_RemoteDesktop_VRDEOrders_h
|
---|
38 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
39 | # pragma once
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | #include <iprt/types.h>
|
---|
43 |
|
---|
44 | /*
|
---|
45 | * VRDE gets an information about a graphical update as a pointer
|
---|
46 | * to a memory block and the size of the memory block.
|
---|
47 | * The memory block layout is:
|
---|
48 | * VRDEORDERHDR - Describes the affected rectangle.
|
---|
49 | * Then VRDE orders follow:
|
---|
50 | * VRDEORDERCODE;
|
---|
51 | * a VRDEORDER* structure.
|
---|
52 | *
|
---|
53 | * If size of the memory block is equal to the VRDEORDERHDR, then a bitmap
|
---|
54 | * update is assumed.
|
---|
55 | */
|
---|
56 |
|
---|
57 | /* VRDE order codes. Must be >= 0, because the VRDE internally
|
---|
58 | * uses negative values to mark some operations.
|
---|
59 | */
|
---|
60 | #define VRDE_ORDER_DIRTY_RECT (0)
|
---|
61 | #define VRDE_ORDER_SOLIDRECT (1)
|
---|
62 | #define VRDE_ORDER_SOLIDBLT (2)
|
---|
63 | #define VRDE_ORDER_DSTBLT (3)
|
---|
64 | #define VRDE_ORDER_SCREENBLT (4)
|
---|
65 | #define VRDE_ORDER_PATBLTBRUSH (5)
|
---|
66 | #define VRDE_ORDER_MEMBLT (6)
|
---|
67 | #define VRDE_ORDER_CACHED_BITMAP (7)
|
---|
68 | #define VRDE_ORDER_DELETED_BITMAP (8)
|
---|
69 | #define VRDE_ORDER_LINE (9)
|
---|
70 | #define VRDE_ORDER_BOUNDS (10)
|
---|
71 | #define VRDE_ORDER_REPEAT (11)
|
---|
72 | #define VRDE_ORDER_POLYLINE (12)
|
---|
73 | #define VRDE_ORDER_ELLIPSE (13)
|
---|
74 | #define VRDE_ORDER_SAVESCREEN (14)
|
---|
75 | #define VRDE_ORDER_TEXT (15)
|
---|
76 |
|
---|
77 | /* 128 bit bitmap hash. */
|
---|
78 | typedef uint8_t VRDEBITMAPHASH[16];
|
---|
79 |
|
---|
80 | #pragma pack(1)
|
---|
81 | typedef struct _VRDEORDERHDR
|
---|
82 | {
|
---|
83 | /** Coordinates of the affected rectangle. */
|
---|
84 | int16_t x;
|
---|
85 | int16_t y;
|
---|
86 | uint16_t w;
|
---|
87 | uint16_t h;
|
---|
88 | } VRDEORDERHDR;
|
---|
89 |
|
---|
90 | typedef struct _VRDEORDERCODE
|
---|
91 | {
|
---|
92 | uint32_t u32Code;
|
---|
93 | } VRDEORDERCODE;
|
---|
94 |
|
---|
95 | typedef struct _VRDEORDERPOINT
|
---|
96 | {
|
---|
97 | int16_t x;
|
---|
98 | int16_t y;
|
---|
99 | } VRDEORDERPOINT;
|
---|
100 |
|
---|
101 | typedef struct _VRDEORDERPOLYPOINTS
|
---|
102 | {
|
---|
103 | uint8_t c;
|
---|
104 | VRDEORDERPOINT a[16];
|
---|
105 | } VRDEORDERPOLYPOINTS;
|
---|
106 |
|
---|
107 | typedef struct _VRDEORDERAREA
|
---|
108 | {
|
---|
109 | int16_t x;
|
---|
110 | int16_t y;
|
---|
111 | uint16_t w;
|
---|
112 | uint16_t h;
|
---|
113 | } VRDEORDERAREA;
|
---|
114 |
|
---|
115 | typedef struct _VRDEORDERRECT
|
---|
116 | {
|
---|
117 | int16_t left;
|
---|
118 | int16_t top;
|
---|
119 | int16_t right;
|
---|
120 | int16_t bottom;
|
---|
121 | } VRDEORDERRECT;
|
---|
122 |
|
---|
123 |
|
---|
124 | typedef struct _VRDEORDERBOUNDS
|
---|
125 | {
|
---|
126 | VRDEORDERPOINT pt1;
|
---|
127 | VRDEORDERPOINT pt2;
|
---|
128 | } VRDEORDERBOUNDS;
|
---|
129 |
|
---|
130 | typedef struct _VRDEORDERREPEAT
|
---|
131 | {
|
---|
132 | VRDEORDERBOUNDS bounds;
|
---|
133 | } VRDEORDERREPEAT;
|
---|
134 |
|
---|
135 |
|
---|
136 | /* Header for bitmap bits. */
|
---|
137 | typedef struct _VRDEDATABITS
|
---|
138 | {
|
---|
139 | uint32_t cb; /* Size of bitmap data without the header. */
|
---|
140 | int16_t x;
|
---|
141 | int16_t y;
|
---|
142 | uint16_t cWidth;
|
---|
143 | uint16_t cHeight;
|
---|
144 | uint8_t cbPixel;
|
---|
145 | /* Bitmap data follow. */
|
---|
146 | } VRDEDATABITS;
|
---|
147 |
|
---|
148 | typedef struct _VRDEORDERSOLIDRECT
|
---|
149 | {
|
---|
150 | int16_t x;
|
---|
151 | int16_t y;
|
---|
152 | uint16_t w;
|
---|
153 | uint16_t h;
|
---|
154 | uint32_t rgb;
|
---|
155 | } VRDEORDERSOLIDRECT;
|
---|
156 |
|
---|
157 | typedef struct _VRDEORDERSOLIDBLT
|
---|
158 | {
|
---|
159 | int16_t x;
|
---|
160 | int16_t y;
|
---|
161 | uint16_t w;
|
---|
162 | uint16_t h;
|
---|
163 | uint32_t rgb;
|
---|
164 | uint8_t rop;
|
---|
165 | } VRDEORDERSOLIDBLT;
|
---|
166 |
|
---|
167 | typedef struct _VRDEORDERDSTBLT
|
---|
168 | {
|
---|
169 | int16_t x;
|
---|
170 | int16_t y;
|
---|
171 | uint16_t w;
|
---|
172 | uint16_t h;
|
---|
173 | uint8_t rop;
|
---|
174 | } VRDEORDERDSTBLT;
|
---|
175 |
|
---|
176 | typedef struct _VRDEORDERSCREENBLT
|
---|
177 | {
|
---|
178 | int16_t x;
|
---|
179 | int16_t y;
|
---|
180 | uint16_t w;
|
---|
181 | uint16_t h;
|
---|
182 | int16_t xSrc;
|
---|
183 | int16_t ySrc;
|
---|
184 | uint8_t rop;
|
---|
185 | } VRDEORDERSCREENBLT;
|
---|
186 |
|
---|
187 | typedef struct _VRDEORDERPATBLTBRUSH
|
---|
188 | {
|
---|
189 | int16_t x;
|
---|
190 | int16_t y;
|
---|
191 | uint16_t w;
|
---|
192 | uint16_t h;
|
---|
193 | int8_t xSrc;
|
---|
194 | int8_t ySrc;
|
---|
195 | uint32_t rgbFG;
|
---|
196 | uint32_t rgbBG;
|
---|
197 | uint8_t rop;
|
---|
198 | uint8_t pattern[8];
|
---|
199 | } VRDEORDERPATBLTBRUSH;
|
---|
200 |
|
---|
201 | typedef struct _VRDEORDERMEMBLT
|
---|
202 | {
|
---|
203 | int16_t x;
|
---|
204 | int16_t y;
|
---|
205 | uint16_t w;
|
---|
206 | uint16_t h;
|
---|
207 | int16_t xSrc;
|
---|
208 | int16_t ySrc;
|
---|
209 | uint8_t rop;
|
---|
210 | VRDEBITMAPHASH hash;
|
---|
211 | } VRDEORDERMEMBLT;
|
---|
212 |
|
---|
213 | typedef struct _VRDEORDERCACHEDBITMAP
|
---|
214 | {
|
---|
215 | VRDEBITMAPHASH hash;
|
---|
216 | /* VRDEDATABITS and the bitmap data follow. */
|
---|
217 | } VRDEORDERCACHEDBITMAP;
|
---|
218 |
|
---|
219 | typedef struct _VRDEORDERDELETEDBITMAP
|
---|
220 | {
|
---|
221 | VRDEBITMAPHASH hash;
|
---|
222 | } VRDEORDERDELETEDBITMAP;
|
---|
223 |
|
---|
224 | typedef struct _VRDEORDERLINE
|
---|
225 | {
|
---|
226 | int16_t x1;
|
---|
227 | int16_t y1;
|
---|
228 | int16_t x2;
|
---|
229 | int16_t y2;
|
---|
230 | int16_t xBounds1;
|
---|
231 | int16_t yBounds1;
|
---|
232 | int16_t xBounds2;
|
---|
233 | int16_t yBounds2;
|
---|
234 | uint8_t mix;
|
---|
235 | uint32_t rgb;
|
---|
236 | } VRDEORDERLINE;
|
---|
237 |
|
---|
238 | typedef struct _VRDEORDERPOLYLINE
|
---|
239 | {
|
---|
240 | VRDEORDERPOINT ptStart;
|
---|
241 | uint8_t mix;
|
---|
242 | uint32_t rgb;
|
---|
243 | VRDEORDERPOLYPOINTS points;
|
---|
244 | } VRDEORDERPOLYLINE;
|
---|
245 |
|
---|
246 | typedef struct _VRDEORDERELLIPSE
|
---|
247 | {
|
---|
248 | VRDEORDERPOINT pt1;
|
---|
249 | VRDEORDERPOINT pt2;
|
---|
250 | uint8_t mix;
|
---|
251 | uint8_t fillMode;
|
---|
252 | uint32_t rgb;
|
---|
253 | } VRDEORDERELLIPSE;
|
---|
254 |
|
---|
255 | typedef struct _VRDEORDERSAVESCREEN
|
---|
256 | {
|
---|
257 | VRDEORDERPOINT pt1;
|
---|
258 | VRDEORDERPOINT pt2;
|
---|
259 | uint8_t ident;
|
---|
260 | uint8_t restore;
|
---|
261 | } VRDEORDERSAVESCREEN;
|
---|
262 |
|
---|
263 | typedef struct _VRDEORDERGLYPH
|
---|
264 | {
|
---|
265 | uint32_t o32NextGlyph;
|
---|
266 | uint64_t u64Handle;
|
---|
267 |
|
---|
268 | /* The glyph origin position on the screen. */
|
---|
269 | int16_t x;
|
---|
270 | int16_t y;
|
---|
271 |
|
---|
272 | /* The glyph bitmap dimensions. Note w == h == 0 for the space character. */
|
---|
273 | uint16_t w;
|
---|
274 | uint16_t h;
|
---|
275 |
|
---|
276 | /* The character origin in the bitmap. */
|
---|
277 | int16_t xOrigin;
|
---|
278 | int16_t yOrigin;
|
---|
279 |
|
---|
280 | /* 1BPP bitmap. Rows are byte aligned. Size is (((w + 7)/8) * h + 3) & ~3. */
|
---|
281 | uint8_t au8Bitmap[1];
|
---|
282 | } VRDEORDERGLYPH;
|
---|
283 |
|
---|
284 | typedef struct _VRDEORDERTEXT
|
---|
285 | {
|
---|
286 | uint32_t cbOrder;
|
---|
287 |
|
---|
288 | int16_t xBkGround;
|
---|
289 | int16_t yBkGround;
|
---|
290 | uint16_t wBkGround;
|
---|
291 | uint16_t hBkGround;
|
---|
292 |
|
---|
293 | int16_t xOpaque;
|
---|
294 | int16_t yOpaque;
|
---|
295 | uint16_t wOpaque;
|
---|
296 | uint16_t hOpaque;
|
---|
297 |
|
---|
298 | uint16_t u16MaxGlyph;
|
---|
299 |
|
---|
300 | uint8_t u8Glyphs;
|
---|
301 | uint8_t u8Flags;
|
---|
302 | uint16_t u8CharInc;
|
---|
303 | uint32_t u32FgRGB;
|
---|
304 | uint32_t u32BgRGB;
|
---|
305 |
|
---|
306 | /* u8Glyphs glyphs follow. Size of each glyph structure may vary. */
|
---|
307 | } VRDEORDERTEXT;
|
---|
308 | #pragma pack()
|
---|
309 |
|
---|
310 | #endif /* !VBOX_INCLUDED_RemoteDesktop_VRDEOrders_h */
|
---|