22 #ifndef FREERDP_LIB_CORE_ORDERS_H
23 #define FREERDP_LIB_CORE_ORDERS_H
27 #include <freerdp/types.h>
28 #include <freerdp/update.h>
29 #include <freerdp/api.h>
31 #include <winpr/stream.h>
34 #define ORDER_STANDARD 0x01
35 #define ORDER_SECONDARY 0x02
36 #define ORDER_BOUNDS 0x04
37 #define ORDER_TYPE_CHANGE 0x08
38 #define ORDER_DELTA_COORDINATES 0x10
39 #define ORDER_ZERO_BOUNDS_DELTAS 0x20
40 #define ORDER_ZERO_FIELD_BYTE_BIT0 0x40
41 #define ORDER_ZERO_FIELD_BYTE_BIT1 0x80
44 #define BOUND_LEFT 0x01
45 #define BOUND_TOP 0x02
46 #define BOUND_RIGHT 0x04
47 #define BOUND_BOTTOM 0x08
48 #define BOUND_DELTA_LEFT 0x10
49 #define BOUND_DELTA_TOP 0x20
50 #define BOUND_DELTA_RIGHT 0x40
51 #define BOUND_DELTA_BOTTOM 0x80
54 #define ORDER_FIELD_01 0x000001
55 #define ORDER_FIELD_02 0x000002
56 #define ORDER_FIELD_03 0x000004
57 #define ORDER_FIELD_04 0x000008
58 #define ORDER_FIELD_05 0x000010
59 #define ORDER_FIELD_06 0x000020
60 #define ORDER_FIELD_07 0x000040
61 #define ORDER_FIELD_08 0x000080
62 #define ORDER_FIELD_09 0x000100
63 #define ORDER_FIELD_10 0x000200
64 #define ORDER_FIELD_11 0x000400
65 #define ORDER_FIELD_12 0x000800
66 #define ORDER_FIELD_13 0x001000
67 #define ORDER_FIELD_14 0x002000
68 #define ORDER_FIELD_15 0x004000
69 #define ORDER_FIELD_16 0x008000
70 #define ORDER_FIELD_17 0x010000
71 #define ORDER_FIELD_18 0x020000
72 #define ORDER_FIELD_19 0x040000
73 #define ORDER_FIELD_20 0x080000
74 #define ORDER_FIELD_21 0x100000
75 #define ORDER_FIELD_22 0x200000
76 #define ORDER_FIELD_23 0x400000
80 #define CBR2_16BPP 0x4
81 #define CBR2_24BPP 0x5
82 #define CBR2_32BPP 0x6
84 #define CBR23_8BPP 0x3
85 #define CBR23_16BPP 0x4
86 #define CBR23_24BPP 0x5
87 #define CBR23_32BPP 0x6
89 #define CBR3_IGNORABLE_FLAG 0x08
90 #define CBR3_DO_NOT_CACHE 0x10
93 #define ORDER_TYPE_DSTBLT 0x00
94 #define ORDER_TYPE_PATBLT 0x01
95 #define ORDER_TYPE_SCRBLT 0x02
96 #define ORDER_TYPE_DRAW_NINE_GRID 0x07
97 #define ORDER_TYPE_MULTI_DRAW_NINE_GRID 0x08
98 #define ORDER_TYPE_LINE_TO 0x09
99 #define ORDER_TYPE_OPAQUE_RECT 0x0A
100 #define ORDER_TYPE_SAVE_BITMAP 0x0B
101 #define ORDER_TYPE_MEMBLT 0x0D
102 #define ORDER_TYPE_MEM3BLT 0x0E
103 #define ORDER_TYPE_MULTI_DSTBLT 0x0F
104 #define ORDER_TYPE_MULTI_PATBLT 0x10
105 #define ORDER_TYPE_MULTI_SCRBLT 0x11
106 #define ORDER_TYPE_MULTI_OPAQUE_RECT 0x12
107 #define ORDER_TYPE_FAST_INDEX 0x13
108 #define ORDER_TYPE_POLYGON_SC 0x14
109 #define ORDER_TYPE_POLYGON_CB 0x15
110 #define ORDER_TYPE_POLYLINE 0x16
111 #define ORDER_TYPE_FAST_GLYPH 0x18
112 #define ORDER_TYPE_ELLIPSE_SC 0x19
113 #define ORDER_TYPE_ELLIPSE_CB 0x1A
114 #define ORDER_TYPE_GLYPH_INDEX 0x1B
117 #define DSTBLT_ORDER_FIELDS 5
118 #define PATBLT_ORDER_FIELDS 12
119 #define SCRBLT_ORDER_FIELDS 7
120 #define DRAW_NINE_GRID_ORDER_FIELDS 5
121 #define MULTI_DRAW_NINE_GRID_ORDER_FIELDS 7
122 #define LINE_TO_ORDER_FIELDS 10
123 #define OPAQUE_RECT_ORDER_FIELDS 7
124 #define SAVE_BITMAP_ORDER_FIELDS 6
125 #define MEMBLT_ORDER_FIELDS 9
126 #define MEM3BLT_ORDER_FIELDS 16
127 #define MULTI_DSTBLT_ORDER_FIELDS 7
128 #define MULTI_PATBLT_ORDER_FIELDS 14
129 #define MULTI_SCRBLT_ORDER_FIELDS 9
130 #define MULTI_OPAQUE_RECT_ORDER_FIELDS 9
131 #define FAST_INDEX_ORDER_FIELDS 15
132 #define POLYGON_SC_ORDER_FIELDS 7
133 #define POLYGON_CB_ORDER_FIELDS 13
134 #define POLYLINE_ORDER_FIELDS 7
135 #define FAST_GLYPH_ORDER_FIELDS 15
136 #define ELLIPSE_SC_ORDER_FIELDS 7
137 #define ELLIPSE_CB_ORDER_FIELDS 13
138 #define GLYPH_INDEX_ORDER_FIELDS 22
141 #define DSTBLT_ORDER_FIELD_BYTES 1
142 #define PATBLT_ORDER_FIELD_BYTES 2
143 #define SCRBLT_ORDER_FIELD_BYTES 1
144 #define DRAW_NINE_GRID_ORDER_FIELD_BYTES 1
145 #define MULTI_DRAW_NINE_GRID_ORDER_FIELD_BYTES 1
146 #define LINE_TO_ORDER_FIELD_BYTES 2
147 #define OPAQUE_RECT_ORDER_FIELD_BYTES 1
148 #define SAVE_BITMAP_ORDER_FIELD_BYTES 1
149 #define MEMBLT_ORDER_FIELD_BYTES 2
150 #define MEM3BLT_ORDER_FIELD_BYTES 3
151 #define MULTI_DSTBLT_ORDER_FIELD_BYTES 1
152 #define MULTI_PATBLT_ORDER_FIELD_BYTES 2
153 #define MULTI_SCRBLT_ORDER_FIELD_BYTES 2
154 #define MULTI_OPAQUE_RECT_ORDER_FIELD_BYTES 2
155 #define FAST_INDEX_ORDER_FIELD_BYTES 2
156 #define POLYGON_SC_ORDER_FIELD_BYTES 1
157 #define POLYGON_CB_ORDER_FIELD_BYTES 2
158 #define POLYLINE_ORDER_FIELD_BYTES 1
159 #define FAST_GLYPH_ORDER_FIELD_BYTES 2
160 #define ELLIPSE_SC_ORDER_FIELD_BYTES 1
161 #define ELLIPSE_CB_ORDER_FIELD_BYTES 2
162 #define GLYPH_INDEX_ORDER_FIELD_BYTES 3
165 #define ORDER_TYPE_BITMAP_UNCOMPRESSED 0x00
166 #define ORDER_TYPE_CACHE_COLOR_TABLE 0x01
167 #define ORDER_TYPE_CACHE_BITMAP_COMPRESSED 0x02
168 #define ORDER_TYPE_CACHE_GLYPH 0x03
169 #define ORDER_TYPE_BITMAP_UNCOMPRESSED_V2 0x04
170 #define ORDER_TYPE_BITMAP_COMPRESSED_V2 0x05
171 #define ORDER_TYPE_CACHE_BRUSH 0x07
172 #define ORDER_TYPE_BITMAP_COMPRESSED_V3 0x08
175 #define ORDER_TYPE_SWITCH_SURFACE 0x00
176 #define ORDER_TYPE_CREATE_OFFSCREEN_BITMAP 0x01
177 #define ORDER_TYPE_STREAM_BITMAP_FIRST 0x02
178 #define ORDER_TYPE_STREAM_BITMAP_NEXT 0x03
179 #define ORDER_TYPE_CREATE_NINE_GRID_BITMAP 0x04
180 #define ORDER_TYPE_GDIPLUS_FIRST 0x05
181 #define ORDER_TYPE_GDIPLUS_NEXT 0x06
182 #define ORDER_TYPE_GDIPLUS_END 0x07
183 #define ORDER_TYPE_GDIPLUS_CACHE_FIRST 0x08
184 #define ORDER_TYPE_GDIPLUS_CACHE_NEXT 0x09
185 #define ORDER_TYPE_GDIPLUS_CACHE_END 0x0A
186 #define ORDER_TYPE_WINDOW 0x0B
187 #define ORDER_TYPE_COMPDESK_FIRST 0x0C
188 #define ORDER_TYPE_FRAME_MARKER 0x0D
190 #define CG_GLYPH_UNICODE_PRESENT 0x0010
192 FREERDP_LOCAL BYTE get_primary_drawing_order_field_bytes(UINT32 orderType, BOOL* pValid);
194 FREERDP_LOCAL BOOL update_recv_order(rdpUpdate* update,
wStream* s);
196 FREERDP_LOCAL BOOL update_write_field_flags(
wStream* s, UINT32 fieldFlags, BYTE flags,
201 FREERDP_LOCAL
size_t update_approximate_dstblt_order(
ORDER_INFO* orderInfo,
210 FREERDP_LOCAL
size_t update_approximate_scrblt_order(
ORDER_INFO* orderInfo,
215 FREERDP_LOCAL
size_t update_approximate_opaque_rect_order(
ORDER_INFO* orderInfo,
217 FREERDP_LOCAL BOOL update_write_opaque_rect_order(
wStream* s,
ORDER_INFO* orderInfo,
220 FREERDP_LOCAL
size_t update_approximate_line_to_order(
ORDER_INFO* orderInfo,
225 FREERDP_LOCAL
size_t update_approximate_memblt_order(
ORDER_INFO* orderInfo,
230 FREERDP_LOCAL
size_t update_approximate_glyph_index_order(
ORDER_INFO* orderInfo,
232 FREERDP_LOCAL BOOL update_write_glyph_index_order(
wStream* s,
ORDER_INFO* orderInfo,
235 FREERDP_LOCAL
size_t update_approximate_cache_bitmap_order(
const CACHE_BITMAP_ORDER* cache_bitmap,
236 BOOL compressed,
const UINT16* flags);
237 FREERDP_LOCAL BOOL update_write_cache_bitmap_order(
wStream* s,
239 BOOL compressed, UINT16* flags);
241 FREERDP_LOCAL
size_t update_approximate_cache_bitmap_v2_order(
243 FREERDP_LOCAL BOOL update_write_cache_bitmap_v2_order(
wStream* s,
245 BOOL compressed, UINT16* flags);
249 FREERDP_LOCAL BOOL update_write_cache_bitmap_v3_order(
wStream* s,
253 FREERDP_LOCAL
size_t update_approximate_cache_color_table_order(
255 FREERDP_LOCAL BOOL update_write_cache_color_table_order(
258 FREERDP_LOCAL
size_t update_approximate_cache_glyph_order(
const CACHE_GLYPH_ORDER* cache_glyph,
259 const UINT16* flags);
260 FREERDP_LOCAL BOOL update_write_cache_glyph_order(
wStream* s,
264 FREERDP_LOCAL
size_t update_approximate_cache_glyph_v2_order(
266 FREERDP_LOCAL BOOL update_write_cache_glyph_v2_order(
wStream* s,
270 FREERDP_LOCAL
size_t update_approximate_cache_brush_order(
const CACHE_BRUSH_ORDER* cache_brush,
271 const UINT16* flags);
272 FREERDP_LOCAL BOOL update_write_cache_brush_order(
wStream* s,
276 FREERDP_LOCAL
size_t update_approximate_create_offscreen_bitmap_order(
278 FREERDP_LOCAL BOOL update_write_create_offscreen_bitmap_order(
283 FREERDP_LOCAL BOOL update_write_switch_surface_order(
wStream* s,