Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / include / freerdp / primary.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * Primary Drawing Orders Interface API
4  *
5  * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __UPDATE_PRIMARY_H
21 #define __UPDATE_PRIMARY_H
22
23 #include <freerdp/types.h>
24
25 struct rdp_bounds
26 {
27         sint32 left;
28         sint32 top;
29         sint32 right;
30         sint32 bottom;
31 };
32 typedef struct rdp_bounds rdpBounds;
33
34 struct rdp_brush
35 {
36         uint32 x;
37         uint32 y;
38         uint32 bpp;
39         uint32 style;
40         uint32 hatch;
41         uint32 index;
42         uint8* data;
43         uint8 p8x8[8];
44 };
45 typedef struct rdp_brush rdpBrush;
46
47 struct _ORDER_INFO
48 {
49         uint32 orderType;
50         uint32 fieldFlags;
51         rdpBounds bounds;
52         sint32 deltaBoundLeft;
53         sint32 deltaBoundTop;
54         sint32 deltaBoundRight;
55         sint32 deltaBoundBottom;
56         boolean deltaCoordinates;
57 };
58 typedef struct _ORDER_INFO ORDER_INFO;
59
60 struct _DSTBLT_ORDER
61 {
62         sint32 nLeftRect;
63         sint32 nTopRect;
64         sint32 nWidth;
65         sint32 nHeight;
66         uint32 bRop;
67 };
68 typedef struct _DSTBLT_ORDER DSTBLT_ORDER;
69
70 struct _PATBLT_ORDER
71 {
72         sint32 nLeftRect;
73         sint32 nTopRect;
74         sint32 nWidth;
75         sint32 nHeight;
76         uint32 bRop;
77         uint32 backColor;
78         uint32 foreColor;
79         rdpBrush brush;
80 };
81 typedef struct _PATBLT_ORDER PATBLT_ORDER;
82
83 struct _SCRBLT_ORDER
84 {
85         sint32 nLeftRect;
86         sint32 nTopRect;
87         sint32 nWidth;
88         sint32 nHeight;
89         uint32 bRop;
90         sint32 nXSrc;
91         sint32 nYSrc;
92 };
93 typedef struct _SCRBLT_ORDER SCRBLT_ORDER;
94
95 struct _OPAQUE_RECT_ORDER
96 {
97         sint32 nLeftRect;
98         sint32 nTopRect;
99         sint32 nWidth;
100         sint32 nHeight;
101         uint32 color;
102 };
103 typedef struct _OPAQUE_RECT_ORDER OPAQUE_RECT_ORDER;
104
105 struct _DRAW_NINE_GRID_ORDER
106 {
107         sint32 srcLeft;
108         sint32 srcTop;
109         sint32 srcRight;
110         sint32 srcBottom;
111         uint32 bitmapId;
112 };
113 typedef struct _DRAW_NINE_GRID_ORDER DRAW_NINE_GRID_ORDER;
114
115 struct _DELTA_RECT
116 {
117         sint32 left;
118         sint32 top;
119         sint32 width;
120         sint32 height;
121 };
122 typedef struct _DELTA_RECT DELTA_RECT;
123
124 struct _MULTI_DSTBLT_ORDER
125 {
126         sint32 nLeftRect;
127         sint32 nTopRect;
128         sint32 nWidth;
129         sint32 nHeight;
130         uint32 bRop;
131         uint32 numRectangles;
132         uint32 cbData;
133         DELTA_RECT rectangles[45];
134 };
135 typedef struct _MULTI_DSTBLT_ORDER MULTI_DSTBLT_ORDER;
136
137 struct _MULTI_PATBLT_ORDER
138 {
139         sint32 nLeftRect;
140         sint32 nTopRect;
141         sint32 nWidth;
142         sint32 nHeight;
143         uint32 bRop;
144         uint32 backColor;
145         uint32 foreColor;
146         rdpBrush brush;
147         uint32 numRectangles;
148         uint32 cbData;
149         DELTA_RECT rectangles[45];
150 };
151 typedef struct _MULTI_PATBLT_ORDER MULTI_PATBLT_ORDER;
152
153 struct _MULTI_SCRBLT_ORDER
154 {
155         sint32 nLeftRect;
156         sint32 nTopRect;
157         sint32 nWidth;
158         sint32 nHeight;
159         uint32 bRop;
160         sint32 nXSrc;
161         sint32 nYSrc;
162         uint32 numRectangles;
163         uint32 cbData;
164         DELTA_RECT rectangles[45];
165 };
166 typedef struct _MULTI_SCRBLT_ORDER MULTI_SCRBLT_ORDER;
167
168 struct _MULTI_OPAQUE_RECT_ORDER
169 {
170         sint32 nLeftRect;
171         sint32 nTopRect;
172         sint32 nWidth;
173         sint32 nHeight;
174         uint32 color;
175         uint32 numRectangles;
176         uint32 cbData;
177         DELTA_RECT rectangles[45];
178 };
179 typedef struct _MULTI_OPAQUE_RECT_ORDER MULTI_OPAQUE_RECT_ORDER;
180
181 struct _MULTI_DRAW_NINE_GRID_ORDER
182 {
183         sint32 srcLeft;
184         sint32 srcTop;
185         sint32 srcRight;
186         sint32 srcBottom;
187         uint32 bitmapId;
188         uint32 nDeltaEntries;
189         uint32 cbData;
190         uint8* codeDeltaList;
191 };
192 typedef struct _MULTI_DRAW_NINE_GRID_ORDER MULTI_DRAW_NINE_GRID_ORDER;
193
194 struct _LINE_TO_ORDER
195 {
196         uint32 backMode;
197         sint32 nXStart;
198         sint32 nYStart;
199         sint32 nXEnd;
200         sint32 nYEnd;
201         uint32 backColor;
202         uint32 bRop2;
203         uint32 penStyle;
204         uint32 penWidth;
205         uint32 penColor;
206 };
207 typedef struct _LINE_TO_ORDER LINE_TO_ORDER;
208
209 struct _DELTA_POINT
210 {
211         sint32 x;
212         sint32 y;
213 };
214 typedef struct _DELTA_POINT DELTA_POINT;
215
216 struct _POLYLINE_ORDER
217 {
218         sint32 xStart;
219         sint32 yStart;
220         uint32 bRop2;
221         uint32 penColor;
222         uint32 numPoints;
223         uint32 cbData;
224         DELTA_POINT* points;
225 };
226 typedef struct _POLYLINE_ORDER POLYLINE_ORDER;
227
228 struct _MEMBLT_ORDER
229 {
230         uint32 cacheId;
231         uint32 colorIndex;
232         sint32 nLeftRect;
233         sint32 nTopRect;
234         sint32 nWidth;
235         sint32 nHeight;
236         uint32 bRop;
237         sint32 nXSrc;
238         sint32 nYSrc;
239         uint32 cacheIndex;
240         rdpBitmap* bitmap;
241 };
242 typedef struct _MEMBLT_ORDER MEMBLT_ORDER;
243
244 struct _MEM3BLT_ORDER
245 {
246         uint32 cacheId;
247         uint32 colorIndex;
248         sint32 nLeftRect;
249         sint32 nTopRect;
250         sint32 nWidth;
251         sint32 nHeight;
252         uint32 bRop;
253         sint32 nXSrc;
254         sint32 nYSrc;
255         uint32 backColor;
256         uint32 foreColor;
257         rdpBrush brush;
258         uint32 cacheIndex;
259         rdpBitmap* bitmap;
260 };
261 typedef struct _MEM3BLT_ORDER MEM3BLT_ORDER;
262
263 struct _SAVE_BITMAP_ORDER
264 {
265         uint32 savedBitmapPosition;
266         sint32 nLeftRect;
267         sint32 nTopRect;
268         sint32 nRightRect;
269         sint32 nBottomRect;
270         uint32 operation;
271 };
272 typedef struct _SAVE_BITMAP_ORDER SAVE_BITMAP_ORDER;
273
274 struct _GLYPH_FRAGMENT_INDEX
275 {
276         uint32 index;
277         uint32 delta;
278 };
279 typedef struct _GLYPH_FRAGMENT_INDEX GLYPH_FRAGMENT_INDEX;
280
281 struct _GLYPH_FRAGMENT
282 {
283         uint32 operation;
284         uint32 index;
285         uint32 size;
286         uint32 nindices;
287         GLYPH_FRAGMENT_INDEX* indices;
288 };
289 typedef struct _GLYPH_FRAGMENT GLYPH_FRAGMENT;
290
291 struct _GLYPH_INDEX_ORDER
292 {
293         uint32 cacheId;
294         uint32 flAccel;
295         uint32 ulCharInc;
296         uint32 fOpRedundant;
297         uint32 backColor;
298         uint32 foreColor;
299         sint32 bkLeft;
300         sint32 bkTop;
301         sint32 bkRight;
302         sint32 bkBottom;
303         sint32 opLeft;
304         sint32 opTop;
305         sint32 opRight;
306         sint32 opBottom;
307         rdpBrush brush;
308         sint32 x;
309         sint32 y;
310         uint32 cbData;
311         uint8 data[256];
312 };
313 typedef struct _GLYPH_INDEX_ORDER GLYPH_INDEX_ORDER;
314
315 struct _FAST_INDEX_ORDER
316 {
317         uint32 cacheId;
318         uint32 flAccel;
319         uint32 ulCharInc;
320         uint32 backColor;
321         uint32 foreColor;
322         sint32 bkLeft;
323         sint32 bkTop;
324         sint32 bkRight;
325         sint32 bkBottom;
326         sint32 opLeft;
327         sint32 opTop;
328         sint32 opRight;
329         sint32 opBottom;
330         boolean opaqueRect;
331         sint32 x;
332         sint32 y;
333         uint32 cbData;
334         uint8 data[256];
335 };
336 typedef struct _FAST_INDEX_ORDER FAST_INDEX_ORDER;
337
338 struct _FAST_GLYPH_ORDER
339 {
340         uint32 cacheId;
341         uint32 flAccel;
342         uint32 ulCharInc;
343         uint32 backColor;
344         uint32 foreColor;
345         sint32 bkLeft;
346         sint32 bkTop;
347         sint32 bkRight;
348         sint32 bkBottom;
349         sint32 opLeft;
350         sint32 opTop;
351         sint32 opRight;
352         sint32 opBottom;
353         sint32 x;
354         sint32 y;
355         uint32 cbData;
356         uint8 data[256];
357         void* glyph_data;
358 };
359 typedef struct _FAST_GLYPH_ORDER FAST_GLYPH_ORDER;
360
361 struct _POLYGON_SC_ORDER
362 {
363         sint32 xStart;
364         sint32 yStart;
365         uint32 bRop2;
366         uint32 fillMode;
367         uint32 brushColor;
368         uint32 nDeltaEntries;
369         uint32 cbData;
370         uint8* codeDeltaList;
371 };
372 typedef struct _POLYGON_SC_ORDER POLYGON_SC_ORDER;
373
374 struct _POLYGON_CB_ORDER
375 {
376         sint32 xStart;
377         sint32 yStart;
378         uint32 bRop2;
379         uint32 fillMode;
380         uint32 backColor;
381         uint32 foreColor;
382         rdpBrush brush;
383         uint32 nDeltaEntries;
384         uint32 cbData;
385         uint8* codeDeltaList;
386 };
387 typedef struct _POLYGON_CB_ORDER POLYGON_CB_ORDER;
388
389 struct _ELLIPSE_SC_ORDER
390 {
391         sint32 leftRect;
392         sint32 topRect;
393         sint32 rightRect;
394         sint32 bottomRect;
395         uint32 bRop2;
396         uint32 fillMode;
397         uint32 color;
398 };
399 typedef struct _ELLIPSE_SC_ORDER ELLIPSE_SC_ORDER;
400
401 struct _ELLIPSE_CB_ORDER
402 {
403         sint32 leftRect;
404         sint32 topRect;
405         sint32 rightRect;
406         sint32 bottomRect;
407         uint32 bRop2;
408         uint32 fillMode;
409         uint32 backColor;
410         uint32 foreColor;
411         rdpBrush brush;
412 };
413 typedef struct _ELLIPSE_CB_ORDER ELLIPSE_CB_ORDER;
414
415 typedef void (*pDstBlt)(rdpContext* context, DSTBLT_ORDER* dstblt);
416 typedef void (*pPatBlt)(rdpContext* context, PATBLT_ORDER* patblt);
417 typedef void (*pScrBlt)(rdpContext* context, SCRBLT_ORDER* scrblt);
418 typedef void (*pOpaqueRect)(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect);
419 typedef void (*pDrawNineGrid)(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_grid);
420 typedef void (*pMultiDstBlt)(rdpContext* context, MULTI_DSTBLT_ORDER* multi_dstblt);
421 typedef void (*pMultiPatBlt)(rdpContext* context, MULTI_PATBLT_ORDER* multi_patblt);
422 typedef void (*pMultiScrBlt)(rdpContext* context, MULTI_SCRBLT_ORDER* multi_scrblt);
423 typedef void (*pMultiOpaqueRect)(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect);
424 typedef void (*pMultiDrawNineGrid)(rdpContext* context, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid);
425 typedef void (*pLineTo)(rdpContext* context, LINE_TO_ORDER* line_to);
426 typedef void (*pPolyline)(rdpContext* context, POLYLINE_ORDER* polyline);
427 typedef void (*pMemBlt)(rdpContext* context, MEMBLT_ORDER* memblt);
428 typedef void (*pMem3Blt)(rdpContext* context, MEM3BLT_ORDER* memblt);
429 typedef void (*pSaveBitmap)(rdpContext* context, SAVE_BITMAP_ORDER* save_bitmap);
430 typedef void (*pGlyphIndex)(rdpContext* context, GLYPH_INDEX_ORDER* glyph_index);
431 typedef void (*pFastIndex)(rdpContext* context, FAST_INDEX_ORDER* fast_index);
432 typedef void (*pFastGlyph)(rdpContext* context, FAST_GLYPH_ORDER* fast_glyph);
433 typedef void (*pPolygonSC)(rdpContext* context, POLYGON_SC_ORDER* polygon_sc);
434 typedef void (*pPolygonCB)(rdpContext* context, POLYGON_CB_ORDER* polygon_cb);
435 typedef void (*pEllipseSC)(rdpContext* context, ELLIPSE_SC_ORDER* ellipse_sc);
436 typedef void (*pEllipseCB)(rdpContext* context, ELLIPSE_CB_ORDER* ellipse_cb);
437
438 struct rdp_primary_update
439 {
440         rdpContext* context; /* 0 */
441         uint32 paddingA[16 - 1]; /* 1 */
442
443         pDstBlt DstBlt; /* 16 */
444         pPatBlt PatBlt; /* 17 */
445         pScrBlt ScrBlt; /* 18 */
446         pOpaqueRect OpaqueRect; /* 19 */
447         pDrawNineGrid DrawNineGrid; /* 20 */
448         pMultiDstBlt MultiDstBlt; /* 21 */
449         pMultiPatBlt MultiPatBlt; /* 22 */
450         pMultiScrBlt MultiScrBlt; /* 23 */
451         pMultiOpaqueRect MultiOpaqueRect; /* 24 */
452         pMultiDrawNineGrid MultiDrawNineGrid; /* 25 */
453         pLineTo LineTo; /* 26 */
454         pPolyline Polyline; /* 27 */
455         pMemBlt MemBlt; /* 28 */
456         pMem3Blt Mem3Blt; /* 29 */
457         pSaveBitmap SaveBitmap; /* 30 */
458         pGlyphIndex GlyphIndex; /* 31 */
459         pFastIndex FastIndex; /* 32 */
460         pFastGlyph FastGlyph; /* 33 */
461         pPolygonSC PolygonSC; /* 34 */
462         pPolygonCB PolygonCB; /* 35 */
463         pEllipseSC EllipseSC; /* 36 */
464         pEllipseCB EllipseCB; /* 37 */
465         uint32 paddingB[48 - 38]; /* 38 */
466
467         /* internal */
468
469         ORDER_INFO order_info;
470         DSTBLT_ORDER dstblt;
471         PATBLT_ORDER patblt;
472         SCRBLT_ORDER scrblt;
473         OPAQUE_RECT_ORDER opaque_rect;
474         DRAW_NINE_GRID_ORDER draw_nine_grid;
475         MULTI_DSTBLT_ORDER multi_dstblt;
476         MULTI_PATBLT_ORDER multi_patblt;
477         MULTI_SCRBLT_ORDER multi_scrblt;
478         MULTI_OPAQUE_RECT_ORDER multi_opaque_rect;
479         MULTI_DRAW_NINE_GRID_ORDER multi_draw_nine_grid;
480         LINE_TO_ORDER line_to;
481         POLYLINE_ORDER polyline;
482         MEMBLT_ORDER memblt;
483         MEM3BLT_ORDER mem3blt;
484         SAVE_BITMAP_ORDER save_bitmap;
485         GLYPH_INDEX_ORDER glyph_index;
486         FAST_INDEX_ORDER fast_index;
487         FAST_GLYPH_ORDER fast_glyph;
488         POLYGON_SC_ORDER polygon_sc;
489         POLYGON_CB_ORDER polygon_cb;
490         ELLIPSE_SC_ORDER ellipse_sc;
491         ELLIPSE_CB_ORDER ellipse_cb;
492 };
493 typedef struct rdp_primary_update rdpPrimaryUpdate;
494
495 #endif /* __UPDATE_PRIMARY_H */