FreeRDP
Loading...
Searching...
No Matches
include/freerdp/update.h
1
20#ifndef FREERDP_UPDATE_H
21#define FREERDP_UPDATE_H
22
23#include <winpr/crt.h>
24#include <winpr/wlog.h>
25#include <winpr/synch.h>
26#include <winpr/thread.h>
27#include <winpr/stream.h>
28#include <winpr/collections.h>
29
30#include <freerdp/rail.h>
31#include <freerdp/types.h>
32#include <freerdp/settings.h>
33#include <freerdp/graphics.h>
34#include <freerdp/utils/pcap.h>
35
36#include <freerdp/primary.h>
37#include <freerdp/secondary.h>
38#include <freerdp/altsec.h>
39#include <freerdp/window.h>
40#include <freerdp/pointer.h>
41
42/* Bitmap Updates */
43#define EX_COMPRESSED_BITMAP_HEADER_PRESENT 0x01
44
45#ifdef __cplusplus
46extern "C"
47{
48#endif
49
50 typedef struct rdp_update rdpUpdate;
51
52 typedef struct
53 {
54 UINT32 destLeft;
55 UINT32 destTop;
56 UINT32 destRight;
57 UINT32 destBottom;
58 UINT32 width;
59 UINT32 height;
60 UINT32 bitsPerPixel;
61 UINT32 flags;
62 UINT32 bitmapLength;
63 UINT32 cbCompFirstRowSize;
64 UINT32 cbCompMainBodySize;
65 UINT32 cbScanWidth;
66 UINT32 cbUncompressedSize;
67 BYTE* bitmapDataStream;
68 BOOL compressed;
70
71 typedef struct
72 {
73 UINT32 number;
74 BITMAP_DATA* rectangles;
75 BOOL skipCompression;
77
78 /* Palette Updates */
79
80 typedef struct
81 {
82 UINT32 number;
83 PALETTE_ENTRY entries[256];
85
86 /* Play Sound (System Beep) Updates */
87
88 typedef struct
89 {
90 UINT32 duration;
91 UINT32 frequency;
93
94 /* Surface Command Updates */
95 typedef struct
96 {
97 UINT32 highUniqueId;
98 UINT32 lowUniqueId;
99 UINT64 tmMilliseconds;
100 UINT64 tmSeconds;
102
103 typedef struct
104 {
105 BYTE bpp;
106 BYTE flags;
107 UINT16 codecID;
108 UINT16 width;
109 UINT16 height;
110 UINT32 bitmapDataLength;
111 TS_COMPRESSED_BITMAP_HEADER_EX exBitmapDataHeader;
112 BYTE* bitmapData;
114
115 enum SURFCMD_CMDTYPE
116 {
117 CMDTYPE_SET_SURFACE_BITS = 0x0001,
118 CMDTYPE_FRAME_MARKER = 0x0004,
119 CMDTYPE_STREAM_SURFACE_BITS = 0x0006
120 };
121
122 typedef struct
123 {
124 UINT32 cmdType;
125 UINT32 destLeft;
126 UINT32 destTop;
127 UINT32 destRight;
128 UINT32 destBottom;
130 BOOL skipCompression;
132
133 typedef struct
134 {
135 UINT32 frameAction;
136 UINT32 frameId;
138
139 enum SURFCMD_FRAMEACTION
140 {
141 SURFACECMD_FRAMEACTION_BEGIN = 0x0000,
142 SURFACECMD_FRAMEACTION_END = 0x0001
143 };
144
146 enum
147 {
148 TS_STATUS_FINDING_DESTINATION = 0x00000401,
149 TS_STATUS_LOADING_DESTINATION = 0x00000402,
150 TS_STATUS_BRINGING_SESSION_ONLINE = 0x00000403,
151 TS_STATUS_REDIRECTING_TO_DESTINATION = 0x00000404,
152 TS_STATUS_VM_LOADING = 0x00000501,
153 TS_STATUS_VM_WAKING = 0x00000502,
154 TS_STATUS_VM_STARTING = 0x00000503,
155 TS_STATUS_VM_STARTING_MONITORING = 0x00000504,
156 TS_STATUS_VM_RETRYING_MONITORING = 0x00000505
157 };
158
159 typedef struct
160 {
161 UINT32 frameId;
162 UINT32 commandCount;
163 SURFACE_BITS_COMMAND* commands;
165
166 /* defined inside libfreerdp-core */
167 typedef struct rdp_update_proxy rdpUpdateProxy;
168
169 /* Update Interface */
170
171 typedef BOOL (*pBeginPaint)(rdpContext* context);
172 typedef BOOL (*pEndPaint)(rdpContext* context);
173 typedef BOOL (*pSetBounds)(rdpContext* context, const rdpBounds* bounds);
174
175 typedef BOOL (*pSynchronize)(rdpContext* context);
176 typedef BOOL (*pDesktopResize)(rdpContext* context);
177 typedef BOOL (*pBitmapUpdate)(rdpContext* context, const BITMAP_UPDATE* bitmap);
178 typedef BOOL (*pPalette)(rdpContext* context, const PALETTE_UPDATE* palette);
179 typedef BOOL (*pPlaySound)(rdpContext* context, const PLAY_SOUND_UPDATE* play_sound);
180 typedef BOOL (*pSetKeyboardIndicators)(rdpContext* context, UINT16 led_flags);
181
182 typedef BOOL (*pRefreshRect)(rdpContext* context, BYTE count, const RECTANGLE_16* areas);
183 typedef BOOL (*pSuppressOutput)(rdpContext* context, BYTE allow, const RECTANGLE_16* area);
184 typedef BOOL (*pRemoteMonitors)(rdpContext* context, UINT32 count, const MONITOR_DEF* monitors);
185
186 typedef BOOL (*pSurfaceCommand)(rdpContext* context, wStream* s);
187 typedef BOOL (*pSurfaceBits)(rdpContext* context,
188 const SURFACE_BITS_COMMAND* surfaceBitsCommand);
189 typedef BOOL (*pSurfaceFrameMarker)(rdpContext* context,
190 const SURFACE_FRAME_MARKER* surfaceFrameMarker);
191 typedef BOOL (*pSurfaceFrameBits)(rdpContext* context, const SURFACE_BITS_COMMAND* cmd,
192 BOOL first, BOOL last, UINT32 frameId);
193 typedef BOOL (*pSurfaceFrameAcknowledge)(rdpContext* context, UINT32 frameId);
194
195 typedef BOOL (*pSaveSessionInfo)(rdpContext* context, UINT32 type, void* data);
196 typedef BOOL (*pSetKeyboardImeStatus)(rdpContext* context, UINT16 imeId, UINT32 imeState,
197 UINT32 imeConvMode);
198 typedef BOOL (*pServerStatusInfo)(rdpContext* context, UINT32 status);
199
201 {
202 rdpContext* context; /* 0 */
203 UINT32 paddingA[16 - 1]; /* 1 */
204
205 pBeginPaint BeginPaint; /* 16 */
206 pEndPaint EndPaint; /* 17 */
207 pSetBounds SetBounds; /* 18 */
208 pSynchronize Synchronize; /* 19 */
209 pDesktopResize DesktopResize; /* 20 */
210 pBitmapUpdate BitmapUpdate; /* 21 */
211 pPalette Palette; /* 22 */
212 pPlaySound PlaySound; /* 23 */
213 pSetKeyboardIndicators SetKeyboardIndicators; /* 24 */
214 pSetKeyboardImeStatus SetKeyboardImeStatus; /* 25 */
215 UINT32 paddingB[32 - 26]; /* 26 */
216
217 rdpPointerUpdate* pointer; /* 32 */
218 rdpPrimaryUpdate* primary; /* 33 */
219 rdpSecondaryUpdate* secondary; /* 34 */
220 rdpAltSecUpdate* altsec; /* 35 */
221 rdpWindowUpdate* window; /* 36 */
222 UINT32 paddingC[48 - 37]; /* 37 */
223
224 pRefreshRect RefreshRect; /* 48 */
225 pSuppressOutput SuppressOutput; /* 49 */
226 pRemoteMonitors RemoteMonitors; /* 50 */
227 UINT32 paddingD[64 - 51]; /* 51 */
228
229 pSurfaceCommand SurfaceCommand; /* 64 */
230 pSurfaceBits SurfaceBits; /* 65 */
231 pSurfaceFrameMarker SurfaceFrameMarker; /* 66 */
232 pSurfaceFrameBits SurfaceFrameBits; /* 67 */
233 pSurfaceFrameAcknowledge SurfaceFrameAcknowledge; /* 68 */
234 pSaveSessionInfo SaveSessionInfo; /* 69 */
235 pServerStatusInfo ServerStatusInfo; /* 70 */
236 /* if autoCalculateBitmapData is set to TRUE, the server automatically
237 * fills BITMAP_DATA struct members: flags, cbCompMainBodySize and cbCompFirstRowSize.
238 */
239 BOOL autoCalculateBitmapData; /* 71 */
240 UINT32 paddingE[80 - 72]; /* 72 */
241 };
242
243 FREERDP_API void rdp_update_lock(rdpUpdate* update);
244 FREERDP_API void rdp_update_unlock(rdpUpdate* update);
245
246#ifdef __cplusplus
247}
248#endif
249
250#endif /* FREERDP_UPDATE_H */
Definition types.h:82