summaryrefslogtreecommitdiff
path: root/src/core/include/webrdp_api_shared_structures.h
blob: c5ffbef20c134556a83acaefc82bf0a931fc152b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
#pragma once

/* generic structures */

typedef struct
{
	char *name, *value;
} backend_setting_str;

typedef struct
{
	char *name;
	int64_t value;
} backend_setting_int;

typedef enum
{
	ws_keycomb_ctrlaltdel_press,
	ws_keycomb_alttab_press,
	ws_keycomb_alttab_release,
	ws_keycomb_unused
} ws_input_keycomb;

/* user input structures */

typedef struct __attribute__((__packed__))
{
	uint32_t x, y, flags;
} ws_input_mouse;

typedef struct __attribute__((__packed__))
{
	uint32_t code;
	bool down;
} ws_input_kupdown;

typedef struct __attribute__((__packed__))
{
	uint32_t code, shiftstate;
} ws_input_kpress;

typedef struct __attribute__((__packed__))
{
	const uint32_t *input;
	size_t length;
} ws_input_unicode;

/* display output structures */

typedef struct __attribute__((__packed__))
{
	uint32_t x;	      /* Destination X */
	uint32_t y;	      /* Destination Y */
	uint32_t width;	      /* Width */
	uint32_t height;      /* Height */
	uint32_t dest_width;  /* Destination Width */
	uint32_t dest_height; /* Destination Height */
	uint32_t bpp;	      /* Bits per Pixel */
	uint32_t compressed;  /* Flag: Compressed */
	uint32_t size;	      /* DataSize */
} wrdp_core_display_bmp;

typedef struct __attribute__((__packed__))
{
	int32_t left;
	int32_t top;
	int32_t right;
	int32_t bottom;
} wrdp_core_display_bounds;

typedef struct __attribute__((__packed__))
{
	int32_t nLeftRect;
	int32_t nTopRect;
	int32_t nWidth;
	int32_t nHeight;
	uint32_t color;
} wrdp_core_display_opaque_rect_order;

typedef struct __attribute__((__packed__))
{
	int32_t x;
	int32_t y;
	int32_t w;
	int32_t h;
	uint32_t fg;
	uint32_t rop;
} wrdp_core_display_patblt_order;

typedef struct __attribute__((__packed__))
{
	int32_t left;
	int32_t top;
	int32_t width;
	int32_t height;
} wrdp_core_display_delta_rect;

typedef struct __attribute__((__packed__))
{
	uint32_t color;
	uint32_t num_rect;
	wrdp_core_display_delta_rect *rects;
} wrdp_core_display_m_opaque_rect;

typedef struct __attribute__((__packed__))
{
	uint32_t rop;
	int32_t x;
	int32_t y;
	int32_t w;
	int32_t h;
	int32_t sx;
	int32_t sy;
} wrdp_core_display_scr_blt;

typedef struct __attribute__((__packed__))
{
	uint8_t resL; /* 2 bytes reserved must always be 0 */
	uint8_t resH;
	uint8_t imgTypeL; /* 2 bytes image type. 1 = ICO, 2 = CUR */
	uint8_t imgTypeH;
	uint8_t nbImgL; /* 2 bytes number of images */
	uint8_t nbImgH;
	uint8_t width;	  /* 1 byte image width in pixels */
	uint8_t height;	  /* 1 byte image height in pixels */
	uint8_t nbColors; /* 1 bytenumber of colors. 0 if not using a color
			     pallete */
	uint8_t res;	  /* 1 byte reserved, should be 0 */
	uint8_t
	    xPosL; /* 2 bytes of hot spot x (for ICO, color planes, 0 or 1) */
	uint8_t xPosH;
	uint8_t yPosL; /* 2 bytes of hot spot y (for ICO bits per pixel) */
	uint8_t yPosH;
	uint8_t sizeLL; /* 4 bytes of image size */
	uint8_t sizeLH;
	uint8_t sizeHL;
	uint8_t sizeHH;
	uint8_t offsetLL; /* 4 bytes of offset of the data */
	uint8_t offsetLH;
	uint8_t offsetHL;
	uint8_t offsetHH;
	uint8_t *data;
} wrdp_core_display_cursor;

typedef struct
{
	uint32_t id;
	uint32_t hx;
	uint32_t hy;
	uint32_t data_size;
	wrdp_core_display_cursor *cur;
} wrdp_core_display_cursor_info;

/* clipboard structures */

typedef enum
{
	clip_format_unsupported = -1,
	clip_format_raw,
	clip_format_text,
	clip_format_unicode,
	clip_format_file_list
} wrdp_enum_clip_format;

typedef struct __attribute__((__packed__))
{
	/* DRAFT! */
	wrdp_enum_clip_format format;
} wrdp_backend_clipbrd_data_request;

typedef struct __attribute__((__packed__))
{
	/* DRAFT! */
	uint8_t count, *formats;
} wrdp_backend_clipbrd_fmts;

typedef struct __attribute__((__packed__))
{
	/* DRAFT! */
	/* TODO: */
	uint32_t size;
	uint8_t *data;
} wrdp_backend_clipbrd_data;

/* filetransfer structures */

typedef struct __attribute__((__packed__))
{
	uint16_t filename_len;
	uint32_t file_id;
	uint64_t file_size;
} wrdp_backend_ft_list_entry;

typedef struct __attribute__((__packed__))
{
	uint32_t file_id;
	uint64_t req_size;
	uint64_t file_offset;
} wrdp_backend_ft_file_request;

typedef enum
{
	ft_status_success = 0,
	ft_status_failure,
	ft_status_already_runing
} wrdp_backend_enum_ft_init_status;

typedef struct __attribute__((__packed__))
{
	/* DRAFT! */
	/* TODO: */
	uint32_t file_id, transfer_id;
	uint8_t status;
} wrdp_backend_ft_status;

typedef struct __attribute__((__packed__))
{
	/* DRAFT! */
	/* TODO: */
	uint32_t transfer_id;
	uint32_t size;
} wrdp_backend_ft_chunk;