Debian Codegraph @

wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwayland-wayland.h

raw symbols SCIP
1 // Copyright (C) 2016 The Qt Company Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5 #ifndef QT_WAYLAND_WAYLAND
6 #define QT_WAYLAND_WAYLAND
7
8 #include <QtWaylandClient/private/wayland-wayland-client-protocol.h>
9 #include <QByteArray>
10 #include <QString>
11
12 QT_BEGIN_NAMESPACE
13 QT_WARNING_PUSH
14 QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers")
15
16 #if !defined(Q_WAYLAND_CLIENT_WAYLAND_EXPORT)
17 # if defined(QT_SHARED)
18 # define Q_WAYLAND_CLIENT_WAYLAND_EXPORT Q_DECL_EXPORT
19 # else
20 # define Q_WAYLAND_CLIENT_WAYLAND_EXPORT
21 # endif
22 #endif
23
24 namespace QtWayland {
25 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_registry
26 {
27 public:
28 wl_registry(struct ::wl_registry *registry, int id, int version);
29 wl_registry(struct ::wl_registry *object);
30 wl_registry();
31
32 virtual ~wl_registry();
33
34 void init(struct ::wl_registry *registry, int id, int version);
35 void init(struct ::wl_registry *object);
36
37 struct ::wl_registry *object() { return m_wl_registry; }
38 const struct ::wl_registry *object() const { return m_wl_registry; }
39
40 bool isInitialized() const;
41
42 static const struct ::wl_interface *interface();
43
44 void *bind(uint32_t name, const struct ::wl_interface *interface, uint32_t version);
45
46 protected:
47 virtual void registry_global(uint32_t name, const QString &interface, uint32_t version);
48 virtual void registry_global_remove(uint32_t name);
49
50 private:
51 void init_listener();
52 static const struct wl_registry_listener m_wl_registry_listener;
53 static void handle_global(
54 void *data,
55 struct ::wl_registry *object,
56 uint32_t name,
57 const char *interface,
58 uint32_t version);
59 static void handle_global_remove(
60 void *data,
61 struct ::wl_registry *object,
62 uint32_t name);
63 struct ::wl_registry *m_wl_registry;
64 };
65
66 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_callback
67 {
68 public:
69 wl_callback(struct ::wl_registry *registry, int id, int version);
70 wl_callback(struct ::wl_callback *object);
71 wl_callback();
72
73 virtual ~wl_callback();
74
75 void init(struct ::wl_registry *registry, int id, int version);
76 void init(struct ::wl_callback *object);
77
78 struct ::wl_callback *object() { return m_wl_callback; }
79 const struct ::wl_callback *object() const { return m_wl_callback; }
80
81 bool isInitialized() const;
82
83 static const struct ::wl_interface *interface();
84
85 protected:
86 virtual void callback_done(uint32_t callback_data);
87
88 private:
89 void init_listener();
90 static const struct wl_callback_listener m_wl_callback_listener;
91 static void handle_done(
92 void *data,
93 struct ::wl_callback *object,
94 uint32_t callback_data);
95 struct ::wl_callback *m_wl_callback;
96 };
97
98 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_compositor
99 {
100 public:
101 wl_compositor(struct ::wl_registry *registry, int id, int version);
102 wl_compositor(struct ::wl_compositor *object);
103 wl_compositor();
104
105 virtual ~wl_compositor();
106
107 void init(struct ::wl_registry *registry, int id, int version);
108 void init(struct ::wl_compositor *object);
109
110 struct ::wl_compositor *object() { return m_wl_compositor; }
111 const struct ::wl_compositor *object() const { return m_wl_compositor; }
112
113 bool isInitialized() const;
114
115 static const struct ::wl_interface *interface();
116
117 struct ::wl_surface *create_surface();
118 struct ::wl_region *create_region();
119
120 private:
121 struct ::wl_compositor *m_wl_compositor;
122 };
123
124 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shm_pool
125 {
126 public:
127 wl_shm_pool(struct ::wl_registry *registry, int id, int version);
128 wl_shm_pool(struct ::wl_shm_pool *object);
129 wl_shm_pool();
130
131 virtual ~wl_shm_pool();
132
133 void init(struct ::wl_registry *registry, int id, int version);
134 void init(struct ::wl_shm_pool *object);
135
136 struct ::wl_shm_pool *object() { return m_wl_shm_pool; }
137 const struct ::wl_shm_pool *object() const { return m_wl_shm_pool; }
138
139 bool isInitialized() const;
140
141 static const struct ::wl_interface *interface();
142
143 struct ::wl_buffer *create_buffer(int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format);
144 void destroy();
145 void resize(int32_t size);
146
147 private:
148 struct ::wl_shm_pool *m_wl_shm_pool;
149 };
150
151 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shm
152 {
153 public:
154 wl_shm(struct ::wl_registry *registry, int id, int version);
155 wl_shm(struct ::wl_shm *object);
156 wl_shm();
157
158 virtual ~wl_shm();
159
160 void init(struct ::wl_registry *registry, int id, int version);
161 void init(struct ::wl_shm *object);
162
163 struct ::wl_shm *object() { return m_wl_shm; }
164 const struct ::wl_shm *object() const { return m_wl_shm; }
165
166 bool isInitialized() const;
167
168 static const struct ::wl_interface *interface();
169
170 enum error {
171 error_invalid_format = 0, // buffer format is not known
172 error_invalid_stride = 1, // invalid size or stride during pool or buffer creation
173 error_invalid_fd = 2 // mmapping the file descriptor failed
174 };
175
176 enum format {
177 format_argb8888 = 0, // 32-bit ARGB format
178 format_xrgb8888 = 1, // 32-bit RGB format
179 format_c8 = 0x20203843,
180 format_rgb332 = 0x38424752,
181 format_bgr233 = 0x38524742,
182 format_xrgb4444 = 0x32315258,
183 format_xbgr4444 = 0x32314258,
184 format_rgbx4444 = 0x32315852,
185 format_bgrx4444 = 0x32315842,
186 format_argb4444 = 0x32315241,
187 format_abgr4444 = 0x32314241,
188 format_rgba4444 = 0x32314152,
189 format_bgra4444 = 0x32314142,
190 format_xrgb1555 = 0x35315258,
191 format_xbgr1555 = 0x35314258,
192 format_rgbx5551 = 0x35315852,
193 format_bgrx5551 = 0x35315842,
194 format_argb1555 = 0x35315241,
195 format_abgr1555 = 0x35314241,
196 format_rgba5551 = 0x35314152,
197 format_bgra5551 = 0x35314142,
198 format_rgb565 = 0x36314752,
199 format_bgr565 = 0x36314742,
200 format_rgb888 = 0x34324752,
201 format_bgr888 = 0x34324742,
202 format_xbgr8888 = 0x34324258,
203 format_rgbx8888 = 0x34325852,
204 format_bgrx8888 = 0x34325842,
205 format_abgr8888 = 0x34324241,
206 format_rgba8888 = 0x34324152,
207 format_bgra8888 = 0x34324142,
208 format_xrgb2101010 = 0x30335258,
209 format_xbgr2101010 = 0x30334258,
210 format_rgbx1010102 = 0x30335852,
211 format_bgrx1010102 = 0x30335842,
212 format_argb2101010 = 0x30335241,
213 format_abgr2101010 = 0x30334241,
214 format_rgba1010102 = 0x30334152,
215 format_bgra1010102 = 0x30334142,
216 format_yuyv = 0x56595559,
217 format_yvyu = 0x55595659,
218 format_uyvy = 0x59565955,
219 format_vyuy = 0x59555956,
220 format_ayuv = 0x56555941,
221 format_nv12 = 0x3231564e,
222 format_nv21 = 0x3132564e,
223 format_nv16 = 0x3631564e,
224 format_nv61 = 0x3136564e,
225 format_yuv410 = 0x39565559,
226 format_yvu410 = 0x39555659,
227 format_yuv411 = 0x31315559,
228 format_yvu411 = 0x31315659,
229 format_yuv420 = 0x32315559,
230 format_yvu420 = 0x32315659,
231 format_yuv422 = 0x36315559,
232 format_yvu422 = 0x36315659,
233 format_yuv444 = 0x34325559,
234 format_yvu444 = 0x34325659
235 };
236
237 struct ::wl_shm_pool *create_pool(int32_t fd, int32_t size);
238
239 protected:
240 virtual void shm_format(uint32_t format);
241
242 private:
243 void init_listener();
244 static const struct wl_shm_listener m_wl_shm_listener;
245 static void handle_format(
246 void *data,
247 struct ::wl_shm *object,
248 uint32_t format);
249 struct ::wl_shm *m_wl_shm;
250 };
251
252 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_buffer
253 {
254 public:
255 wl_buffer(struct ::wl_registry *registry, int id, int version);
256 wl_buffer(struct ::wl_buffer *object);
257 wl_buffer();
258
259 virtual ~wl_buffer();
260
261 void init(struct ::wl_registry *registry, int id, int version);
262 void init(struct ::wl_buffer *object);
263
264 struct ::wl_buffer *object() { return m_wl_buffer; }
265 const struct ::wl_buffer *object() const { return m_wl_buffer; }
266
267 bool isInitialized() const;
268
269 static const struct ::wl_interface *interface();
270
271 void destroy();
272
273 protected:
274 virtual void buffer_release();
275
276 private:
277 void init_listener();
278 static const struct wl_buffer_listener m_wl_buffer_listener;
279 static void handle_release(
280 void *data,
281 struct ::wl_buffer *object);
282 struct ::wl_buffer *m_wl_buffer;
283 };
284
285 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_offer
286 {
287 public:
288 wl_data_offer(struct ::wl_registry *registry, int id, int version);
289 wl_data_offer(struct ::wl_data_offer *object);
290 wl_data_offer();
291
292 virtual ~wl_data_offer();
293
294 void init(struct ::wl_registry *registry, int id, int version);
295 void init(struct ::wl_data_offer *object);
296
297 struct ::wl_data_offer *object() { return m_wl_data_offer; }
298 const struct ::wl_data_offer *object() const { return m_wl_data_offer; }
299
300 bool isInitialized() const;
301
302 static const struct ::wl_interface *interface();
303
304 void accept(uint32_t serial, const QString &mime_type);
305 void receive(const QString &mime_type, int32_t fd);
306 void destroy();
307
308 protected:
309 virtual void data_offer_offer(const QString &mime_type);
310
311 private:
312 void init_listener();
313 static const struct wl_data_offer_listener m_wl_data_offer_listener;
314 static void handle_offer(
315 void *data,
316 struct ::wl_data_offer *object,
317 const char *mime_type);
318 struct ::wl_data_offer *m_wl_data_offer;
319 };
320
321 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_source
322 {
323 public:
324 wl_data_source(struct ::wl_registry *registry, int id, int version);
325 wl_data_source(struct ::wl_data_source *object);
326 wl_data_source();
327
328 virtual ~wl_data_source();
329
330 void init(struct ::wl_registry *registry, int id, int version);
331 void init(struct ::wl_data_source *object);
332
333 struct ::wl_data_source *object() { return m_wl_data_source; }
334 const struct ::wl_data_source *object() const { return m_wl_data_source; }
335
336 bool isInitialized() const;
337
338 static const struct ::wl_interface *interface();
339
340 void offer(const QString &mime_type);
341 void destroy();
342
343 protected:
344 virtual void data_source_target(const QString &mime_type);
345 virtual void data_source_send(const QString &mime_type, int32_t fd);
346 virtual void data_source_cancelled();
347
348 private:
349 void init_listener();
350 static const struct wl_data_source_listener m_wl_data_source_listener;
351 static void handle_target(
352 void *data,
353 struct ::wl_data_source *object,
354 const char *mime_type);
355 static void handle_send(
356 void *data,
357 struct ::wl_data_source *object,
358 const char *mime_type,
359 int32_t fd);
360 static void handle_cancelled(
361 void *data,
362 struct ::wl_data_source *object);
363 struct ::wl_data_source *m_wl_data_source;
364 };
365
366 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_device
367 {
368 public:
369 wl_data_device(struct ::wl_registry *registry, int id, int version);
370 wl_data_device(struct ::wl_data_device *object);
371 wl_data_device();
372
373 virtual ~wl_data_device();
374
375 void init(struct ::wl_registry *registry, int id, int version);
376 void init(struct ::wl_data_device *object);
377
378 struct ::wl_data_device *object() { return m_wl_data_device; }
379 const struct ::wl_data_device *object() const { return m_wl_data_device; }
380
381 bool isInitialized() const;
382
383 static const struct ::wl_interface *interface();
384
385 void start_drag(struct ::wl_data_source *source, struct ::wl_surface *origin, struct ::wl_surface *icon, uint32_t serial);
386 void set_selection(struct ::wl_data_source *source, uint32_t serial);
387
388 protected:
389 virtual void data_device_data_offer(struct ::wl_data_offer *id);
390 virtual void data_device_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct ::wl_data_offer *id);
391 virtual void data_device_leave();
392 virtual void data_device_motion(uint32_t time, wl_fixed_t x, wl_fixed_t y);
393 virtual void data_device_drop();
394 virtual void data_device_selection(struct ::wl_data_offer *id);
395
396 private:
397 void init_listener();
398 static const struct wl_data_device_listener m_wl_data_device_listener;
399 static void handle_data_offer(
400 void *data,
401 struct ::wl_data_device *object,
402 struct ::wl_data_offer *id);
403 static void handle_enter(
404 void *data,
405 struct ::wl_data_device *object,
406 uint32_t serial,
407 struct ::wl_surface *surface,
408 wl_fixed_t x,
409 wl_fixed_t y,
410 struct ::wl_data_offer *id);
411 static void handle_leave(
412 void *data,
413 struct ::wl_data_device *object);
414 static void handle_motion(
415 void *data,
416 struct ::wl_data_device *object,
417 uint32_t time,
418 wl_fixed_t x,
419 wl_fixed_t y);
420 static void handle_drop(
421 void *data,
422 struct ::wl_data_device *object);
423 static void handle_selection(
424 void *data,
425 struct ::wl_data_device *object,
426 struct ::wl_data_offer *id);
427 struct ::wl_data_device *m_wl_data_device;
428 };
429
430 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_data_device_manager
431 {
432 public:
433 wl_data_device_manager(struct ::wl_registry *registry, int id, int version);
434 wl_data_device_manager(struct ::wl_data_device_manager *object);
435 wl_data_device_manager();
436
437 virtual ~wl_data_device_manager();
438
439 void init(struct ::wl_registry *registry, int id, int version);
440 void init(struct ::wl_data_device_manager *object);
441
442 struct ::wl_data_device_manager *object() { return m_wl_data_device_manager; }
443 const struct ::wl_data_device_manager *object() const { return m_wl_data_device_manager; }
444
445 bool isInitialized() const;
446
447 static const struct ::wl_interface *interface();
448
449 struct ::wl_data_source *create_data_source();
450 struct ::wl_data_device *get_data_device(struct ::wl_seat *seat);
451
452 private:
453 struct ::wl_data_device_manager *m_wl_data_device_manager;
454 };
455
456 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shell
457 {
458 public:
459 wl_shell(struct ::wl_registry *registry, int id, int version);
460 wl_shell(struct ::wl_shell *object);
461 wl_shell();
462
463 virtual ~wl_shell();
464
465 void init(struct ::wl_registry *registry, int id, int version);
466 void init(struct ::wl_shell *object);
467
468 struct ::wl_shell *object() { return m_wl_shell; }
469 const struct ::wl_shell *object() const { return m_wl_shell; }
470
471 bool isInitialized() const;
472
473 static const struct ::wl_interface *interface();
474
475 struct ::wl_shell_surface *get_shell_surface(struct ::wl_surface *surface);
476
477 private:
478 struct ::wl_shell *m_wl_shell;
479 };
480
481 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_shell_surface
482 {
483 public:
484 wl_shell_surface(struct ::wl_registry *registry, int id, int version);
485 wl_shell_surface(struct ::wl_shell_surface *object);
486 wl_shell_surface();
487
488 virtual ~wl_shell_surface();
489
490 void init(struct ::wl_registry *registry, int id, int version);
491 void init(struct ::wl_shell_surface *object);
492
493 struct ::wl_shell_surface *object() { return m_wl_shell_surface; }
494 const struct ::wl_shell_surface *object() const { return m_wl_shell_surface; }
495
496 bool isInitialized() const;
497
498 static const struct ::wl_interface *interface();
499
500 enum resize {
501 resize_none = 0,
502 resize_top = 1,
503 resize_bottom = 2,
504 resize_left = 4,
505 resize_top_left = 5,
506 resize_bottom_left = 6,
507 resize_right = 8,
508 resize_top_right = 9,
509 resize_bottom_right = 10
510 };
511
512 enum transient {
513 transient_inactive = 0x1 // do not set keyboard focus
514 };
515
516 enum fullscreen_method {
517 fullscreen_method_default = 0, // no preference, apply default policy
518 fullscreen_method_scale = 1, // scale, preserve the surface's aspect ratio and center on output
519 fullscreen_method_driver = 2, // switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch
520 fullscreen_method_fill = 3 // no upscaling, center on output and add black borders to compensate size mismatch
521 };
522
523 void pong(uint32_t serial);
524 void move(struct ::wl_seat *seat, uint32_t serial);
525 void resize(struct ::wl_seat *seat, uint32_t serial, uint32_t edges);
526 void set_toplevel();
527 void set_transient(struct ::wl_surface *parent, int32_t x, int32_t y, uint32_t flags);
528 void set_fullscreen(uint32_t method, uint32_t framerate, struct ::wl_output *output);
529 void set_popup(struct ::wl_seat *seat, uint32_t serial, struct ::wl_surface *parent, int32_t x, int32_t y, uint32_t flags);
530 void set_maximized(struct ::wl_output *output);
531 void set_title(const QString &title);
532 void set_class(const QString &class_);
533
534 protected:
535 virtual void shell_surface_ping(uint32_t serial);
536 virtual void shell_surface_configure(uint32_t edges, int32_t width, int32_t height);
537 virtual void shell_surface_popup_done();
538
539 private:
540 void init_listener();
541 static const struct wl_shell_surface_listener m_wl_shell_surface_listener;
542 static void handle_ping(
543 void *data,
544 struct ::wl_shell_surface *object,
545 uint32_t serial);
546 static void handle_configure(
547 void *data,
548 struct ::wl_shell_surface *object,
549 uint32_t edges,
550 int32_t width,
551 int32_t height);
552 static void handle_popup_done(
553 void *data,
554 struct ::wl_shell_surface *object);
555 struct ::wl_shell_surface *m_wl_shell_surface;
556 };
557
558 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_surface
559 {
560 public:
561 wl_surface(struct ::wl_registry *registry, int id, int version);
562 wl_surface(struct ::wl_surface *object);
563 wl_surface();
564
565 virtual ~wl_surface();
566
567 void init(struct ::wl_registry *registry, int id, int version);
568 void init(struct ::wl_surface *object);
569
570 struct ::wl_surface *object() { return m_wl_surface; }
571 const struct ::wl_surface *object() const { return m_wl_surface; }
572
573 bool isInitialized() const;
574
575 static const struct ::wl_interface *interface();
576
577 enum error {
578 error_invalid_scale = 0, // buffer scale value is invalid
579 error_invalid_transform = 1 // buffer transform value is invalid
580 };
581
582 void destroy();
583 void attach(struct ::wl_buffer *buffer, int32_t x, int32_t y);
584 void damage(int32_t x, int32_t y, int32_t width, int32_t height);
585 struct ::wl_callback *frame();
586 void set_opaque_region(struct ::wl_region *region);
587 void set_input_region(struct ::wl_region *region);
588 void commit();
589 void set_buffer_transform(int32_t transform);
590 void set_buffer_scale(int32_t scale);
591
592 protected:
593 virtual void surface_enter(struct ::wl_output *output);
594 virtual void surface_leave(struct ::wl_output *output);
595
596 private:
597 void init_listener();
598 static const struct wl_surface_listener m_wl_surface_listener;
599 static void handle_enter(
600 void *data,
601 struct ::wl_surface *object,
602 struct ::wl_output *output);
603 static void handle_leave(
604 void *data,
605 struct ::wl_surface *object,
606 struct ::wl_output *output);
607 struct ::wl_surface *m_wl_surface;
608 };
609
610 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_seat
611 {
612 public:
613 wl_seat(struct ::wl_registry *registry, int id, int version);
614 wl_seat(struct ::wl_seat *object);
615 wl_seat();
616
617 virtual ~wl_seat();
618
619 void init(struct ::wl_registry *registry, int id, int version);
620 void init(struct ::wl_seat *object);
621
622 struct ::wl_seat *object() { return m_wl_seat; }
623 const struct ::wl_seat *object() const { return m_wl_seat; }
624
625 bool isInitialized() const;
626
627 static const struct ::wl_interface *interface();
628
629 enum capability {
630 capability_pointer = 1, // The seat has pointer devices
631 capability_keyboard = 2, // The seat has one or more keyboards
632 capability_touch = 4 // The seat has touch devices
633 };
634
635 struct ::wl_pointer *get_pointer();
636 struct ::wl_keyboard *get_keyboard();
637 struct ::wl_touch *get_touch();
638
639 protected:
640 virtual void seat_capabilities(uint32_t capabilities);
641 virtual void seat_name(const QString &name);
642
643 private:
644 void init_listener();
645 static const struct wl_seat_listener m_wl_seat_listener;
646 static void handle_capabilities(
647 void *data,
648 struct ::wl_seat *object,
649 uint32_t capabilities);
650 static void handle_name(
651 void *data,
652 struct ::wl_seat *object,
653 const char *name);
654 struct ::wl_seat *m_wl_seat;
655 };
656
657 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_pointer
658 {
659 public:
660 wl_pointer(struct ::wl_registry *registry, int id, int version);
661 wl_pointer(struct ::wl_pointer *object);
662 wl_pointer();
663
664 virtual ~wl_pointer();
665
666 void init(struct ::wl_registry *registry, int id, int version);
667 void init(struct ::wl_pointer *object);
668
669 struct ::wl_pointer *object() { return m_wl_pointer; }
670 const struct ::wl_pointer *object() const { return m_wl_pointer; }
671
672 bool isInitialized() const;
673
674 static const struct ::wl_interface *interface();
675
676 enum button_state {
677 button_state_released = 0, // The button is not pressed
678 button_state_pressed = 1 // The button is pressed
679 };
680
681 enum axis {
682 axis_vertical_scroll = 0,
683 axis_horizontal_scroll = 1
684 };
685
686 void set_cursor(uint32_t serial, struct ::wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y);
687 void release();
688
689 protected:
690 virtual void pointer_enter(uint32_t serial, struct ::wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y);
691 virtual void pointer_leave(uint32_t serial, struct ::wl_surface *surface);
692 virtual void pointer_motion(uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y);
693 virtual void pointer_button(uint32_t serial, uint32_t time, uint32_t button, uint32_t state);
694 virtual void pointer_axis(uint32_t time, uint32_t axis, wl_fixed_t value);
695
696 private:
697 void init_listener();
698 static const struct wl_pointer_listener m_wl_pointer_listener;
699 static void handle_enter(
700 void *data,
701 struct ::wl_pointer *object,
702 uint32_t serial,
703 struct ::wl_surface *surface,
704 wl_fixed_t surface_x,
705 wl_fixed_t surface_y);
706 static void handle_leave(
707 void *data,
708 struct ::wl_pointer *object,
709 uint32_t serial,
710 struct ::wl_surface *surface);
711 static void handle_motion(
712 void *data,
713 struct ::wl_pointer *object,
714 uint32_t time,
715 wl_fixed_t surface_x,
716 wl_fixed_t surface_y);
717 static void handle_button(
718 void *data,
719 struct ::wl_pointer *object,
720 uint32_t serial,
721 uint32_t time,
722 uint32_t button,
723 uint32_t state);
724 static void handle_axis(
725 void *data,
726 struct ::wl_pointer *object,
727 uint32_t time,
728 uint32_t axis,
729 wl_fixed_t value);
730 struct ::wl_pointer *m_wl_pointer;
731 };
732
733 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_keyboard
734 {
735 public:
736 wl_keyboard(struct ::wl_registry *registry, int id, int version);
737 wl_keyboard(struct ::wl_keyboard *object);
738 wl_keyboard();
739
740 virtual ~wl_keyboard();
741
742 void init(struct ::wl_registry *registry, int id, int version);
743 void init(struct ::wl_keyboard *object);
744
745 struct ::wl_keyboard *object() { return m_wl_keyboard; }
746 const struct ::wl_keyboard *object() const { return m_wl_keyboard; }
747
748 bool isInitialized() const;
749
750 static const struct ::wl_interface *interface();
751
752 enum keymap_format {
753 keymap_format_no_keymap = 0, // no keymap; client must understand how to interpret the raw keycode
754 keymap_format_xkb_v1 = 1 // libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode
755 };
756
757 enum key_state {
758 key_state_released = 0, // key is not pressed
759 key_state_pressed = 1 // key is pressed
760 };
761
762 void release();
763
764 protected:
765 virtual void keyboard_keymap(uint32_t format, int32_t fd, uint32_t size);
766 virtual void keyboard_enter(uint32_t serial, struct ::wl_surface *surface, wl_array *keys);
767 virtual void keyboard_leave(uint32_t serial, struct ::wl_surface *surface);
768 virtual void keyboard_key(uint32_t serial, uint32_t time, uint32_t key, uint32_t state);
769 virtual void keyboard_modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group);
770 virtual void keyboard_repeat_info(int32_t rate, int32_t delay);
771
772 private:
773 void init_listener();
774 static const struct wl_keyboard_listener m_wl_keyboard_listener;
775 static void handle_keymap(
776 void *data,
777 struct ::wl_keyboard *object,
778 uint32_t format,
779 int32_t fd,
780 uint32_t size);
781 static void handle_enter(
782 void *data,
783 struct ::wl_keyboard *object,
784 uint32_t serial,
785 struct ::wl_surface *surface,
786 wl_array *keys);
787 static void handle_leave(
788 void *data,
789 struct ::wl_keyboard *object,
790 uint32_t serial,
791 struct ::wl_surface *surface);
792 static void handle_key(
793 void *data,
794 struct ::wl_keyboard *object,
795 uint32_t serial,
796 uint32_t time,
797 uint32_t key,
798 uint32_t state);
799 static void handle_modifiers(
800 void *data,
801 struct ::wl_keyboard *object,
802 uint32_t serial,
803 uint32_t mods_depressed,
804 uint32_t mods_latched,
805 uint32_t mods_locked,
806 uint32_t group);
807 static void handle_repeat_info(
808 void *data,
809 struct ::wl_keyboard *object,
810 int32_t rate,
811 int32_t delay);
812 struct ::wl_keyboard *m_wl_keyboard;
813 };
814
815 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_touch
816 {
817 public:
818 wl_touch(struct ::wl_registry *registry, int id, int version);
819 wl_touch(struct ::wl_touch *object);
820 wl_touch();
821
822 virtual ~wl_touch();
823
824 void init(struct ::wl_registry *registry, int id, int version);
825 void init(struct ::wl_touch *object);
826
827 struct ::wl_touch *object() { return m_wl_touch; }
828 const struct ::wl_touch *object() const { return m_wl_touch; }
829
830 bool isInitialized() const;
831
832 static const struct ::wl_interface *interface();
833
834 void release();
835
836 protected:
837 virtual void touch_down(uint32_t serial, uint32_t time, struct ::wl_surface *surface, int32_t id, wl_fixed_t x, wl_fixed_t y);
838 virtual void touch_up(uint32_t serial, uint32_t time, int32_t id);
839 virtual void touch_motion(uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y);
840 virtual void touch_frame();
841 virtual void touch_cancel();
842
843 private:
844 void init_listener();
845 static const struct wl_touch_listener m_wl_touch_listener;
846 static void handle_down(
847 void *data,
848 struct ::wl_touch *object,
849 uint32_t serial,
850 uint32_t time,
851 struct ::wl_surface *surface,
852 int32_t id,
853 wl_fixed_t x,
854 wl_fixed_t y);
855 static void handle_up(
856 void *data,
857 struct ::wl_touch *object,
858 uint32_t serial,
859 uint32_t time,
860 int32_t id);
861 static void handle_motion(
862 void *data,
863 struct ::wl_touch *object,
864 uint32_t time,
865 int32_t id,
866 wl_fixed_t x,
867 wl_fixed_t y);
868 static void handle_frame(
869 void *data,
870 struct ::wl_touch *object);
871 static void handle_cancel(
872 void *data,
873 struct ::wl_touch *object);
874 struct ::wl_touch *m_wl_touch;
875 };
876
877 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_output
878 {
879 public:
880 wl_output(struct ::wl_registry *registry, int id, int version);
881 wl_output(struct ::wl_output *object);
882 wl_output();
883
884 virtual ~wl_output();
885
886 void init(struct ::wl_registry *registry, int id, int version);
887 void init(struct ::wl_output *object);
888
889 struct ::wl_output *object() { return m_wl_output; }
890 const struct ::wl_output *object() const { return m_wl_output; }
891
892 bool isInitialized() const;
893
894 static const struct ::wl_interface *interface();
895
896 enum subpixel {
897 subpixel_unknown = 0,
898 subpixel_none = 1,
899 subpixel_horizontal_rgb = 2,
900 subpixel_horizontal_bgr = 3,
901 subpixel_vertical_rgb = 4,
902 subpixel_vertical_bgr = 5
903 };
904
905 enum transform {
906 transform_normal = 0,
907 transform_90 = 1,
908 transform_180 = 2,
909 transform_270 = 3,
910 transform_flipped = 4,
911 transform_flipped_90 = 5,
912 transform_flipped_180 = 6,
913 transform_flipped_270 = 7
914 };
915
916 enum mode {
917 mode_current = 0x1, // indicates this is the current mode
918 mode_preferred = 0x2 // indicates this is the preferred mode
919 };
920
921 protected:
922 virtual void output_geometry(int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const QString &make, const QString &model, int32_t transform);
923 virtual void output_mode(uint32_t flags, int32_t width, int32_t height, int32_t refresh);
924 virtual void output_done();
925 virtual void output_scale(int32_t factor);
926
927 private:
928 void init_listener();
929 static const struct wl_output_listener m_wl_output_listener;
930 static void handle_geometry(
931 void *data,
932 struct ::wl_output *object,
933 int32_t x,
934 int32_t y,
935 int32_t physical_width,
936 int32_t physical_height,
937 int32_t subpixel,
938 const char *make,
939 const char *model,
940 int32_t transform);
941 static void handle_mode(
942 void *data,
943 struct ::wl_output *object,
944 uint32_t flags,
945 int32_t width,
946 int32_t height,
947 int32_t refresh);
948 static void handle_done(
949 void *data,
950 struct ::wl_output *object);
951 static void handle_scale(
952 void *data,
953 struct ::wl_output *object,
954 int32_t factor);
955 struct ::wl_output *m_wl_output;
956 };
957
958 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_region
959 {
960 public:
961 wl_region(struct ::wl_registry *registry, int id, int version);
962 wl_region(struct ::wl_region *object);
963 wl_region();
964
965 virtual ~wl_region();
966
967 void init(struct ::wl_registry *registry, int id, int version);
968 void init(struct ::wl_region *object);
969
970 struct ::wl_region *object() { return m_wl_region; }
971 const struct ::wl_region *object() const { return m_wl_region; }
972
973 bool isInitialized() const;
974
975 static const struct ::wl_interface *interface();
976
977 void destroy();
978 void add(int32_t x, int32_t y, int32_t width, int32_t height);
979 void subtract(int32_t x, int32_t y, int32_t width, int32_t height);
980
981 private:
982 struct ::wl_region *m_wl_region;
983 };
984
985 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_subcompositor
986 {
987 public:
988 wl_subcompositor(struct ::wl_registry *registry, int id, int version);
989 wl_subcompositor(struct ::wl_subcompositor *object);
990 wl_subcompositor();
991
992 virtual ~wl_subcompositor();
993
994 void init(struct ::wl_registry *registry, int id, int version);
995 void init(struct ::wl_subcompositor *object);
996
997 struct ::wl_subcompositor *object() { return m_wl_subcompositor; }
998 const struct ::wl_subcompositor *object() const { return m_wl_subcompositor; }
999
1000 bool isInitialized() const;
1001
1002 static const struct ::wl_interface *interface();
1003
1004 enum error {
1005 error_bad_surface = 0 // the to-be sub-surface is invalid
1006 };
1007
1008 void destroy();
1009 struct ::wl_subsurface *get_subsurface(struct ::wl_surface *surface, struct ::wl_surface *parent);
1010
1011 private:
1012 struct ::wl_subcompositor *m_wl_subcompositor;
1013 };
1014
1015 class Q_WAYLAND_CLIENT_WAYLAND_EXPORT wl_subsurface
1016 {
1017 public:
1018 wl_subsurface(struct ::wl_registry *registry, int id, int version);
1019 wl_subsurface(struct ::wl_subsurface *object);
1020 wl_subsurface();
1021
1022 virtual ~wl_subsurface();
1023
1024 void init(struct ::wl_registry *registry, int id, int version);
1025 void init(struct ::wl_subsurface *object);
1026
1027 struct ::wl_subsurface *object() { return m_wl_subsurface; }
1028 const struct ::wl_subsurface *object() const { return m_wl_subsurface; }
1029
1030 bool isInitialized() const;
1031
1032 static const struct ::wl_interface *interface();
1033
1034 enum error {
1035 error_bad_surface = 0 // wl_surface is not a sibling or the parent
1036 };
1037
1038 void destroy();
1039 void set_position(int32_t x, int32_t y);
1040 void place_above(struct ::wl_surface *sibling);
1041 void place_below(struct ::wl_surface *sibling);
1042 void set_sync();
1043 void set_desync();
1044
1045 private:
1046 struct ::wl_subsurface *m_wl_subsurface;
1047 };
1048 }
1049
1050 QT_WARNING_POP
1051 QT_END_NAMESPACE
1052
1053 #endif