aboutsummaryrefslogtreecommitdiffstats
path: root/libaxl-replies.h
blob: 30e02a10a3b74b079eee9d4cc5c8162b3150ec36 (plain) (blame)
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
/* See LICENSE file for copyright and license details. */

#define LIBAXL_REPLY 1 /* TODO man */

struct libaxl_reply_get_window_attributes {
	uint8_t                   __one;
	uint8_t                   backing_store;         /* LIBAXL_NOT_USEFUL, LIBAXL_WHEN_MAPPED, or LIBAXL_ALWAYS */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 3 */
	libaxl_visual_t           visual;
	uint16_t                  class;                 /* LIBAXL_INPUT_OUTPUT (= 1) or LIBAXL_INPUT_ONLY (= 2) */
	uint8_t                   bit_gravity;
	uint8_t                   win_gravity;
	uint32_t                  backing_planes;
	uint32_t                  backing_pixel;
	libaxl_bool_t             save_under;
	libaxl_bool_t             map_is_installed;
	uint8_t                   map_state;             /* LIBAXL_UNMAPPED, LIBAXL_UNVIEWABLE, or LIBAXL_VIEWABLE */
	libaxl_bool_t             override_redirect;
	libaxl_colormap_t         colormap;              /* Can be LIBAXL_NONE */
	uint32_t                  all_event_masks;       /* TODO SETofEVENT */
	uint32_t                  your_event_mask;       /* TODO SETofEVENT */
	uint16_t                  do_not_propagate_mask; /* TODO SETofDEVICEEVENT */
	uint16_t                  __pad;
};

struct libaxl_reply_get_geometry {
	uint8_t                   __one;
	uint8_t                   depth;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	libaxl_window_t           root;
	int16_t                   x;
	int16_t                   y;
	uint16_t                  width;
	uint16_t                  height;
	uint16_t                  border_width;
	uint8_t                   __unused[10];
};

struct libaxl_reply_query_tree {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = .number_of_children */
	libaxl_window_t           root;
	libaxl_window_t           parent;                /* Can be LIBAXL_NONE */
	uint16_t                  number_of_children;
	uint8_t                   __unused[14];
	libaxl_window_t          *children;
};

struct libaxl_reply_intern_atom {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	libaxl_atom_t             atom;                  /* Can be LIBAXL_NONE */
	uint8_t                   __unused[20];
};

struct libaxl_reply_get_atom_name {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	uint16_t                  length_of_name;
	uint8_t                   __unused[22];
	char                     *name;
};

struct libaxl_reply_get_property {
	uint8_t                   __one;
	uint8_t                   format;                /* {0 = 0, 8 = 8, 16 = 16, 32 = 32}*/
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	libaxl_atom_t             type;                  /* Can be LIBAXL_NONE */
	uint32_t                  bytes_after;
	uint32_t                  length_of_value;       /* in format units */
	uint8_t                   __unused[12];
	union {
		char             *value;
		uint8_t          *value8;
		uint16_t         *value16;
		uint32_t         *value32;
	};
};

struct libaxl_reply_list_properties {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	uint16_t                  number_of_atoms;
	uint8_t                   __unused[22];
	libaxl_atom_t            *atoms;
};

struct libaxl_reply_get_selection_owner {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	libaxl_window_t           owner;                 /* Can be LIBAXL_NONE */
	uint8_t                   __unused[20];
};

struct libaxl_reply_grab_pointer {
	uint8_t                   __one;
	uint8_t                   status;                /* See "grab status" in libaxl-consts.h */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint8_t                   __unused[24];
};

struct libaxl_reply_grab_keyboard {
	uint8_t                   __one;
	uint8_t                   status;                /* See "grab status" in libaxl-consts.h */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint8_t                   __unused[24];
};

struct libaxl_reply_query_pointer {
	uint8_t                   __one;
	libaxl_bool_t             same_screen;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	libaxl_window_t           root;
	libaxl_window_t           child;                 /* Can be LIBAXL_NONE */
	int16_t                   root_x;
	int16_t                   root_y;
	int16_t                   win_x;
	int16_t                   win_y;
	libaxl_keybutmask_t       mask;                  /* TODO ? SETofKEYBUTMASK shouldn't have its own type */
	uint8_t                   __unused[6];
};

struct libaxl_reply_get_motion_events {
	uint8_t                   __one;
	libaxl_bool_t             same_screen;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 2 * .number_of_events */
	uint32_t                  number_of_events;
	uint8_t                   __unused[20];
	struct libaxl_timecoord  *events;
};

struct libaxl_reply_translate_coordinates {
	uint8_t                   __one;
	libaxl_bool_t             same_screen;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	libaxl_window_t           child;                 /* Can be LIBAXL_NONE */
	int16_t                   dest_x;
	int16_t                   dest_y;
	int8_t                    __unused[16];
};

struct libaxl_reply_get_input_focus {
	uint8_t                   __one;
	uint8_t                   revert_to;             /* LIBAXL_NONE, LIBAXL_POINTER_ROOT, or LIBAXL_PARENT */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	libaxl_window_t           focus;                 /* Can be LIBAXL_NONE or LIBAXL_POINTER_ROOT */
	int8_t                    __unused[20];
};

struct libaxl_reply_query_keymap {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 2 */
	uint8_t                   keys[32];
};

struct libaxl_reply_query_font {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	struct libaxl_charinfo    min_bounds;
	uint32_t                  __unused1;
	struct libaxl_charinfo    max_bounds;
	uint32_t                  __unused2;
	uint16_t                  min_char_or_byte2;
	uint16_t                  max_char_or_byte2;
	uint16_t                  default_char;
	uint16_t                  number_of_properties;
	uint8_t                   draw_direction;        /* LIBAXL_LEFT_TO_RIGHT or LIBAXL_RIGHT_TO_LEFT */
	uint8_t                   min_byte1;
	uint8_t                   max_byte1;
	libaxl_bool_t             all_chars_exist;
	int16_t                   font_ascent;
	int16_t                   font_descent;
	uint32_t                  number_of_char_infos;
	struct libaxl_fontprop   *properties;
	struct libaxl_charinfo   *char_infos;
};

struct libaxl_reply_query_text_extents {
	uint8_t                   __one;
	uint8_t                   draw_direction;        /* LIBAXL_LEFT_TO_RIGHT or LIBAXL_RIGHT_TO_LEFT */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	int16_t                   font_ascent;
	int16_t                   font_descent;
	int16_t                   overall_ascent;
	int16_t                   overall_descent;
	int32_t                   overall_width;
	int32_t                   overall_left;
	int32_t                   overall_right;
	uint8_t                   __unused[4];
};

struct libaxl_reply_list_fonts {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	uint16_t                  number_of_names;
	uint8_t                   __unused[22];
	struct libaxl_str8       *names;
};

struct libaxl_reply_list_fonts_with_info {
	uint8_t                   __one;
	uint8_t                   length_of_name;        /* 0 = end of series */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 7 if .length_of_name = 0 */

	/* the rest (52 bytes) are unused if .length_of_name = 0 */
	struct libaxl_charinfo    min_bounds;
	uint32_t                  __unused1;
	struct libaxl_charinfo    max_bounds;
	uint32_t                  __unused2;
	uint16_t                  min_char_or_byte2;
	uint16_t                  max_char_or_byte2;
	uint16_t                  default_char;
	uint16_t                  number_of_properties;
	uint8_t                   draw_direction;        /* LIBAXL_LEFT_TO_RIGHT or LIBAXL_RIGHT_TO_LEFT */
	uint8_t                   min_byte1;
	uint8_t                   max_byte1;
	libaxl_bool_t             all_chars_exist;
	int16_t                   font_ascent;
	int16_t                   font_descent;
	uint32_t                  replies_hint;
	struct libaxl_fontprop   *properties;
	char                     *name;
};

struct libaxl_reply_get_font_path {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	uint16_t                  number_of_strs;
	uint8_t                   __unused[22];
	struct libaxl_str8       *path;
};

struct libaxl_reply_get_image {
	uint8_t                   __one;
	uint8_t                   depth;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	libaxl_visual_t           visual;                /* Can be LIBAXL_NONE */
	uint8_t                   __unused[20];
	size_t                    size_of_data;
	uint8_t                  *data;
};

struct libaxl_reply_list_installed_colormaps {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = .number_of_cmaps */
	uint16_t                  number_of_cmaps;
	uint8_t                   __unused[22];
	libaxl_colormap_t        *cmaps;
};

struct libaxl_reply_alloc_color {
	uint8_t                   __one;
	uint8_t                   __pad1;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint16_t                  red;
	uint16_t                  green;
	uint16_t                  blue;
	uint16_t                  __pad2;
	uint32_t                  pixel;
	uint8_t                   __unused[12];
};

struct libaxl_reply_alloc_named_color {
	uint8_t                   __one;
	uint8_t                   __pad1;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint32_t                  pixel;
	uint16_t                  exact_red;
	uint16_t                  exact_green;
	uint16_t                  exact_blue;
	uint16_t                  visual_red;
	uint16_t                  visual_green;
	uint16_t                  visual_blue;
	uint8_t                   __unused[8];
};

struct libaxl_reply_alloc_color_cells {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	uint16_t                  number_of_pixels;
	uint16_t                  number_of_masks;
	uint8_t                   __used[20];
	uint32_t                 *pixels;
	uint32_t                 *mask;
};

struct libaxl_reply_alloc_color_planes {
	uint8_t                   __one;
	uint8_t                   __pad1;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = .number_of_pixels */
	uint16_t                  number_of_pixels;
	uint16_t                  __pad2;
	uint32_t                  red_mask;
	uint32_t                  green_mask;
	uint32_t                  blue_mask;
	uint8_t                   __unused[8];
	uint32_t                 *pixels;
};

struct libaxl_reply_query_colors {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 2 * .number_of_colors */
	uint16_t                  number_of_colors;
	uint8_t                   __unused[22];
	struct libaxl_rgb16      *colors;
};

struct libaxl_reply_lookup_color {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint16_t                  exact_red;
	uint16_t                  exact_green;
	uint16_t                  exact_blue;
	uint16_t                  visual_red;
	uint16_t                  visual_green;
	uint16_t                  visual_blue;
	uint8_t                   __unused[12];
};

struct libaxl_reply_query_best_size {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint16_t                  width;
	uint16_t                  height;
	uint8_t                   __unused[20];
};

struct libaxl_reply_query_extension {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	libaxl_bool_t             present;
	uint8_t                   major_opcode;
	uint8_t                   first_event;
	uint8_t                   first_error;
	uint8_t                   __unused[20];
};

struct libaxl_reply_list_extensions {
	uint8_t                   __one;
	uint8_t                   number_of_names;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	uint8_t                   __unused[24];
	struct libaxl_str8       *names;
};

struct libaxl_reply_get_keyboard_mapping {
	uint8_t                   __one;
	uint8_t                   keysyms_per_keycode;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = count field from the request divided by .keysyms_per_keycode */
	uint8_t                   __unused[24];
	libaxl_keysym_t          *keysyms;
};

struct libaxl_reply_get_keyboard_control {
	uint8_t                   __one;
	uint8_t                   global_auto_repeat;    /* LIBAXL_OFF or LIBAXL_ON */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 5 */
	uint32_t                  led_mask;
	uint8_t                   key_click_percent;
	uint8_t                   bell_percent;
	uint16_t                  bell_pitch;
	uint16_t                  bell_duration;
	uint16_t                  __unused;
	uint8_t                   auto_repeats[32];
};

struct libaxl_reply_get_pointer_control {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint16_t                  acceleration_numerator;
	uint16_t                  acceleration_denominator;
	uint16_t                  threshold;
	uint8_t                   __unused[18];
};

struct libaxl_reply_get_screen_saver {
	uint8_t                   __one;
	uint8_t                   __pad;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint16_t                  timeout;
	uint16_t                  interval;
	uint8_t                   prefer_blanking;       /* LIBAXL_NO or LIBAXL_YES */
	uint8_t                   allow_exposures;       /* LIBAXL_NO or LIBAXL_YES */
	uint8_t                   __unused[18];
};

struct libaxl_reply_list_hosts {
	uint8_t                   __one;
	uint8_t                   mode;                  /* LIBAXL_DISABLED or LIBAXL_ENABLED */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint16_t                  number_of_hosts;
	uint8_t                   __unused[22];
	struct libaxl_host       *hosts;
};

struct libaxl_reply_set_pointer_mapping {
	uint8_t                   __one;
	uint8_t                   status;                /* LIBAXL_SUCCESS or LIBAXL_BUSY */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint8_t                   __unused[24];
};

struct libaxl_reply_get_pointer_mapping {
	uint8_t                   __one;
	uint8_t                   length_of_map;
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;
	uint8_t                   __unused[24];
	uint8_t                  *map;
};

struct libaxl_reply_set_modifier_mapping {
	uint8_t                   __one;
	uint8_t                   status;                /* LIBAXL_SUCCESS, LIBAXL_BUSY, or LIBAXL_FAILED */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 0 */
	uint8_t                   __unused[24];
};

struct libaxl_reply_get_modifier_mapping {
	uint8_t                   __one;
	uint8_t                   keycodes_per_modifier; /* pairs */
	uint16_t                  sequence_number;
	uint32_t                  _reply_length;         /* = 2 * .keycodes_per_modifier */
	uint8_t                   __unused[24];
	libaxl_keycode_t         *keycodes;
};

union libaxl_reply {
	struct {
		uint8_t           __one;
		uint8_t           __data;
		uint16_t          sequence_number;
		uint32_t          _reply_length;
	};
#include "libaxl-replies-structs.h"
};