FreeRDP
Loading...
Searching...
No Matches
libfreerdp/core/update.h
1
20#ifndef FREERDP_LIB_CORE_UPDATE_H
21#define FREERDP_LIB_CORE_UPDATE_H
22
23#include "rdp.h"
24#include "orders.h"
25
26#include <freerdp/types.h>
27#include <freerdp/update.h>
28#include <freerdp/freerdp.h>
29#include <freerdp/api.h>
30
31#include <winpr/stream.h>
32
33#include "../cache/bitmap.h"
34#include "../cache/palette.h"
35#include "../cache/pointer.h"
36
37#define UPDATE_TYPE_ORDERS 0x0000
38#define UPDATE_TYPE_BITMAP 0x0001
39#define UPDATE_TYPE_PALETTE 0x0002
40#define UPDATE_TYPE_SYNCHRONIZE 0x0003
41
42#define BITMAP_COMPRESSION 0x0001
43#define NO_BITMAP_COMPRESSION_HDR 0x0400
44
45typedef struct
46{
47 rdpUpdate common;
48
49 wLog* log;
50
51 BOOL dump_rfx;
52 BOOL play_rfx;
53 rdpPcap* pcap_rfx;
54 BOOL initialState;
55
56 BOOL asynchronous;
57 rdpUpdateProxy* proxy;
58 wMessageQueue* queue;
59
60 wStream* us;
61 UINT16 numberOrders;
62 size_t offsetOrders; /* the offset to patch numberOrders in the stream */
63 BOOL combineUpdates;
64 rdpBounds currentBounds;
65 rdpBounds previousBounds;
67 BOOL withinBeginEndPaint;
69
70typedef struct
71{
72 rdpAltSecUpdate common;
73
74 CREATE_OFFSCREEN_BITMAP_ORDER create_offscreen_bitmap;
75 SWITCH_SURFACE_ORDER switch_surface;
76 CREATE_NINE_GRID_BITMAP_ORDER create_nine_grid_bitmap;
77 FRAME_MARKER_ORDER frame_marker;
78 STREAM_BITMAP_FIRST_ORDER stream_bitmap_first;
79 STREAM_BITMAP_NEXT_ORDER stream_bitmap_next;
80 DRAW_GDIPLUS_CACHE_FIRST_ORDER draw_gdiplus_cache_first;
81 DRAW_GDIPLUS_CACHE_NEXT_ORDER draw_gdiplus_cache_next;
82 DRAW_GDIPLUS_CACHE_END_ORDER draw_gdiplus_cache_end;
83 DRAW_GDIPLUS_FIRST_ORDER draw_gdiplus_first;
84 DRAW_GDIPLUS_NEXT_ORDER draw_gdiplus_next;
85 DRAW_GDIPLUS_END_ORDER draw_gdiplus_end;
87
88typedef struct
89{
90 rdpPrimaryUpdate common;
91
92 ORDER_INFO order_info;
93 DSTBLT_ORDER dstblt;
94 PATBLT_ORDER patblt;
95 SCRBLT_ORDER scrblt;
96 OPAQUE_RECT_ORDER opaque_rect;
97 DRAW_NINE_GRID_ORDER draw_nine_grid;
98 MULTI_DSTBLT_ORDER multi_dstblt;
99 MULTI_PATBLT_ORDER multi_patblt;
100 MULTI_SCRBLT_ORDER multi_scrblt;
101 MULTI_OPAQUE_RECT_ORDER multi_opaque_rect;
102 MULTI_DRAW_NINE_GRID_ORDER multi_draw_nine_grid;
103 LINE_TO_ORDER line_to;
104 POLYLINE_ORDER polyline;
105 MEMBLT_ORDER memblt;
106 MEM3BLT_ORDER mem3blt;
107 SAVE_BITMAP_ORDER save_bitmap;
108 GLYPH_INDEX_ORDER glyph_index;
109 FAST_INDEX_ORDER fast_index;
110 FAST_GLYPH_ORDER fast_glyph;
111 POLYGON_SC_ORDER polygon_sc;
112 POLYGON_CB_ORDER polygon_cb;
113 ELLIPSE_SC_ORDER ellipse_sc;
114 ELLIPSE_CB_ORDER ellipse_cb;
116
117typedef struct
118{
119 rdpSecondaryUpdate common;
120 BOOL glyph_v2;
122
123WINPR_ATTR_NODISCARD
124static inline rdp_update_internal* update_cast(rdpUpdate* update)
125{
126 union
127 {
128 rdpUpdate* pub;
129 rdp_update_internal* internal;
130 } cnv;
131
132 WINPR_ASSERT(update);
133 cnv.pub = update;
134 return cnv.internal;
135}
136
137WINPR_ATTR_NODISCARD
138static inline rdp_altsec_update_internal* altsec_update_cast(rdpAltSecUpdate* update)
139{
140 union
141 {
142 rdpAltSecUpdate* pub;
144 } cnv;
145
146 WINPR_ASSERT(update);
147 cnv.pub = update;
148 return cnv.internal;
149}
150
151WINPR_ATTR_NODISCARD
152static inline rdp_primary_update_internal* primary_update_cast(rdpPrimaryUpdate* update)
153{
154 union
155 {
156 rdpPrimaryUpdate* pub;
158 } cnv;
159
160 WINPR_ASSERT(update);
161 cnv.pub = update;
162 return cnv.internal;
163}
164
165WINPR_ATTR_NODISCARD
166static inline rdp_secondary_update_internal* secondary_update_cast(rdpSecondaryUpdate* update)
167{
168 union
169 {
170 rdpSecondaryUpdate* pub;
172 } cnv;
173
174 WINPR_ASSERT(update);
175 cnv.pub = update;
176 return cnv.internal;
177}
178
179FREERDP_LOCAL void update_free(rdpUpdate* update);
180
181WINPR_ATTR_MALLOC(update_free, 1)
182WINPR_ATTR_NODISCARD
183FREERDP_LOCAL rdpUpdate* update_new(rdpRdp* rdp);
184
185FREERDP_LOCAL void update_reset_state(rdpUpdate* update);
186
187WINPR_ATTR_NODISCARD
188FREERDP_LOCAL BOOL update_post_connect(rdpUpdate* update);
189
190FREERDP_LOCAL void update_post_disconnect(rdpUpdate* update);
191
192WINPR_ATTR_NODISCARD
193FREERDP_LOCAL BOOL update_recv_play_sound(rdpUpdate* update, wStream* s);
194
195WINPR_ATTR_NODISCARD
196FREERDP_LOCAL BOOL update_recv_pointer(rdpUpdate* update, wStream* s);
197
198WINPR_ATTR_NODISCARD
199FREERDP_LOCAL BOOL update_recv(rdpUpdate* update, wStream* s);
200
201WINPR_ATTR_MALLOC(free_bitmap_update, 2)
202WINPR_ATTR_NODISCARD
203FREERDP_LOCAL BITMAP_UPDATE* update_read_bitmap_update(rdpUpdate* update, wStream* s);
204
205WINPR_ATTR_MALLOC(free_palette_update, 2)
206WINPR_ATTR_NODISCARD
207FREERDP_LOCAL PALETTE_UPDATE* update_read_palette(rdpUpdate* update, wStream* s);
208
209WINPR_ATTR_MALLOC(free_pointer_system_update, 2)
210WINPR_ATTR_NODISCARD
211FREERDP_LOCAL POINTER_SYSTEM_UPDATE* update_read_pointer_system(rdpUpdate* update, wStream* s);
212
213WINPR_ATTR_MALLOC(free_pointer_position_update, 2)
214WINPR_ATTR_NODISCARD
215FREERDP_LOCAL POINTER_POSITION_UPDATE* update_read_pointer_position(rdpUpdate* update, wStream* s);
216
217WINPR_ATTR_MALLOC(free_pointer_color_update, 2)
218WINPR_ATTR_NODISCARD
219FREERDP_LOCAL POINTER_COLOR_UPDATE* update_read_pointer_color(rdpUpdate* update, wStream* s,
220 BYTE xorBpp);
221
222WINPR_ATTR_MALLOC(free_pointer_large_update, 2)
223WINPR_ATTR_NODISCARD
224FREERDP_LOCAL POINTER_LARGE_UPDATE* update_read_pointer_large(rdpUpdate* update, wStream* s);
225
226WINPR_ATTR_MALLOC(free_pointer_new_update, 2)
227WINPR_ATTR_NODISCARD
228FREERDP_LOCAL POINTER_NEW_UPDATE* update_read_pointer_new(rdpUpdate* update, wStream* s);
229
230WINPR_ATTR_MALLOC(free_pointer_cached_update, 2)
231WINPR_ATTR_NODISCARD
232FREERDP_LOCAL POINTER_CACHED_UPDATE* update_read_pointer_cached(rdpUpdate* update, wStream* s);
233
234WINPR_ATTR_NODISCARD
235FREERDP_LOCAL BOOL update_read_refresh_rect(rdpUpdate* update, wStream* s);
236
237WINPR_ATTR_NODISCARD
238FREERDP_LOCAL BOOL update_read_suppress_output(rdpUpdate* update, wStream* s);
239
240FREERDP_LOCAL void update_register_server_callbacks(rdpUpdate* update);
241FREERDP_LOCAL void update_register_client_callbacks(rdpUpdate* update);
242
243WINPR_ATTR_NODISCARD
244FREERDP_LOCAL int update_process_messages(rdpUpdate* update);
245
246WINPR_ATTR_NODISCARD
247FREERDP_LOCAL BOOL update_begin_paint(rdpUpdate* update);
248
249WINPR_ATTR_NODISCARD
250FREERDP_LOCAL BOOL update_end_paint(rdpUpdate* update);
251
252#endif /* FREERDP_LIB_CORE_UPDATE_H */