Wayland++  0.2.8
C++ Bindings for Wayland
wayland-client-protocol.cpp
1 #include <wayland-client-protocol.hpp>
2 
3 using namespace wayland;
4 using namespace detail;
5 
6 const wl_interface* display_interface_sync_request[1] = {
7  &callback_interface,
8 };
9 
10 const wl_interface* display_interface_get_registry_request[1] = {
11  &registry_interface,
12 };
13 
14 const wl_interface* display_interface_error_event[3] = {
15  nullptr,
16  nullptr,
17  nullptr,
18 };
19 
20 const wl_interface* display_interface_delete_id_event[1] = {
21  nullptr,
22 };
23 
24 const wl_message display_interface_requests[2] = {
25  {
26  "sync",
27  "n",
28  display_interface_sync_request,
29  },
30  {
31  "get_registry",
32  "n",
33  display_interface_get_registry_request,
34  },
35 };
36 
37 const wl_message display_interface_events[2] = {
38  {
39  "error",
40  "ous",
41  display_interface_error_event,
42  },
43  {
44  "delete_id",
45  "u",
46  display_interface_delete_id_event,
47  },
48 };
49 
50 const wl_interface wayland::detail::display_interface =
51  {
52  "wl_display",
53  1,
54  2,
55  display_interface_requests,
56  2,
57  display_interface_events,
58  };
59 
60 const wl_interface* registry_interface_bind_request[2] = {
61  nullptr,
62  nullptr,
63 };
64 
65 const wl_interface* registry_interface_global_event[3] = {
66  nullptr,
67  nullptr,
68  nullptr,
69 };
70 
71 const wl_interface* registry_interface_global_remove_event[1] = {
72  nullptr,
73 };
74 
75 const wl_message registry_interface_requests[1] = {
76  {
77  "bind",
78  "usun",
79  registry_interface_bind_request,
80  },
81 };
82 
83 const wl_message registry_interface_events[2] = {
84  {
85  "global",
86  "usu",
87  registry_interface_global_event,
88  },
89  {
90  "global_remove",
91  "u",
92  registry_interface_global_remove_event,
93  },
94 };
95 
96 const wl_interface wayland::detail::registry_interface =
97  {
98  "wl_registry",
99  1,
100  1,
101  registry_interface_requests,
102  2,
103  registry_interface_events,
104  };
105 
106 const wl_interface* callback_interface_done_event[1] = {
107  nullptr,
108 };
109 
110 const wl_message callback_interface_requests[0] = {
111 };
112 
113 const wl_message callback_interface_events[1] = {
114  {
115  "done",
116  "u",
117  callback_interface_done_event,
118  },
119 };
120 
121 const wl_interface wayland::detail::callback_interface =
122  {
123  "wl_callback",
124  1,
125  0,
126  callback_interface_requests,
127  1,
128  callback_interface_events,
129  };
130 
131 const wl_interface* compositor_interface_create_surface_request[1] = {
132  &surface_interface,
133 };
134 
135 const wl_interface* compositor_interface_create_region_request[1] = {
136  &region_interface,
137 };
138 
139 const wl_message compositor_interface_requests[2] = {
140  {
141  "create_surface",
142  "n",
143  compositor_interface_create_surface_request,
144  },
145  {
146  "create_region",
147  "n",
148  compositor_interface_create_region_request,
149  },
150 };
151 
152 const wl_message compositor_interface_events[0] = {
153 };
154 
155 const wl_interface wayland::detail::compositor_interface =
156  {
157  "wl_compositor",
158  4,
159  2,
160  compositor_interface_requests,
161  0,
162  compositor_interface_events,
163  };
164 
165 const wl_interface* shm_pool_interface_create_buffer_request[6] = {
166  &buffer_interface,
167  nullptr,
168  nullptr,
169  nullptr,
170  nullptr,
171  nullptr,
172 };
173 
174 const wl_interface* shm_pool_interface_destroy_request[0] = {
175 };
176 
177 const wl_interface* shm_pool_interface_resize_request[1] = {
178  nullptr,
179 };
180 
181 const wl_message shm_pool_interface_requests[3] = {
182  {
183  "create_buffer",
184  "niiiiu",
185  shm_pool_interface_create_buffer_request,
186  },
187  {
188  "destroy",
189  "",
190  shm_pool_interface_destroy_request,
191  },
192  {
193  "resize",
194  "i",
195  shm_pool_interface_resize_request,
196  },
197 };
198 
199 const wl_message shm_pool_interface_events[0] = {
200 };
201 
202 const wl_interface wayland::detail::shm_pool_interface =
203  {
204  "wl_shm_pool",
205  1,
206  3,
207  shm_pool_interface_requests,
208  0,
209  shm_pool_interface_events,
210  };
211 
212 const wl_interface* shm_interface_create_pool_request[3] = {
213  &shm_pool_interface,
214  nullptr,
215  nullptr,
216 };
217 
218 const wl_interface* shm_interface_format_event[1] = {
219  nullptr,
220 };
221 
222 const wl_message shm_interface_requests[1] = {
223  {
224  "create_pool",
225  "nhi",
226  shm_interface_create_pool_request,
227  },
228 };
229 
230 const wl_message shm_interface_events[1] = {
231  {
232  "format",
233  "u",
234  shm_interface_format_event,
235  },
236 };
237 
238 const wl_interface wayland::detail::shm_interface =
239  {
240  "wl_shm",
241  1,
242  1,
243  shm_interface_requests,
244  1,
245  shm_interface_events,
246  };
247 
248 const wl_interface* buffer_interface_destroy_request[0] = {
249 };
250 
251 const wl_interface* buffer_interface_release_event[0] = {
252 };
253 
254 const wl_message buffer_interface_requests[1] = {
255  {
256  "destroy",
257  "",
258  buffer_interface_destroy_request,
259  },
260 };
261 
262 const wl_message buffer_interface_events[1] = {
263  {
264  "release",
265  "",
266  buffer_interface_release_event,
267  },
268 };
269 
270 const wl_interface wayland::detail::buffer_interface =
271  {
272  "wl_buffer",
273  1,
274  1,
275  buffer_interface_requests,
276  1,
277  buffer_interface_events,
278  };
279 
280 const wl_interface* data_offer_interface_accept_request[2] = {
281  nullptr,
282  nullptr,
283 };
284 
285 const wl_interface* data_offer_interface_receive_request[2] = {
286  nullptr,
287  nullptr,
288 };
289 
290 const wl_interface* data_offer_interface_destroy_request[0] = {
291 };
292 
293 const wl_interface* data_offer_interface_finish_request[0] = {
294 };
295 
296 const wl_interface* data_offer_interface_set_actions_request[2] = {
297  nullptr,
298  nullptr,
299 };
300 
301 const wl_interface* data_offer_interface_offer_event[1] = {
302  nullptr,
303 };
304 
305 const wl_interface* data_offer_interface_source_actions_event[1] = {
306  nullptr,
307 };
308 
309 const wl_interface* data_offer_interface_action_event[1] = {
310  nullptr,
311 };
312 
313 const wl_message data_offer_interface_requests[5] = {
314  {
315  "accept",
316  "u?s",
317  data_offer_interface_accept_request,
318  },
319  {
320  "receive",
321  "sh",
322  data_offer_interface_receive_request,
323  },
324  {
325  "destroy",
326  "",
327  data_offer_interface_destroy_request,
328  },
329  {
330  "finish",
331  "3",
332  data_offer_interface_finish_request,
333  },
334  {
335  "set_actions",
336  "3uu",
337  data_offer_interface_set_actions_request,
338  },
339 };
340 
341 const wl_message data_offer_interface_events[3] = {
342  {
343  "offer",
344  "s",
345  data_offer_interface_offer_event,
346  },
347  {
348  "source_actions",
349  "3u",
350  data_offer_interface_source_actions_event,
351  },
352  {
353  "action",
354  "3u",
355  data_offer_interface_action_event,
356  },
357 };
358 
359 const wl_interface wayland::detail::data_offer_interface =
360  {
361  "wl_data_offer",
362  3,
363  5,
364  data_offer_interface_requests,
365  3,
366  data_offer_interface_events,
367  };
368 
369 const wl_interface* data_source_interface_offer_request[1] = {
370  nullptr,
371 };
372 
373 const wl_interface* data_source_interface_destroy_request[0] = {
374 };
375 
376 const wl_interface* data_source_interface_set_actions_request[1] = {
377  nullptr,
378 };
379 
380 const wl_interface* data_source_interface_target_event[1] = {
381  nullptr,
382 };
383 
384 const wl_interface* data_source_interface_send_event[2] = {
385  nullptr,
386  nullptr,
387 };
388 
389 const wl_interface* data_source_interface_cancelled_event[0] = {
390 };
391 
392 const wl_interface* data_source_interface_dnd_drop_performed_event[0] = {
393 };
394 
395 const wl_interface* data_source_interface_dnd_finished_event[0] = {
396 };
397 
398 const wl_interface* data_source_interface_action_event[1] = {
399  nullptr,
400 };
401 
402 const wl_message data_source_interface_requests[3] = {
403  {
404  "offer",
405  "s",
406  data_source_interface_offer_request,
407  },
408  {
409  "destroy",
410  "",
411  data_source_interface_destroy_request,
412  },
413  {
414  "set_actions",
415  "3u",
416  data_source_interface_set_actions_request,
417  },
418 };
419 
420 const wl_message data_source_interface_events[6] = {
421  {
422  "target",
423  "?s",
424  data_source_interface_target_event,
425  },
426  {
427  "send",
428  "sh",
429  data_source_interface_send_event,
430  },
431  {
432  "cancelled",
433  "",
434  data_source_interface_cancelled_event,
435  },
436  {
437  "dnd_drop_performed",
438  "3",
439  data_source_interface_dnd_drop_performed_event,
440  },
441  {
442  "dnd_finished",
443  "3",
444  data_source_interface_dnd_finished_event,
445  },
446  {
447  "action",
448  "3u",
449  data_source_interface_action_event,
450  },
451 };
452 
453 const wl_interface wayland::detail::data_source_interface =
454  {
455  "wl_data_source",
456  3,
457  3,
458  data_source_interface_requests,
459  6,
460  data_source_interface_events,
461  };
462 
463 const wl_interface* data_device_interface_start_drag_request[4] = {
464  &data_source_interface,
465  &surface_interface,
466  &surface_interface,
467  nullptr,
468 };
469 
470 const wl_interface* data_device_interface_set_selection_request[2] = {
471  &data_source_interface,
472  nullptr,
473 };
474 
475 const wl_interface* data_device_interface_release_request[0] = {
476 };
477 
478 const wl_interface* data_device_interface_data_offer_event[1] = {
479  &data_offer_interface,
480 };
481 
482 const wl_interface* data_device_interface_enter_event[5] = {
483  nullptr,
484  &surface_interface,
485  nullptr,
486  nullptr,
487  &data_offer_interface,
488 };
489 
490 const wl_interface* data_device_interface_leave_event[0] = {
491 };
492 
493 const wl_interface* data_device_interface_motion_event[3] = {
494  nullptr,
495  nullptr,
496  nullptr,
497 };
498 
499 const wl_interface* data_device_interface_drop_event[0] = {
500 };
501 
502 const wl_interface* data_device_interface_selection_event[1] = {
503  &data_offer_interface,
504 };
505 
506 const wl_message data_device_interface_requests[3] = {
507  {
508  "start_drag",
509  "?oo?ou",
510  data_device_interface_start_drag_request,
511  },
512  {
513  "set_selection",
514  "?ou",
515  data_device_interface_set_selection_request,
516  },
517  {
518  "release",
519  "2",
520  data_device_interface_release_request,
521  },
522 };
523 
524 const wl_message data_device_interface_events[6] = {
525  {
526  "data_offer",
527  "n",
528  data_device_interface_data_offer_event,
529  },
530  {
531  "enter",
532  "uoff?o",
533  data_device_interface_enter_event,
534  },
535  {
536  "leave",
537  "",
538  data_device_interface_leave_event,
539  },
540  {
541  "motion",
542  "uff",
543  data_device_interface_motion_event,
544  },
545  {
546  "drop",
547  "",
548  data_device_interface_drop_event,
549  },
550  {
551  "selection",
552  "?o",
553  data_device_interface_selection_event,
554  },
555 };
556 
557 const wl_interface wayland::detail::data_device_interface =
558  {
559  "wl_data_device",
560  3,
561  3,
562  data_device_interface_requests,
563  6,
564  data_device_interface_events,
565  };
566 
567 const wl_interface* data_device_manager_interface_create_data_source_request[1] = {
568  &data_source_interface,
569 };
570 
571 const wl_interface* data_device_manager_interface_get_data_device_request[2] = {
572  &data_device_interface,
573  &seat_interface,
574 };
575 
576 const wl_message data_device_manager_interface_requests[2] = {
577  {
578  "create_data_source",
579  "n",
580  data_device_manager_interface_create_data_source_request,
581  },
582  {
583  "get_data_device",
584  "no",
585  data_device_manager_interface_get_data_device_request,
586  },
587 };
588 
589 const wl_message data_device_manager_interface_events[0] = {
590 };
591 
592 const wl_interface wayland::detail::data_device_manager_interface =
593  {
594  "wl_data_device_manager",
595  3,
596  2,
597  data_device_manager_interface_requests,
598  0,
599  data_device_manager_interface_events,
600  };
601 
602 const wl_interface* shell_interface_get_shell_surface_request[2] = {
603  &shell_surface_interface,
604  &surface_interface,
605 };
606 
607 const wl_message shell_interface_requests[1] = {
608  {
609  "get_shell_surface",
610  "no",
611  shell_interface_get_shell_surface_request,
612  },
613 };
614 
615 const wl_message shell_interface_events[0] = {
616 };
617 
618 const wl_interface wayland::detail::shell_interface =
619  {
620  "wl_shell",
621  1,
622  1,
623  shell_interface_requests,
624  0,
625  shell_interface_events,
626  };
627 
628 const wl_interface* shell_surface_interface_pong_request[1] = {
629  nullptr,
630 };
631 
632 const wl_interface* shell_surface_interface_move_request[2] = {
633  &seat_interface,
634  nullptr,
635 };
636 
637 const wl_interface* shell_surface_interface_resize_request[3] = {
638  &seat_interface,
639  nullptr,
640  nullptr,
641 };
642 
643 const wl_interface* shell_surface_interface_set_toplevel_request[0] = {
644 };
645 
646 const wl_interface* shell_surface_interface_set_transient_request[4] = {
647  &surface_interface,
648  nullptr,
649  nullptr,
650  nullptr,
651 };
652 
653 const wl_interface* shell_surface_interface_set_fullscreen_request[3] = {
654  nullptr,
655  nullptr,
656  &output_interface,
657 };
658 
659 const wl_interface* shell_surface_interface_set_popup_request[6] = {
660  &seat_interface,
661  nullptr,
662  &surface_interface,
663  nullptr,
664  nullptr,
665  nullptr,
666 };
667 
668 const wl_interface* shell_surface_interface_set_maximized_request[1] = {
669  &output_interface,
670 };
671 
672 const wl_interface* shell_surface_interface_set_title_request[1] = {
673  nullptr,
674 };
675 
676 const wl_interface* shell_surface_interface_set_class_request[1] = {
677  nullptr,
678 };
679 
680 const wl_interface* shell_surface_interface_ping_event[1] = {
681  nullptr,
682 };
683 
684 const wl_interface* shell_surface_interface_configure_event[3] = {
685  nullptr,
686  nullptr,
687  nullptr,
688 };
689 
690 const wl_interface* shell_surface_interface_popup_done_event[0] = {
691 };
692 
693 const wl_message shell_surface_interface_requests[10] = {
694  {
695  "pong",
696  "u",
697  shell_surface_interface_pong_request,
698  },
699  {
700  "move",
701  "ou",
702  shell_surface_interface_move_request,
703  },
704  {
705  "resize",
706  "ouu",
707  shell_surface_interface_resize_request,
708  },
709  {
710  "set_toplevel",
711  "",
712  shell_surface_interface_set_toplevel_request,
713  },
714  {
715  "set_transient",
716  "oiiu",
717  shell_surface_interface_set_transient_request,
718  },
719  {
720  "set_fullscreen",
721  "uu?o",
722  shell_surface_interface_set_fullscreen_request,
723  },
724  {
725  "set_popup",
726  "ouoiiu",
727  shell_surface_interface_set_popup_request,
728  },
729  {
730  "set_maximized",
731  "?o",
732  shell_surface_interface_set_maximized_request,
733  },
734  {
735  "set_title",
736  "s",
737  shell_surface_interface_set_title_request,
738  },
739  {
740  "set_class",
741  "s",
742  shell_surface_interface_set_class_request,
743  },
744 };
745 
746 const wl_message shell_surface_interface_events[3] = {
747  {
748  "ping",
749  "u",
750  shell_surface_interface_ping_event,
751  },
752  {
753  "configure",
754  "uii",
755  shell_surface_interface_configure_event,
756  },
757  {
758  "popup_done",
759  "",
760  shell_surface_interface_popup_done_event,
761  },
762 };
763 
764 const wl_interface wayland::detail::shell_surface_interface =
765  {
766  "wl_shell_surface",
767  1,
768  10,
769  shell_surface_interface_requests,
770  3,
771  shell_surface_interface_events,
772  };
773 
774 const wl_interface* surface_interface_destroy_request[0] = {
775 };
776 
777 const wl_interface* surface_interface_attach_request[3] = {
778  &buffer_interface,
779  nullptr,
780  nullptr,
781 };
782 
783 const wl_interface* surface_interface_damage_request[4] = {
784  nullptr,
785  nullptr,
786  nullptr,
787  nullptr,
788 };
789 
790 const wl_interface* surface_interface_frame_request[1] = {
791  &callback_interface,
792 };
793 
794 const wl_interface* surface_interface_set_opaque_region_request[1] = {
795  &region_interface,
796 };
797 
798 const wl_interface* surface_interface_set_input_region_request[1] = {
799  &region_interface,
800 };
801 
802 const wl_interface* surface_interface_commit_request[0] = {
803 };
804 
805 const wl_interface* surface_interface_set_buffer_transform_request[1] = {
806  nullptr,
807 };
808 
809 const wl_interface* surface_interface_set_buffer_scale_request[1] = {
810  nullptr,
811 };
812 
813 const wl_interface* surface_interface_damage_buffer_request[4] = {
814  nullptr,
815  nullptr,
816  nullptr,
817  nullptr,
818 };
819 
820 const wl_interface* surface_interface_enter_event[1] = {
821  &output_interface,
822 };
823 
824 const wl_interface* surface_interface_leave_event[1] = {
825  &output_interface,
826 };
827 
828 const wl_message surface_interface_requests[10] = {
829  {
830  "destroy",
831  "",
832  surface_interface_destroy_request,
833  },
834  {
835  "attach",
836  "?oii",
837  surface_interface_attach_request,
838  },
839  {
840  "damage",
841  "iiii",
842  surface_interface_damage_request,
843  },
844  {
845  "frame",
846  "n",
847  surface_interface_frame_request,
848  },
849  {
850  "set_opaque_region",
851  "?o",
852  surface_interface_set_opaque_region_request,
853  },
854  {
855  "set_input_region",
856  "?o",
857  surface_interface_set_input_region_request,
858  },
859  {
860  "commit",
861  "",
862  surface_interface_commit_request,
863  },
864  {
865  "set_buffer_transform",
866  "2i",
867  surface_interface_set_buffer_transform_request,
868  },
869  {
870  "set_buffer_scale",
871  "3i",
872  surface_interface_set_buffer_scale_request,
873  },
874  {
875  "damage_buffer",
876  "4iiii",
877  surface_interface_damage_buffer_request,
878  },
879 };
880 
881 const wl_message surface_interface_events[2] = {
882  {
883  "enter",
884  "o",
885  surface_interface_enter_event,
886  },
887  {
888  "leave",
889  "o",
890  surface_interface_leave_event,
891  },
892 };
893 
894 const wl_interface wayland::detail::surface_interface =
895  {
896  "wl_surface",
897  4,
898  10,
899  surface_interface_requests,
900  2,
901  surface_interface_events,
902  };
903 
904 const wl_interface* seat_interface_get_pointer_request[1] = {
905  &pointer_interface,
906 };
907 
908 const wl_interface* seat_interface_get_keyboard_request[1] = {
909  &keyboard_interface,
910 };
911 
912 const wl_interface* seat_interface_get_touch_request[1] = {
913  &touch_interface,
914 };
915 
916 const wl_interface* seat_interface_release_request[0] = {
917 };
918 
919 const wl_interface* seat_interface_capabilities_event[1] = {
920  nullptr,
921 };
922 
923 const wl_interface* seat_interface_name_event[1] = {
924  nullptr,
925 };
926 
927 const wl_message seat_interface_requests[4] = {
928  {
929  "get_pointer",
930  "n",
931  seat_interface_get_pointer_request,
932  },
933  {
934  "get_keyboard",
935  "n",
936  seat_interface_get_keyboard_request,
937  },
938  {
939  "get_touch",
940  "n",
941  seat_interface_get_touch_request,
942  },
943  {
944  "release",
945  "5",
946  seat_interface_release_request,
947  },
948 };
949 
950 const wl_message seat_interface_events[2] = {
951  {
952  "capabilities",
953  "u",
954  seat_interface_capabilities_event,
955  },
956  {
957  "name",
958  "2s",
959  seat_interface_name_event,
960  },
961 };
962 
963 const wl_interface wayland::detail::seat_interface =
964  {
965  "wl_seat",
966  7,
967  4,
968  seat_interface_requests,
969  2,
970  seat_interface_events,
971  };
972 
973 const wl_interface* pointer_interface_set_cursor_request[4] = {
974  nullptr,
975  &surface_interface,
976  nullptr,
977  nullptr,
978 };
979 
980 const wl_interface* pointer_interface_release_request[0] = {
981 };
982 
983 const wl_interface* pointer_interface_enter_event[4] = {
984  nullptr,
985  &surface_interface,
986  nullptr,
987  nullptr,
988 };
989 
990 const wl_interface* pointer_interface_leave_event[2] = {
991  nullptr,
992  &surface_interface,
993 };
994 
995 const wl_interface* pointer_interface_motion_event[3] = {
996  nullptr,
997  nullptr,
998  nullptr,
999 };
1000 
1001 const wl_interface* pointer_interface_button_event[4] = {
1002  nullptr,
1003  nullptr,
1004  nullptr,
1005  nullptr,
1006 };
1007 
1008 const wl_interface* pointer_interface_axis_event[3] = {
1009  nullptr,
1010  nullptr,
1011  nullptr,
1012 };
1013 
1014 const wl_interface* pointer_interface_frame_event[0] = {
1015 };
1016 
1017 const wl_interface* pointer_interface_axis_source_event[1] = {
1018  nullptr,
1019 };
1020 
1021 const wl_interface* pointer_interface_axis_stop_event[2] = {
1022  nullptr,
1023  nullptr,
1024 };
1025 
1026 const wl_interface* pointer_interface_axis_discrete_event[2] = {
1027  nullptr,
1028  nullptr,
1029 };
1030 
1031 const wl_message pointer_interface_requests[2] = {
1032  {
1033  "set_cursor",
1034  "u?oii",
1035  pointer_interface_set_cursor_request,
1036  },
1037  {
1038  "release",
1039  "3",
1040  pointer_interface_release_request,
1041  },
1042 };
1043 
1044 const wl_message pointer_interface_events[9] = {
1045  {
1046  "enter",
1047  "uoff",
1048  pointer_interface_enter_event,
1049  },
1050  {
1051  "leave",
1052  "uo",
1053  pointer_interface_leave_event,
1054  },
1055  {
1056  "motion",
1057  "uff",
1058  pointer_interface_motion_event,
1059  },
1060  {
1061  "button",
1062  "uuuu",
1063  pointer_interface_button_event,
1064  },
1065  {
1066  "axis",
1067  "uuf",
1068  pointer_interface_axis_event,
1069  },
1070  {
1071  "frame",
1072  "5",
1073  pointer_interface_frame_event,
1074  },
1075  {
1076  "axis_source",
1077  "5u",
1078  pointer_interface_axis_source_event,
1079  },
1080  {
1081  "axis_stop",
1082  "5uu",
1083  pointer_interface_axis_stop_event,
1084  },
1085  {
1086  "axis_discrete",
1087  "5ui",
1088  pointer_interface_axis_discrete_event,
1089  },
1090 };
1091 
1092 const wl_interface wayland::detail::pointer_interface =
1093  {
1094  "wl_pointer",
1095  7,
1096  2,
1097  pointer_interface_requests,
1098  9,
1099  pointer_interface_events,
1100  };
1101 
1102 const wl_interface* keyboard_interface_release_request[0] = {
1103 };
1104 
1105 const wl_interface* keyboard_interface_keymap_event[3] = {
1106  nullptr,
1107  nullptr,
1108  nullptr,
1109 };
1110 
1111 const wl_interface* keyboard_interface_enter_event[3] = {
1112  nullptr,
1113  &surface_interface,
1114  nullptr,
1115 };
1116 
1117 const wl_interface* keyboard_interface_leave_event[2] = {
1118  nullptr,
1119  &surface_interface,
1120 };
1121 
1122 const wl_interface* keyboard_interface_key_event[4] = {
1123  nullptr,
1124  nullptr,
1125  nullptr,
1126  nullptr,
1127 };
1128 
1129 const wl_interface* keyboard_interface_modifiers_event[5] = {
1130  nullptr,
1131  nullptr,
1132  nullptr,
1133  nullptr,
1134  nullptr,
1135 };
1136 
1137 const wl_interface* keyboard_interface_repeat_info_event[2] = {
1138  nullptr,
1139  nullptr,
1140 };
1141 
1142 const wl_message keyboard_interface_requests[1] = {
1143  {
1144  "release",
1145  "3",
1146  keyboard_interface_release_request,
1147  },
1148 };
1149 
1150 const wl_message keyboard_interface_events[6] = {
1151  {
1152  "keymap",
1153  "uhu",
1154  keyboard_interface_keymap_event,
1155  },
1156  {
1157  "enter",
1158  "uoa",
1159  keyboard_interface_enter_event,
1160  },
1161  {
1162  "leave",
1163  "uo",
1164  keyboard_interface_leave_event,
1165  },
1166  {
1167  "key",
1168  "uuuu",
1169  keyboard_interface_key_event,
1170  },
1171  {
1172  "modifiers",
1173  "uuuuu",
1174  keyboard_interface_modifiers_event,
1175  },
1176  {
1177  "repeat_info",
1178  "4ii",
1179  keyboard_interface_repeat_info_event,
1180  },
1181 };
1182 
1183 const wl_interface wayland::detail::keyboard_interface =
1184  {
1185  "wl_keyboard",
1186  7,
1187  1,
1188  keyboard_interface_requests,
1189  6,
1190  keyboard_interface_events,
1191  };
1192 
1193 const wl_interface* touch_interface_release_request[0] = {
1194 };
1195 
1196 const wl_interface* touch_interface_down_event[6] = {
1197  nullptr,
1198  nullptr,
1199  &surface_interface,
1200  nullptr,
1201  nullptr,
1202  nullptr,
1203 };
1204 
1205 const wl_interface* touch_interface_up_event[3] = {
1206  nullptr,
1207  nullptr,
1208  nullptr,
1209 };
1210 
1211 const wl_interface* touch_interface_motion_event[4] = {
1212  nullptr,
1213  nullptr,
1214  nullptr,
1215  nullptr,
1216 };
1217 
1218 const wl_interface* touch_interface_frame_event[0] = {
1219 };
1220 
1221 const wl_interface* touch_interface_cancel_event[0] = {
1222 };
1223 
1224 const wl_interface* touch_interface_shape_event[3] = {
1225  nullptr,
1226  nullptr,
1227  nullptr,
1228 };
1229 
1230 const wl_interface* touch_interface_orientation_event[2] = {
1231  nullptr,
1232  nullptr,
1233 };
1234 
1235 const wl_message touch_interface_requests[1] = {
1236  {
1237  "release",
1238  "3",
1239  touch_interface_release_request,
1240  },
1241 };
1242 
1243 const wl_message touch_interface_events[7] = {
1244  {
1245  "down",
1246  "uuoiff",
1247  touch_interface_down_event,
1248  },
1249  {
1250  "up",
1251  "uui",
1252  touch_interface_up_event,
1253  },
1254  {
1255  "motion",
1256  "uiff",
1257  touch_interface_motion_event,
1258  },
1259  {
1260  "frame",
1261  "",
1262  touch_interface_frame_event,
1263  },
1264  {
1265  "cancel",
1266  "",
1267  touch_interface_cancel_event,
1268  },
1269  {
1270  "shape",
1271  "6iff",
1272  touch_interface_shape_event,
1273  },
1274  {
1275  "orientation",
1276  "6if",
1277  touch_interface_orientation_event,
1278  },
1279 };
1280 
1281 const wl_interface wayland::detail::touch_interface =
1282  {
1283  "wl_touch",
1284  7,
1285  1,
1286  touch_interface_requests,
1287  7,
1288  touch_interface_events,
1289  };
1290 
1291 const wl_interface* output_interface_release_request[0] = {
1292 };
1293 
1294 const wl_interface* output_interface_geometry_event[8] = {
1295  nullptr,
1296  nullptr,
1297  nullptr,
1298  nullptr,
1299  nullptr,
1300  nullptr,
1301  nullptr,
1302  nullptr,
1303 };
1304 
1305 const wl_interface* output_interface_mode_event[4] = {
1306  nullptr,
1307  nullptr,
1308  nullptr,
1309  nullptr,
1310 };
1311 
1312 const wl_interface* output_interface_done_event[0] = {
1313 };
1314 
1315 const wl_interface* output_interface_scale_event[1] = {
1316  nullptr,
1317 };
1318 
1319 const wl_message output_interface_requests[1] = {
1320  {
1321  "release",
1322  "3",
1323  output_interface_release_request,
1324  },
1325 };
1326 
1327 const wl_message output_interface_events[4] = {
1328  {
1329  "geometry",
1330  "iiiiissi",
1331  output_interface_geometry_event,
1332  },
1333  {
1334  "mode",
1335  "uiii",
1336  output_interface_mode_event,
1337  },
1338  {
1339  "done",
1340  "2",
1341  output_interface_done_event,
1342  },
1343  {
1344  "scale",
1345  "2i",
1346  output_interface_scale_event,
1347  },
1348 };
1349 
1350 const wl_interface wayland::detail::output_interface =
1351  {
1352  "wl_output",
1353  3,
1354  1,
1355  output_interface_requests,
1356  4,
1357  output_interface_events,
1358  };
1359 
1360 const wl_interface* region_interface_destroy_request[0] = {
1361 };
1362 
1363 const wl_interface* region_interface_add_request[4] = {
1364  nullptr,
1365  nullptr,
1366  nullptr,
1367  nullptr,
1368 };
1369 
1370 const wl_interface* region_interface_subtract_request[4] = {
1371  nullptr,
1372  nullptr,
1373  nullptr,
1374  nullptr,
1375 };
1376 
1377 const wl_message region_interface_requests[3] = {
1378  {
1379  "destroy",
1380  "",
1381  region_interface_destroy_request,
1382  },
1383  {
1384  "add",
1385  "iiii",
1386  region_interface_add_request,
1387  },
1388  {
1389  "subtract",
1390  "iiii",
1391  region_interface_subtract_request,
1392  },
1393 };
1394 
1395 const wl_message region_interface_events[0] = {
1396 };
1397 
1398 const wl_interface wayland::detail::region_interface =
1399  {
1400  "wl_region",
1401  1,
1402  3,
1403  region_interface_requests,
1404  0,
1405  region_interface_events,
1406  };
1407 
1408 const wl_interface* subcompositor_interface_destroy_request[0] = {
1409 };
1410 
1411 const wl_interface* subcompositor_interface_get_subsurface_request[3] = {
1412  &subsurface_interface,
1413  &surface_interface,
1414  &surface_interface,
1415 };
1416 
1417 const wl_message subcompositor_interface_requests[2] = {
1418  {
1419  "destroy",
1420  "",
1421  subcompositor_interface_destroy_request,
1422  },
1423  {
1424  "get_subsurface",
1425  "noo",
1426  subcompositor_interface_get_subsurface_request,
1427  },
1428 };
1429 
1430 const wl_message subcompositor_interface_events[0] = {
1431 };
1432 
1433 const wl_interface wayland::detail::subcompositor_interface =
1434  {
1435  "wl_subcompositor",
1436  1,
1437  2,
1438  subcompositor_interface_requests,
1439  0,
1440  subcompositor_interface_events,
1441  };
1442 
1443 const wl_interface* subsurface_interface_destroy_request[0] = {
1444 };
1445 
1446 const wl_interface* subsurface_interface_set_position_request[2] = {
1447  nullptr,
1448  nullptr,
1449 };
1450 
1451 const wl_interface* subsurface_interface_place_above_request[1] = {
1452  &surface_interface,
1453 };
1454 
1455 const wl_interface* subsurface_interface_place_below_request[1] = {
1456  &surface_interface,
1457 };
1458 
1459 const wl_interface* subsurface_interface_set_sync_request[0] = {
1460 };
1461 
1462 const wl_interface* subsurface_interface_set_desync_request[0] = {
1463 };
1464 
1465 const wl_message subsurface_interface_requests[6] = {
1466  {
1467  "destroy",
1468  "",
1469  subsurface_interface_destroy_request,
1470  },
1471  {
1472  "set_position",
1473  "ii",
1474  subsurface_interface_set_position_request,
1475  },
1476  {
1477  "place_above",
1478  "o",
1479  subsurface_interface_place_above_request,
1480  },
1481  {
1482  "place_below",
1483  "o",
1484  subsurface_interface_place_below_request,
1485  },
1486  {
1487  "set_sync",
1488  "",
1489  subsurface_interface_set_sync_request,
1490  },
1491  {
1492  "set_desync",
1493  "",
1494  subsurface_interface_set_desync_request,
1495  },
1496 };
1497 
1498 const wl_message subsurface_interface_events[0] = {
1499 };
1500 
1501 const wl_interface wayland::detail::subsurface_interface =
1502  {
1503  "wl_subsurface",
1504  1,
1505  6,
1506  subsurface_interface_requests,
1507  0,
1508  subsurface_interface_events,
1509  };
1510 
1511 registry_t::registry_t(const proxy_t &p)
1512  : proxy_t(p)
1513 {
1515  {
1516  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1517  }
1518  set_interface(&registry_interface);
1519  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1520  { return registry_t(p); });
1521 }
1522 
1523 registry_t::registry_t()
1524 {
1525  set_interface(&registry_interface);
1526  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1527  { return registry_t(p); });
1528 }
1529 
1530 registry_t::registry_t(wl_registry *p, wrapper_type t)
1531  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
1533  {
1534  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1535  }
1536  set_interface(&registry_interface);
1537  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1538  { return registry_t(p); });
1539 }
1540 
1541 registry_t::registry_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
1542  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
1543  set_interface(&registry_interface);
1544  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1545  { return registry_t(p); });
1546 }
1547 
1548 registry_t registry_t::proxy_create_wrapper()
1549 {
1550  return {*this, construct_proxy_wrapper_tag()};
1551 }
1552 
1553 const std::string registry_t::interface_name = "wl_registry";
1554 
1555 registry_t::operator wl_registry*() const
1556 {
1557  return reinterpret_cast<wl_registry*> (c_ptr());
1558 }
1559 
1560 proxy_t registry_t::bind(uint32_t name, proxy_t &interface, uint32_t version)
1561 {
1562  proxy_t p = marshal_constructor_versioned(0U, interface.interface, version, name, std::string(interface.interface->name), version, nullptr);
1563  interface = interface.copy_constructor(p);
1564  return interface;
1565 }
1566 
1567 std::function<void(uint32_t, std::string, uint32_t)> &registry_t::on_global()
1568 {
1569  return std::static_pointer_cast<events_t>(get_events())->global;
1570 }
1571 
1572 std::function<void(uint32_t)> &registry_t::on_global_remove()
1573 {
1574  return std::static_pointer_cast<events_t>(get_events())->global_remove;
1575 }
1576 
1577 int registry_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
1578 {
1579  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1580  switch(opcode)
1581  {
1582  case 0:
1583  if(events->global) events->global(args[0].get<uint32_t>(), args[1].get<std::string>(), args[2].get<uint32_t>());
1584  break;
1585  case 1:
1586  if(events->global_remove) events->global_remove(args[0].get<uint32_t>());
1587  break;
1588  }
1589  return 0;
1590 }
1591 
1592 callback_t::callback_t(const proxy_t &p)
1593  : proxy_t(p)
1594 {
1596  {
1597  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1598  }
1599  set_interface(&callback_interface);
1600  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1601  { return callback_t(p); });
1602 }
1603 
1604 callback_t::callback_t()
1605 {
1606  set_interface(&callback_interface);
1607  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1608  { return callback_t(p); });
1609 }
1610 
1611 callback_t::callback_t(wl_callback *p, wrapper_type t)
1612  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
1614  {
1615  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1616  }
1617  set_interface(&callback_interface);
1618  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1619  { return callback_t(p); });
1620 }
1621 
1622 callback_t::callback_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
1623  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
1624  set_interface(&callback_interface);
1625  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1626  { return callback_t(p); });
1627 }
1628 
1629 callback_t callback_t::proxy_create_wrapper()
1630 {
1631  return {*this, construct_proxy_wrapper_tag()};
1632 }
1633 
1634 const std::string callback_t::interface_name = "wl_callback";
1635 
1636 callback_t::operator wl_callback*() const
1637 {
1638  return reinterpret_cast<wl_callback*> (c_ptr());
1639 }
1640 
1641 std::function<void(uint32_t)> &callback_t::on_done()
1642 {
1643  return std::static_pointer_cast<events_t>(get_events())->done;
1644 }
1645 
1646 int callback_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
1647 {
1648  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1649  switch(opcode)
1650  {
1651  case 0:
1652  if(events->done) events->done(args[0].get<uint32_t>());
1653  break;
1654  }
1655  return 0;
1656 }
1657 
1658 compositor_t::compositor_t(const proxy_t &p)
1659  : proxy_t(p)
1660 {
1662  {
1663  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1664  }
1665  set_interface(&compositor_interface);
1666  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1667  { return compositor_t(p); });
1668 }
1669 
1670 compositor_t::compositor_t()
1671 {
1672  set_interface(&compositor_interface);
1673  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1674  { return compositor_t(p); });
1675 }
1676 
1677 compositor_t::compositor_t(wl_compositor *p, wrapper_type t)
1678  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
1680  {
1681  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1682  }
1683  set_interface(&compositor_interface);
1684  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1685  { return compositor_t(p); });
1686 }
1687 
1688 compositor_t::compositor_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
1689  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
1690  set_interface(&compositor_interface);
1691  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1692  { return compositor_t(p); });
1693 }
1694 
1695 compositor_t compositor_t::proxy_create_wrapper()
1696 {
1697  return {*this, construct_proxy_wrapper_tag()};
1698 }
1699 
1700 const std::string compositor_t::interface_name = "wl_compositor";
1701 
1702 compositor_t::operator wl_compositor*() const
1703 {
1704  return reinterpret_cast<wl_compositor*> (c_ptr());
1705 }
1706 
1708 {
1709  proxy_t p = marshal_constructor(0U, &surface_interface, nullptr);
1710  return surface_t(p);
1711 }
1712 
1714 {
1715  proxy_t p = marshal_constructor(1U, &region_interface, nullptr);
1716  return region_t(p);
1717 }
1718 
1719 int compositor_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
1720 {
1721  return 0;
1722 }
1723 
1724 shm_pool_t::shm_pool_t(const proxy_t &p)
1725  : proxy_t(p)
1726 {
1728  {
1729  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1730  set_destroy_opcode(1U);
1731  }
1732  set_interface(&shm_pool_interface);
1733  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1734  { return shm_pool_t(p); });
1735 }
1736 
1737 shm_pool_t::shm_pool_t()
1738 {
1739  set_interface(&shm_pool_interface);
1740  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1741  { return shm_pool_t(p); });
1742 }
1743 
1744 shm_pool_t::shm_pool_t(wl_shm_pool *p, wrapper_type t)
1745  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
1747  {
1748  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1749  set_destroy_opcode(1U);
1750  }
1751  set_interface(&shm_pool_interface);
1752  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1753  { return shm_pool_t(p); });
1754 }
1755 
1756 shm_pool_t::shm_pool_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
1757  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
1758  set_interface(&shm_pool_interface);
1759  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1760  { return shm_pool_t(p); });
1761 }
1762 
1763 shm_pool_t shm_pool_t::proxy_create_wrapper()
1764 {
1765  return {*this, construct_proxy_wrapper_tag()};
1766 }
1767 
1768 const std::string shm_pool_t::interface_name = "wl_shm_pool";
1769 
1770 shm_pool_t::operator wl_shm_pool*() const
1771 {
1772  return reinterpret_cast<wl_shm_pool*> (c_ptr());
1773 }
1774 
1775 buffer_t shm_pool_t::create_buffer(int32_t offset, int32_t width, int32_t height, int32_t stride, shm_format const& format)
1776 {
1777  proxy_t p = marshal_constructor(0U, &buffer_interface, nullptr, offset, width, height, stride, static_cast<uint32_t>(format));
1778  return buffer_t(p);
1779 }
1780 
1781 void shm_pool_t::resize(int32_t size)
1782 {
1783  marshal(2U, size);
1784 }
1785 
1786 int shm_pool_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
1787 {
1788  return 0;
1789 }
1790 
1791 shm_t::shm_t(const proxy_t &p)
1792  : proxy_t(p)
1793 {
1795  {
1796  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1797  }
1798  set_interface(&shm_interface);
1799  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1800  { return shm_t(p); });
1801 }
1802 
1803 shm_t::shm_t()
1804 {
1805  set_interface(&shm_interface);
1806  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1807  { return shm_t(p); });
1808 }
1809 
1810 shm_t::shm_t(wl_shm *p, wrapper_type t)
1811  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
1813  {
1814  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1815  }
1816  set_interface(&shm_interface);
1817  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1818  { return shm_t(p); });
1819 }
1820 
1821 shm_t::shm_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
1822  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
1823  set_interface(&shm_interface);
1824  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1825  { return shm_t(p); });
1826 }
1827 
1828 shm_t shm_t::proxy_create_wrapper()
1829 {
1830  return {*this, construct_proxy_wrapper_tag()};
1831 }
1832 
1833 const std::string shm_t::interface_name = "wl_shm";
1834 
1835 shm_t::operator wl_shm*() const
1836 {
1837  return reinterpret_cast<wl_shm*> (c_ptr());
1838 }
1839 
1840 shm_pool_t shm_t::create_pool(int fd, int32_t size)
1841 {
1842  proxy_t p = marshal_constructor(0U, &shm_pool_interface, nullptr, argument_t::fd(fd), size);
1843  return shm_pool_t(p);
1844 }
1845 
1846 std::function<void(shm_format)> &shm_t::on_format()
1847 {
1848  return std::static_pointer_cast<events_t>(get_events())->format;
1849 }
1850 
1851 int shm_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
1852 {
1853  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1854  switch(opcode)
1855  {
1856  case 0:
1857  if(events->format) events->format(shm_format(args[0].get<uint32_t>()));
1858  break;
1859  }
1860  return 0;
1861 }
1862 
1863 
1864 
1865 buffer_t::buffer_t(const proxy_t &p)
1866  : proxy_t(p)
1867 {
1869  {
1870  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1871  set_destroy_opcode(0U);
1872  }
1873  set_interface(&buffer_interface);
1874  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1875  { return buffer_t(p); });
1876 }
1877 
1878 buffer_t::buffer_t()
1879 {
1880  set_interface(&buffer_interface);
1881  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1882  { return buffer_t(p); });
1883 }
1884 
1885 buffer_t::buffer_t(wl_buffer *p, wrapper_type t)
1886  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
1888  {
1889  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1890  set_destroy_opcode(0U);
1891  }
1892  set_interface(&buffer_interface);
1893  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1894  { return buffer_t(p); });
1895 }
1896 
1897 buffer_t::buffer_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
1898  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
1899  set_interface(&buffer_interface);
1900  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1901  { return buffer_t(p); });
1902 }
1903 
1904 buffer_t buffer_t::proxy_create_wrapper()
1905 {
1906  return {*this, construct_proxy_wrapper_tag()};
1907 }
1908 
1909 const std::string buffer_t::interface_name = "wl_buffer";
1910 
1911 buffer_t::operator wl_buffer*() const
1912 {
1913  return reinterpret_cast<wl_buffer*> (c_ptr());
1914 }
1915 
1916 std::function<void()> &buffer_t::on_release()
1917 {
1918  return std::static_pointer_cast<events_t>(get_events())->release;
1919 }
1920 
1921 int buffer_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
1922 {
1923  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1924  switch(opcode)
1925  {
1926  case 0:
1927  if(events->release) events->release();
1928  break;
1929  }
1930  return 0;
1931 }
1932 
1933 data_offer_t::data_offer_t(const proxy_t &p)
1934  : proxy_t(p)
1935 {
1937  {
1938  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1939  set_destroy_opcode(2U);
1940  }
1941  set_interface(&data_offer_interface);
1942  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1943  { return data_offer_t(p); });
1944 }
1945 
1946 data_offer_t::data_offer_t()
1947 {
1948  set_interface(&data_offer_interface);
1949  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1950  { return data_offer_t(p); });
1951 }
1952 
1953 data_offer_t::data_offer_t(wl_data_offer *p, wrapper_type t)
1954  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
1956  {
1957  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
1958  set_destroy_opcode(2U);
1959  }
1960  set_interface(&data_offer_interface);
1961  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1962  { return data_offer_t(p); });
1963 }
1964 
1965 data_offer_t::data_offer_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
1966  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
1967  set_interface(&data_offer_interface);
1968  set_copy_constructor([] (const proxy_t &p) -> proxy_t
1969  { return data_offer_t(p); });
1970 }
1971 
1972 data_offer_t data_offer_t::proxy_create_wrapper()
1973 {
1974  return {*this, construct_proxy_wrapper_tag()};
1975 }
1976 
1977 const std::string data_offer_t::interface_name = "wl_data_offer";
1978 
1979 data_offer_t::operator wl_data_offer*() const
1980 {
1981  return reinterpret_cast<wl_data_offer*> (c_ptr());
1982 }
1983 
1984 void data_offer_t::accept(uint32_t serial, std::string const& mime_type)
1985 {
1986  marshal(0U, serial, mime_type);
1987 }
1988 
1989 void data_offer_t::receive(std::string const& mime_type, int fd)
1990 {
1991  marshal(1U, mime_type, argument_t::fd(fd));
1992 }
1993 
1995 {
1996  marshal(3U);
1997 }
1999 {
2000  return (get_version() >= finish_since_version);
2001 }
2002 
2004 {
2005  marshal(4U, static_cast<uint32_t>(dnd_actions), static_cast<uint32_t>(preferred_action));
2006 }
2008 {
2009  return (get_version() >= set_actions_since_version);
2010 }
2011 
2012 std::function<void(std::string)> &data_offer_t::on_offer()
2013 {
2014  return std::static_pointer_cast<events_t>(get_events())->offer;
2015 }
2016 
2017 std::function<void(data_device_manager_dnd_action)> &data_offer_t::on_source_actions()
2018 {
2019  return std::static_pointer_cast<events_t>(get_events())->source_actions;
2020 }
2021 
2022 std::function<void(data_device_manager_dnd_action)> &data_offer_t::on_action()
2023 {
2024  return std::static_pointer_cast<events_t>(get_events())->action;
2025 }
2026 
2027 int data_offer_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2028 {
2029  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2030  switch(opcode)
2031  {
2032  case 0:
2033  if(events->offer) events->offer(args[0].get<std::string>());
2034  break;
2035  case 1:
2036  if(events->source_actions) events->source_actions(data_device_manager_dnd_action(args[0].get<uint32_t>()));
2037  break;
2038  case 2:
2039  if(events->action) events->action(data_device_manager_dnd_action(args[0].get<uint32_t>()));
2040  break;
2041  }
2042  return 0;
2043 }
2044 
2045 
2046 data_source_t::data_source_t(const proxy_t &p)
2047  : proxy_t(p)
2048 {
2050  {
2051  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2052  set_destroy_opcode(1U);
2053  }
2054  set_interface(&data_source_interface);
2055  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2056  { return data_source_t(p); });
2057 }
2058 
2059 data_source_t::data_source_t()
2060 {
2061  set_interface(&data_source_interface);
2062  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2063  { return data_source_t(p); });
2064 }
2065 
2066 data_source_t::data_source_t(wl_data_source *p, wrapper_type t)
2067  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2069  {
2070  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2071  set_destroy_opcode(1U);
2072  }
2073  set_interface(&data_source_interface);
2074  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2075  { return data_source_t(p); });
2076 }
2077 
2078 data_source_t::data_source_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2079  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2080  set_interface(&data_source_interface);
2081  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2082  { return data_source_t(p); });
2083 }
2084 
2085 data_source_t data_source_t::proxy_create_wrapper()
2086 {
2087  return {*this, construct_proxy_wrapper_tag()};
2088 }
2089 
2090 const std::string data_source_t::interface_name = "wl_data_source";
2091 
2092 data_source_t::operator wl_data_source*() const
2093 {
2094  return reinterpret_cast<wl_data_source*> (c_ptr());
2095 }
2096 
2097 void data_source_t::offer(std::string const& mime_type)
2098 {
2099  marshal(0U, mime_type);
2100 }
2101 
2103 {
2104  marshal(2U, static_cast<uint32_t>(dnd_actions));
2105 }
2107 {
2108  return (get_version() >= set_actions_since_version);
2109 }
2110 
2111 std::function<void(std::string)> &data_source_t::on_target()
2112 {
2113  return std::static_pointer_cast<events_t>(get_events())->target;
2114 }
2115 
2116 std::function<void(std::string, int)> &data_source_t::on_send()
2117 {
2118  return std::static_pointer_cast<events_t>(get_events())->send;
2119 }
2120 
2121 std::function<void()> &data_source_t::on_cancelled()
2122 {
2123  return std::static_pointer_cast<events_t>(get_events())->cancelled;
2124 }
2125 
2127 {
2128  return std::static_pointer_cast<events_t>(get_events())->dnd_drop_performed;
2129 }
2130 
2131 std::function<void()> &data_source_t::on_dnd_finished()
2132 {
2133  return std::static_pointer_cast<events_t>(get_events())->dnd_finished;
2134 }
2135 
2136 std::function<void(data_device_manager_dnd_action)> &data_source_t::on_action()
2137 {
2138  return std::static_pointer_cast<events_t>(get_events())->action;
2139 }
2140 
2141 int data_source_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2142 {
2143  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2144  switch(opcode)
2145  {
2146  case 0:
2147  if(events->target) events->target(args[0].get<std::string>());
2148  break;
2149  case 1:
2150  if(events->send) events->send(args[0].get<std::string>(), args[1].get<int>());
2151  break;
2152  case 2:
2153  if(events->cancelled) events->cancelled();
2154  break;
2155  case 3:
2156  if(events->dnd_drop_performed) events->dnd_drop_performed();
2157  break;
2158  case 4:
2159  if(events->dnd_finished) events->dnd_finished();
2160  break;
2161  case 5:
2162  if(events->action) events->action(data_device_manager_dnd_action(args[0].get<uint32_t>()));
2163  break;
2164  }
2165  return 0;
2166 }
2167 
2168 
2169 data_device_t::data_device_t(const proxy_t &p)
2170  : proxy_t(p)
2171 {
2173  {
2174  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2175  }
2176  set_interface(&data_device_interface);
2177  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2178  { return data_device_t(p); });
2179 }
2180 
2181 data_device_t::data_device_t()
2182 {
2183  set_interface(&data_device_interface);
2184  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2185  { return data_device_t(p); });
2186 }
2187 
2188 data_device_t::data_device_t(wl_data_device *p, wrapper_type t)
2189  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2191  {
2192  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2193  }
2194  set_interface(&data_device_interface);
2195  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2196  { return data_device_t(p); });
2197 }
2198 
2199 data_device_t::data_device_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2200  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2201  set_interface(&data_device_interface);
2202  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2203  { return data_device_t(p); });
2204 }
2205 
2206 data_device_t data_device_t::proxy_create_wrapper()
2207 {
2208  return {*this, construct_proxy_wrapper_tag()};
2209 }
2210 
2211 const std::string data_device_t::interface_name = "wl_data_device";
2212 
2213 data_device_t::operator wl_data_device*() const
2214 {
2215  return reinterpret_cast<wl_data_device*> (c_ptr());
2216 }
2217 
2218 void data_device_t::start_drag(data_source_t const& source, surface_t const& origin, surface_t const& icon, uint32_t serial)
2219 {
2220  marshal(0U, source.proxy_has_object() ? reinterpret_cast<wl_object*>(source.c_ptr()) : nullptr, origin.proxy_has_object() ? reinterpret_cast<wl_object*>(origin.c_ptr()) : nullptr, icon.proxy_has_object() ? reinterpret_cast<wl_object*>(icon.c_ptr()) : nullptr, serial);
2221 }
2222 
2223 void data_device_t::set_selection(data_source_t const& source, uint32_t serial)
2224 {
2225  marshal(1U, source.proxy_has_object() ? reinterpret_cast<wl_object*>(source.c_ptr()) : nullptr, serial);
2226 }
2227 
2229 {
2230  marshal(2U);
2231 }
2233 {
2234  return (get_version() >= release_since_version);
2235 }
2236 
2237 std::function<void(data_offer_t)> &data_device_t::on_data_offer()
2238 {
2239  return std::static_pointer_cast<events_t>(get_events())->data_offer;
2240 }
2241 
2242 std::function<void(uint32_t, surface_t, double, double, data_offer_t)> &data_device_t::on_enter()
2243 {
2244  return std::static_pointer_cast<events_t>(get_events())->enter;
2245 }
2246 
2247 std::function<void()> &data_device_t::on_leave()
2248 {
2249  return std::static_pointer_cast<events_t>(get_events())->leave;
2250 }
2251 
2252 std::function<void(uint32_t, double, double)> &data_device_t::on_motion()
2253 {
2254  return std::static_pointer_cast<events_t>(get_events())->motion;
2255 }
2256 
2257 std::function<void()> &data_device_t::on_drop()
2258 {
2259  return std::static_pointer_cast<events_t>(get_events())->drop;
2260 }
2261 
2262 std::function<void(data_offer_t)> &data_device_t::on_selection()
2263 {
2264  return std::static_pointer_cast<events_t>(get_events())->selection;
2265 }
2266 
2267 int data_device_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2268 {
2269  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2270  switch(opcode)
2271  {
2272  case 0:
2273  if(events->data_offer) events->data_offer(data_offer_t(args[0].get<proxy_t>()));
2274  break;
2275  case 1:
2276  if(events->enter) events->enter(args[0].get<uint32_t>(), surface_t(args[1].get<proxy_t>()), args[2].get<double>(), args[3].get<double>(), data_offer_t(args[4].get<proxy_t>()));
2277  break;
2278  case 2:
2279  if(events->leave) events->leave();
2280  break;
2281  case 3:
2282  if(events->motion) events->motion(args[0].get<uint32_t>(), args[1].get<double>(), args[2].get<double>());
2283  break;
2284  case 4:
2285  if(events->drop) events->drop();
2286  break;
2287  case 5:
2288  if(events->selection) events->selection(data_offer_t(args[0].get<proxy_t>()));
2289  break;
2290  }
2291  return 0;
2292 }
2293 
2294 
2295 data_device_manager_t::data_device_manager_t(const proxy_t &p)
2296  : proxy_t(p)
2297 {
2299  {
2300  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2301  }
2302  set_interface(&data_device_manager_interface);
2303  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2304  { return data_device_manager_t(p); });
2305 }
2306 
2307 data_device_manager_t::data_device_manager_t()
2308 {
2309  set_interface(&data_device_manager_interface);
2310  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2311  { return data_device_manager_t(p); });
2312 }
2313 
2314 data_device_manager_t::data_device_manager_t(wl_data_device_manager *p, wrapper_type t)
2315  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2317  {
2318  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2319  }
2320  set_interface(&data_device_manager_interface);
2321  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2322  { return data_device_manager_t(p); });
2323 }
2324 
2325 data_device_manager_t::data_device_manager_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2326  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2327  set_interface(&data_device_manager_interface);
2328  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2329  { return data_device_manager_t(p); });
2330 }
2331 
2332 data_device_manager_t data_device_manager_t::proxy_create_wrapper()
2333 {
2334  return {*this, construct_proxy_wrapper_tag()};
2335 }
2336 
2337 const std::string data_device_manager_t::interface_name = "wl_data_device_manager";
2338 
2339 data_device_manager_t::operator wl_data_device_manager*() const
2340 {
2341  return reinterpret_cast<wl_data_device_manager*> (c_ptr());
2342 }
2343 
2345 {
2346  proxy_t p = marshal_constructor(0U, &data_source_interface, nullptr);
2347  return data_source_t(p);
2348 }
2349 
2351 {
2352  proxy_t p = marshal_constructor(1U, &data_device_interface, nullptr, seat.proxy_has_object() ? reinterpret_cast<wl_object*>(seat.c_ptr()) : nullptr);
2353  return data_device_t(p);
2354 }
2355 
2356 int data_device_manager_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2357 {
2358  return 0;
2359 }
2360 const bitfield<3, 6> data_device_manager_dnd_action::none{0};
2361 const bitfield<3, 6> data_device_manager_dnd_action::copy{1};
2362 const bitfield<3, 6> data_device_manager_dnd_action::move{2};
2363 const bitfield<3, 6> data_device_manager_dnd_action::ask{4};
2364 
2365 
2366 shell_t::shell_t(const proxy_t &p)
2367  : proxy_t(p)
2368 {
2370  {
2371  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2372  }
2373  set_interface(&shell_interface);
2374  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2375  { return shell_t(p); });
2376 }
2377 
2378 shell_t::shell_t()
2379 {
2380  set_interface(&shell_interface);
2381  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2382  { return shell_t(p); });
2383 }
2384 
2385 shell_t::shell_t(wl_shell *p, wrapper_type t)
2386  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2388  {
2389  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2390  }
2391  set_interface(&shell_interface);
2392  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2393  { return shell_t(p); });
2394 }
2395 
2396 shell_t::shell_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2397  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2398  set_interface(&shell_interface);
2399  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2400  { return shell_t(p); });
2401 }
2402 
2403 shell_t shell_t::proxy_create_wrapper()
2404 {
2405  return {*this, construct_proxy_wrapper_tag()};
2406 }
2407 
2408 const std::string shell_t::interface_name = "wl_shell";
2409 
2410 shell_t::operator wl_shell*() const
2411 {
2412  return reinterpret_cast<wl_shell*> (c_ptr());
2413 }
2414 
2416 {
2417  proxy_t p = marshal_constructor(0U, &shell_surface_interface, nullptr, surface.proxy_has_object() ? reinterpret_cast<wl_object*>(surface.c_ptr()) : nullptr);
2418  return shell_surface_t(p);
2419 }
2420 
2421 int shell_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2422 {
2423  return 0;
2424 }
2425 
2426 
2427 shell_surface_t::shell_surface_t(const proxy_t &p)
2428  : proxy_t(p)
2429 {
2431  {
2432  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2433  }
2434  set_interface(&shell_surface_interface);
2435  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2436  { return shell_surface_t(p); });
2437 }
2438 
2439 shell_surface_t::shell_surface_t()
2440 {
2441  set_interface(&shell_surface_interface);
2442  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2443  { return shell_surface_t(p); });
2444 }
2445 
2446 shell_surface_t::shell_surface_t(wl_shell_surface *p, wrapper_type t)
2447  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2449  {
2450  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2451  }
2452  set_interface(&shell_surface_interface);
2453  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2454  { return shell_surface_t(p); });
2455 }
2456 
2457 shell_surface_t::shell_surface_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2458  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2459  set_interface(&shell_surface_interface);
2460  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2461  { return shell_surface_t(p); });
2462 }
2463 
2464 shell_surface_t shell_surface_t::proxy_create_wrapper()
2465 {
2466  return {*this, construct_proxy_wrapper_tag()};
2467 }
2468 
2469 const std::string shell_surface_t::interface_name = "wl_shell_surface";
2470 
2471 shell_surface_t::operator wl_shell_surface*() const
2472 {
2473  return reinterpret_cast<wl_shell_surface*> (c_ptr());
2474 }
2475 
2476 void shell_surface_t::pong(uint32_t serial)
2477 {
2478  marshal(0U, serial);
2479 }
2480 
2481 void shell_surface_t::move(seat_t const& seat, uint32_t serial)
2482 {
2483  marshal(1U, seat.proxy_has_object() ? reinterpret_cast<wl_object*>(seat.c_ptr()) : nullptr, serial);
2484 }
2485 
2486 void shell_surface_t::resize(seat_t const& seat, uint32_t serial, shell_surface_resize const& edges)
2487 {
2488  marshal(2U, seat.proxy_has_object() ? reinterpret_cast<wl_object*>(seat.c_ptr()) : nullptr, serial, static_cast<uint32_t>(edges));
2489 }
2490 
2492 {
2493  marshal(3U);
2494 }
2495 
2496 void shell_surface_t::set_transient(surface_t const& parent, int32_t x, int32_t y, shell_surface_transient const& flags)
2497 {
2498  marshal(4U, parent.proxy_has_object() ? reinterpret_cast<wl_object*>(parent.c_ptr()) : nullptr, x, y, static_cast<uint32_t>(flags));
2499 }
2500 
2501 void shell_surface_t::set_fullscreen(shell_surface_fullscreen_method const& method, uint32_t framerate, output_t const& output)
2502 {
2503  marshal(5U, static_cast<uint32_t>(method), framerate, output.proxy_has_object() ? reinterpret_cast<wl_object*>(output.c_ptr()) : nullptr);
2504 }
2505 
2506 void shell_surface_t::set_popup(seat_t const& seat, uint32_t serial, surface_t const& parent, int32_t x, int32_t y, shell_surface_transient const& flags)
2507 {
2508  marshal(6U, seat.proxy_has_object() ? reinterpret_cast<wl_object*>(seat.c_ptr()) : nullptr, serial, parent.proxy_has_object() ? reinterpret_cast<wl_object*>(parent.c_ptr()) : nullptr, x, y, static_cast<uint32_t>(flags));
2509 }
2510 
2512 {
2513  marshal(7U, output.proxy_has_object() ? reinterpret_cast<wl_object*>(output.c_ptr()) : nullptr);
2514 }
2515 
2516 void shell_surface_t::set_title(std::string const& title)
2517 {
2518  marshal(8U, title);
2519 }
2520 
2521 void shell_surface_t::set_class(std::string const& class_)
2522 {
2523  marshal(9U, class_);
2524 }
2525 
2526 std::function<void(uint32_t)> &shell_surface_t::on_ping()
2527 {
2528  return std::static_pointer_cast<events_t>(get_events())->ping;
2529 }
2530 
2531 std::function<void(shell_surface_resize, int32_t, int32_t)> &shell_surface_t::on_configure()
2532 {
2533  return std::static_pointer_cast<events_t>(get_events())->configure;
2534 }
2535 
2536 std::function<void()> &shell_surface_t::on_popup_done()
2537 {
2538  return std::static_pointer_cast<events_t>(get_events())->popup_done;
2539 }
2540 
2541 int shell_surface_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2542 {
2543  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2544  switch(opcode)
2545  {
2546  case 0:
2547  if(events->ping) events->ping(args[0].get<uint32_t>());
2548  break;
2549  case 1:
2550  if(events->configure) events->configure(shell_surface_resize(args[0].get<uint32_t>()), args[1].get<int32_t>(), args[2].get<int32_t>());
2551  break;
2552  case 2:
2553  if(events->popup_done) events->popup_done();
2554  break;
2555  }
2556  return 0;
2557 }
2558 const bitfield<4, 8> shell_surface_resize::none{0};
2559 const bitfield<4, 8> shell_surface_resize::top{1};
2560 const bitfield<4, 8> shell_surface_resize::bottom{2};
2561 const bitfield<4, 8> shell_surface_resize::left{4};
2562 const bitfield<4, 8> shell_surface_resize::top_left{5};
2563 const bitfield<4, 8> shell_surface_resize::bottom_left{6};
2564 const bitfield<4, 8> shell_surface_resize::right{8};
2565 const bitfield<4, 8> shell_surface_resize::top_right{9};
2566 const bitfield<4, 8> shell_surface_resize::bottom_right{10};
2567 
2568 const bitfield<1, 9> shell_surface_transient::inactive{0x1};
2569 
2570 
2571 
2572 surface_t::surface_t(const proxy_t &p)
2573  : proxy_t(p)
2574 {
2576  {
2577  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2578  set_destroy_opcode(0U);
2579  }
2580  set_interface(&surface_interface);
2581  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2582  { return surface_t(p); });
2583 }
2584 
2585 surface_t::surface_t()
2586 {
2587  set_interface(&surface_interface);
2588  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2589  { return surface_t(p); });
2590 }
2591 
2592 surface_t::surface_t(wl_surface *p, wrapper_type t)
2593  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2595  {
2596  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2597  set_destroy_opcode(0U);
2598  }
2599  set_interface(&surface_interface);
2600  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2601  { return surface_t(p); });
2602 }
2603 
2604 surface_t::surface_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2605  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2606  set_interface(&surface_interface);
2607  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2608  { return surface_t(p); });
2609 }
2610 
2611 surface_t surface_t::proxy_create_wrapper()
2612 {
2613  return {*this, construct_proxy_wrapper_tag()};
2614 }
2615 
2616 const std::string surface_t::interface_name = "wl_surface";
2617 
2618 surface_t::operator wl_surface*() const
2619 {
2620  return reinterpret_cast<wl_surface*> (c_ptr());
2621 }
2622 
2623 void surface_t::attach(buffer_t const& buffer, int32_t x, int32_t y)
2624 {
2625  marshal(1U, buffer.proxy_has_object() ? reinterpret_cast<wl_object*>(buffer.c_ptr()) : nullptr, x, y);
2626 }
2627 
2628 void surface_t::damage(int32_t x, int32_t y, int32_t width, int32_t height)
2629 {
2630  marshal(2U, x, y, width, height);
2631 }
2632 
2634 {
2635  proxy_t p = marshal_constructor(3U, &callback_interface, nullptr);
2636  return callback_t(p);
2637 }
2638 
2640 {
2641  marshal(4U, region.proxy_has_object() ? reinterpret_cast<wl_object*>(region.c_ptr()) : nullptr);
2642 }
2643 
2645 {
2646  marshal(5U, region.proxy_has_object() ? reinterpret_cast<wl_object*>(region.c_ptr()) : nullptr);
2647 }
2648 
2650 {
2651  marshal(6U);
2652 }
2653 
2655 {
2656  marshal(7U, static_cast<int32_t>(transform));
2657 }
2659 {
2661 }
2662 
2663 void surface_t::set_buffer_scale(int32_t scale)
2664 {
2665  marshal(8U, scale);
2666 }
2668 {
2670 }
2671 
2672 void surface_t::damage_buffer(int32_t x, int32_t y, int32_t width, int32_t height)
2673 {
2674  marshal(9U, x, y, width, height);
2675 }
2677 {
2679 }
2680 
2681 std::function<void(output_t)> &surface_t::on_enter()
2682 {
2683  return std::static_pointer_cast<events_t>(get_events())->enter;
2684 }
2685 
2686 std::function<void(output_t)> &surface_t::on_leave()
2687 {
2688  return std::static_pointer_cast<events_t>(get_events())->leave;
2689 }
2690 
2691 int surface_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2692 {
2693  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2694  switch(opcode)
2695  {
2696  case 0:
2697  if(events->enter) events->enter(output_t(args[0].get<proxy_t>()));
2698  break;
2699  case 1:
2700  if(events->leave) events->leave(output_t(args[0].get<proxy_t>()));
2701  break;
2702  }
2703  return 0;
2704 }
2705 
2706 
2707 seat_t::seat_t(const proxy_t &p)
2708  : proxy_t(p)
2709 {
2711  {
2712  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2713  }
2714  set_interface(&seat_interface);
2715  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2716  { return seat_t(p); });
2717 }
2718 
2719 seat_t::seat_t()
2720 {
2721  set_interface(&seat_interface);
2722  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2723  { return seat_t(p); });
2724 }
2725 
2726 seat_t::seat_t(wl_seat *p, wrapper_type t)
2727  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2729  {
2730  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2731  }
2732  set_interface(&seat_interface);
2733  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2734  { return seat_t(p); });
2735 }
2736 
2737 seat_t::seat_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2738  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2739  set_interface(&seat_interface);
2740  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2741  { return seat_t(p); });
2742 }
2743 
2744 seat_t seat_t::proxy_create_wrapper()
2745 {
2746  return {*this, construct_proxy_wrapper_tag()};
2747 }
2748 
2749 const std::string seat_t::interface_name = "wl_seat";
2750 
2751 seat_t::operator wl_seat*() const
2752 {
2753  return reinterpret_cast<wl_seat*> (c_ptr());
2754 }
2755 
2757 {
2758  proxy_t p = marshal_constructor(0U, &pointer_interface, nullptr);
2759  return pointer_t(p);
2760 }
2761 
2763 {
2764  proxy_t p = marshal_constructor(1U, &keyboard_interface, nullptr);
2765  return keyboard_t(p);
2766 }
2767 
2769 {
2770  proxy_t p = marshal_constructor(2U, &touch_interface, nullptr);
2771  return touch_t(p);
2772 }
2773 
2775 {
2776  marshal(3U);
2777 }
2779 {
2780  return (get_version() >= release_since_version);
2781 }
2782 
2783 std::function<void(seat_capability)> &seat_t::on_capabilities()
2784 {
2785  return std::static_pointer_cast<events_t>(get_events())->capabilities;
2786 }
2787 
2788 std::function<void(std::string)> &seat_t::on_name()
2789 {
2790  return std::static_pointer_cast<events_t>(get_events())->name;
2791 }
2792 
2793 int seat_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2794 {
2795  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2796  switch(opcode)
2797  {
2798  case 0:
2799  if(events->capabilities) events->capabilities(seat_capability(args[0].get<uint32_t>()));
2800  break;
2801  case 1:
2802  if(events->name) events->name(args[0].get<std::string>());
2803  break;
2804  }
2805  return 0;
2806 }
2807 const bitfield<3, 12> seat_capability::pointer{1};
2808 const bitfield<3, 12> seat_capability::keyboard{2};
2809 const bitfield<3, 12> seat_capability::touch{4};
2810 
2811 
2812 
2813 pointer_t::pointer_t(const proxy_t &p)
2814  : proxy_t(p)
2815 {
2817  {
2818  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2819  }
2820  set_interface(&pointer_interface);
2821  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2822  { return pointer_t(p); });
2823 }
2824 
2825 pointer_t::pointer_t()
2826 {
2827  set_interface(&pointer_interface);
2828  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2829  { return pointer_t(p); });
2830 }
2831 
2832 pointer_t::pointer_t(wl_pointer *p, wrapper_type t)
2833  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2835  {
2836  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2837  }
2838  set_interface(&pointer_interface);
2839  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2840  { return pointer_t(p); });
2841 }
2842 
2843 pointer_t::pointer_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2844  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2845  set_interface(&pointer_interface);
2846  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2847  { return pointer_t(p); });
2848 }
2849 
2850 pointer_t pointer_t::proxy_create_wrapper()
2851 {
2852  return {*this, construct_proxy_wrapper_tag()};
2853 }
2854 
2855 const std::string pointer_t::interface_name = "wl_pointer";
2856 
2857 pointer_t::operator wl_pointer*() const
2858 {
2859  return reinterpret_cast<wl_pointer*> (c_ptr());
2860 }
2861 
2862 void pointer_t::set_cursor(uint32_t serial, surface_t const& surface, int32_t hotspot_x, int32_t hotspot_y)
2863 {
2864  marshal(0U, serial, surface.proxy_has_object() ? reinterpret_cast<wl_object*>(surface.c_ptr()) : nullptr, hotspot_x, hotspot_y);
2865 }
2866 
2868 {
2869  marshal(1U);
2870 }
2872 {
2873  return (get_version() >= release_since_version);
2874 }
2875 
2876 std::function<void(uint32_t, surface_t, double, double)> &pointer_t::on_enter()
2877 {
2878  return std::static_pointer_cast<events_t>(get_events())->enter;
2879 }
2880 
2881 std::function<void(uint32_t, surface_t)> &pointer_t::on_leave()
2882 {
2883  return std::static_pointer_cast<events_t>(get_events())->leave;
2884 }
2885 
2886 std::function<void(uint32_t, double, double)> &pointer_t::on_motion()
2887 {
2888  return std::static_pointer_cast<events_t>(get_events())->motion;
2889 }
2890 
2891 std::function<void(uint32_t, uint32_t, uint32_t, pointer_button_state)> &pointer_t::on_button()
2892 {
2893  return std::static_pointer_cast<events_t>(get_events())->button;
2894 }
2895 
2896 std::function<void(uint32_t, pointer_axis, double)> &pointer_t::on_axis()
2897 {
2898  return std::static_pointer_cast<events_t>(get_events())->axis;
2899 }
2900 
2901 std::function<void()> &pointer_t::on_frame()
2902 {
2903  return std::static_pointer_cast<events_t>(get_events())->frame;
2904 }
2905 
2906 std::function<void(pointer_axis_source)> &pointer_t::on_axis_source()
2907 {
2908  return std::static_pointer_cast<events_t>(get_events())->axis_source;
2909 }
2910 
2911 std::function<void(uint32_t, pointer_axis)> &pointer_t::on_axis_stop()
2912 {
2913  return std::static_pointer_cast<events_t>(get_events())->axis_stop;
2914 }
2915 
2916 std::function<void(pointer_axis, int32_t)> &pointer_t::on_axis_discrete()
2917 {
2918  return std::static_pointer_cast<events_t>(get_events())->axis_discrete;
2919 }
2920 
2921 int pointer_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
2922 {
2923  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2924  switch(opcode)
2925  {
2926  case 0:
2927  if(events->enter) events->enter(args[0].get<uint32_t>(), surface_t(args[1].get<proxy_t>()), args[2].get<double>(), args[3].get<double>());
2928  break;
2929  case 1:
2930  if(events->leave) events->leave(args[0].get<uint32_t>(), surface_t(args[1].get<proxy_t>()));
2931  break;
2932  case 2:
2933  if(events->motion) events->motion(args[0].get<uint32_t>(), args[1].get<double>(), args[2].get<double>());
2934  break;
2935  case 3:
2936  if(events->button) events->button(args[0].get<uint32_t>(), args[1].get<uint32_t>(), args[2].get<uint32_t>(), pointer_button_state(args[3].get<uint32_t>()));
2937  break;
2938  case 4:
2939  if(events->axis) events->axis(args[0].get<uint32_t>(), pointer_axis(args[1].get<uint32_t>()), args[2].get<double>());
2940  break;
2941  case 5:
2942  if(events->frame) events->frame();
2943  break;
2944  case 6:
2945  if(events->axis_source) events->axis_source(pointer_axis_source(args[0].get<uint32_t>()));
2946  break;
2947  case 7:
2948  if(events->axis_stop) events->axis_stop(args[0].get<uint32_t>(), pointer_axis(args[1].get<uint32_t>()));
2949  break;
2950  case 8:
2951  if(events->axis_discrete) events->axis_discrete(pointer_axis(args[0].get<uint32_t>()), args[1].get<int32_t>());
2952  break;
2953  }
2954  return 0;
2955 }
2956 
2957 
2958 
2959 
2960 
2961 keyboard_t::keyboard_t(const proxy_t &p)
2962  : proxy_t(p)
2963 {
2965  {
2966  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2967  }
2968  set_interface(&keyboard_interface);
2969  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2970  { return keyboard_t(p); });
2971 }
2972 
2973 keyboard_t::keyboard_t()
2974 {
2975  set_interface(&keyboard_interface);
2976  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2977  { return keyboard_t(p); });
2978 }
2979 
2980 keyboard_t::keyboard_t(wl_keyboard *p, wrapper_type t)
2981  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
2983  {
2984  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
2985  }
2986  set_interface(&keyboard_interface);
2987  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2988  { return keyboard_t(p); });
2989 }
2990 
2991 keyboard_t::keyboard_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
2992  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
2993  set_interface(&keyboard_interface);
2994  set_copy_constructor([] (const proxy_t &p) -> proxy_t
2995  { return keyboard_t(p); });
2996 }
2997 
2998 keyboard_t keyboard_t::proxy_create_wrapper()
2999 {
3000  return {*this, construct_proxy_wrapper_tag()};
3001 }
3002 
3003 const std::string keyboard_t::interface_name = "wl_keyboard";
3004 
3005 keyboard_t::operator wl_keyboard*() const
3006 {
3007  return reinterpret_cast<wl_keyboard*> (c_ptr());
3008 }
3009 
3011 {
3012  marshal(0U);
3013 }
3015 {
3016  return (get_version() >= release_since_version);
3017 }
3018 
3019 std::function<void(keyboard_keymap_format, int, uint32_t)> &keyboard_t::on_keymap()
3020 {
3021  return std::static_pointer_cast<events_t>(get_events())->keymap;
3022 }
3023 
3024 std::function<void(uint32_t, surface_t, array_t)> &keyboard_t::on_enter()
3025 {
3026  return std::static_pointer_cast<events_t>(get_events())->enter;
3027 }
3028 
3029 std::function<void(uint32_t, surface_t)> &keyboard_t::on_leave()
3030 {
3031  return std::static_pointer_cast<events_t>(get_events())->leave;
3032 }
3033 
3034 std::function<void(uint32_t, uint32_t, uint32_t, keyboard_key_state)> &keyboard_t::on_key()
3035 {
3036  return std::static_pointer_cast<events_t>(get_events())->key;
3037 }
3038 
3039 std::function<void(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)> &keyboard_t::on_modifiers()
3040 {
3041  return std::static_pointer_cast<events_t>(get_events())->modifiers;
3042 }
3043 
3044 std::function<void(int32_t, int32_t)> &keyboard_t::on_repeat_info()
3045 {
3046  return std::static_pointer_cast<events_t>(get_events())->repeat_info;
3047 }
3048 
3049 int keyboard_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
3050 {
3051  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
3052  switch(opcode)
3053  {
3054  case 0:
3055  if(events->keymap) events->keymap(keyboard_keymap_format(args[0].get<uint32_t>()), args[1].get<int>(), args[2].get<uint32_t>());
3056  break;
3057  case 1:
3058  if(events->enter) events->enter(args[0].get<uint32_t>(), surface_t(args[1].get<proxy_t>()), args[2].get<array_t>());
3059  break;
3060  case 2:
3061  if(events->leave) events->leave(args[0].get<uint32_t>(), surface_t(args[1].get<proxy_t>()));
3062  break;
3063  case 3:
3064  if(events->key) events->key(args[0].get<uint32_t>(), args[1].get<uint32_t>(), args[2].get<uint32_t>(), keyboard_key_state(args[3].get<uint32_t>()));
3065  break;
3066  case 4:
3067  if(events->modifiers) events->modifiers(args[0].get<uint32_t>(), args[1].get<uint32_t>(), args[2].get<uint32_t>(), args[3].get<uint32_t>(), args[4].get<uint32_t>());
3068  break;
3069  case 5:
3070  if(events->repeat_info) events->repeat_info(args[0].get<int32_t>(), args[1].get<int32_t>());
3071  break;
3072  }
3073  return 0;
3074 }
3075 
3076 
3077 
3078 touch_t::touch_t(const proxy_t &p)
3079  : proxy_t(p)
3080 {
3082  {
3083  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3084  }
3085  set_interface(&touch_interface);
3086  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3087  { return touch_t(p); });
3088 }
3089 
3090 touch_t::touch_t()
3091 {
3092  set_interface(&touch_interface);
3093  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3094  { return touch_t(p); });
3095 }
3096 
3097 touch_t::touch_t(wl_touch *p, wrapper_type t)
3098  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
3100  {
3101  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3102  }
3103  set_interface(&touch_interface);
3104  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3105  { return touch_t(p); });
3106 }
3107 
3108 touch_t::touch_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
3109  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
3110  set_interface(&touch_interface);
3111  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3112  { return touch_t(p); });
3113 }
3114 
3115 touch_t touch_t::proxy_create_wrapper()
3116 {
3117  return {*this, construct_proxy_wrapper_tag()};
3118 }
3119 
3120 const std::string touch_t::interface_name = "wl_touch";
3121 
3122 touch_t::operator wl_touch*() const
3123 {
3124  return reinterpret_cast<wl_touch*> (c_ptr());
3125 }
3126 
3128 {
3129  marshal(0U);
3130 }
3132 {
3133  return (get_version() >= release_since_version);
3134 }
3135 
3136 std::function<void(uint32_t, uint32_t, surface_t, int32_t, double, double)> &touch_t::on_down()
3137 {
3138  return std::static_pointer_cast<events_t>(get_events())->down;
3139 }
3140 
3141 std::function<void(uint32_t, uint32_t, int32_t)> &touch_t::on_up()
3142 {
3143  return std::static_pointer_cast<events_t>(get_events())->up;
3144 }
3145 
3146 std::function<void(uint32_t, int32_t, double, double)> &touch_t::on_motion()
3147 {
3148  return std::static_pointer_cast<events_t>(get_events())->motion;
3149 }
3150 
3151 std::function<void()> &touch_t::on_frame()
3152 {
3153  return std::static_pointer_cast<events_t>(get_events())->frame;
3154 }
3155 
3156 std::function<void()> &touch_t::on_cancel()
3157 {
3158  return std::static_pointer_cast<events_t>(get_events())->cancel;
3159 }
3160 
3161 std::function<void(int32_t, double, double)> &touch_t::on_shape()
3162 {
3163  return std::static_pointer_cast<events_t>(get_events())->shape;
3164 }
3165 
3166 std::function<void(int32_t, double)> &touch_t::on_orientation()
3167 {
3168  return std::static_pointer_cast<events_t>(get_events())->orientation;
3169 }
3170 
3171 int touch_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
3172 {
3173  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
3174  switch(opcode)
3175  {
3176  case 0:
3177  if(events->down) events->down(args[0].get<uint32_t>(), args[1].get<uint32_t>(), surface_t(args[2].get<proxy_t>()), args[3].get<int32_t>(), args[4].get<double>(), args[5].get<double>());
3178  break;
3179  case 1:
3180  if(events->up) events->up(args[0].get<uint32_t>(), args[1].get<uint32_t>(), args[2].get<int32_t>());
3181  break;
3182  case 2:
3183  if(events->motion) events->motion(args[0].get<uint32_t>(), args[1].get<int32_t>(), args[2].get<double>(), args[3].get<double>());
3184  break;
3185  case 3:
3186  if(events->frame) events->frame();
3187  break;
3188  case 4:
3189  if(events->cancel) events->cancel();
3190  break;
3191  case 5:
3192  if(events->shape) events->shape(args[0].get<int32_t>(), args[1].get<double>(), args[2].get<double>());
3193  break;
3194  case 6:
3195  if(events->orientation) events->orientation(args[0].get<int32_t>(), args[1].get<double>());
3196  break;
3197  }
3198  return 0;
3199 }
3200 
3201 output_t::output_t(const proxy_t &p)
3202  : proxy_t(p)
3203 {
3205  {
3206  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3207  }
3208  set_interface(&output_interface);
3209  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3210  { return output_t(p); });
3211 }
3212 
3213 output_t::output_t()
3214 {
3215  set_interface(&output_interface);
3216  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3217  { return output_t(p); });
3218 }
3219 
3220 output_t::output_t(wl_output *p, wrapper_type t)
3221  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
3223  {
3224  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3225  }
3226  set_interface(&output_interface);
3227  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3228  { return output_t(p); });
3229 }
3230 
3231 output_t::output_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
3232  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
3233  set_interface(&output_interface);
3234  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3235  { return output_t(p); });
3236 }
3237 
3238 output_t output_t::proxy_create_wrapper()
3239 {
3240  return {*this, construct_proxy_wrapper_tag()};
3241 }
3242 
3243 const std::string output_t::interface_name = "wl_output";
3244 
3245 output_t::operator wl_output*() const
3246 {
3247  return reinterpret_cast<wl_output*> (c_ptr());
3248 }
3249 
3251 {
3252  marshal(0U);
3253 }
3255 {
3256  return (get_version() >= release_since_version);
3257 }
3258 
3259 std::function<void(int32_t, int32_t, int32_t, int32_t, output_subpixel, std::string, std::string, output_transform)> &output_t::on_geometry()
3260 {
3261  return std::static_pointer_cast<events_t>(get_events())->geometry;
3262 }
3263 
3264 std::function<void(output_mode, int32_t, int32_t, int32_t)> &output_t::on_mode()
3265 {
3266  return std::static_pointer_cast<events_t>(get_events())->mode;
3267 }
3268 
3269 std::function<void()> &output_t::on_done()
3270 {
3271  return std::static_pointer_cast<events_t>(get_events())->done;
3272 }
3273 
3274 std::function<void(int32_t)> &output_t::on_scale()
3275 {
3276  return std::static_pointer_cast<events_t>(get_events())->scale;
3277 }
3278 
3279 int output_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
3280 {
3281  std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
3282  switch(opcode)
3283  {
3284  case 0:
3285  if(events->geometry) events->geometry(args[0].get<int32_t>(), args[1].get<int32_t>(), args[2].get<int32_t>(), args[3].get<int32_t>(), output_subpixel(args[4].get<int32_t>()), args[5].get<std::string>(), args[6].get<std::string>(), output_transform(args[7].get<int32_t>()));
3286  break;
3287  case 1:
3288  if(events->mode) events->mode(output_mode(args[0].get<uint32_t>()), args[1].get<int32_t>(), args[2].get<int32_t>(), args[3].get<int32_t>());
3289  break;
3290  case 2:
3291  if(events->done) events->done();
3292  break;
3293  case 3:
3294  if(events->scale) events->scale(args[0].get<int32_t>());
3295  break;
3296  }
3297  return 0;
3298 }
3299 
3300 const bitfield<3, 21> output_transform::normal{0};
3301 const bitfield<3, 21> output_transform::_90{1};
3302 const bitfield<3, 21> output_transform::_180{2};
3303 const bitfield<3, 21> output_transform::_270{3};
3304 const bitfield<3, 21> output_transform::flipped{4};
3305 const bitfield<3, 21> output_transform::flipped_90{5};
3306 const bitfield<3, 21> output_transform::flipped_180{6};
3307 const bitfield<3, 21> output_transform::flipped_270{7};
3308 
3309 const bitfield<2, 22> output_mode::current{0x1};
3310 const bitfield<2, 22> output_mode::preferred{0x2};
3311 
3312 
3313 region_t::region_t(const proxy_t &p)
3314  : proxy_t(p)
3315 {
3317  {
3318  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3319  set_destroy_opcode(0U);
3320  }
3321  set_interface(&region_interface);
3322  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3323  { return region_t(p); });
3324 }
3325 
3326 region_t::region_t()
3327 {
3328  set_interface(&region_interface);
3329  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3330  { return region_t(p); });
3331 }
3332 
3333 region_t::region_t(wl_region *p, wrapper_type t)
3334  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
3336  {
3337  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3338  set_destroy_opcode(0U);
3339  }
3340  set_interface(&region_interface);
3341  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3342  { return region_t(p); });
3343 }
3344 
3345 region_t::region_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
3346  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
3347  set_interface(&region_interface);
3348  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3349  { return region_t(p); });
3350 }
3351 
3352 region_t region_t::proxy_create_wrapper()
3353 {
3354  return {*this, construct_proxy_wrapper_tag()};
3355 }
3356 
3357 const std::string region_t::interface_name = "wl_region";
3358 
3359 region_t::operator wl_region*() const
3360 {
3361  return reinterpret_cast<wl_region*> (c_ptr());
3362 }
3363 
3364 void region_t::add(int32_t x, int32_t y, int32_t width, int32_t height)
3365 {
3366  marshal(1U, x, y, width, height);
3367 }
3368 
3369 void region_t::subtract(int32_t x, int32_t y, int32_t width, int32_t height)
3370 {
3371  marshal(2U, x, y, width, height);
3372 }
3373 
3374 int region_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
3375 {
3376  return 0;
3377 }
3378 
3379 subcompositor_t::subcompositor_t(const proxy_t &p)
3380  : proxy_t(p)
3381 {
3383  {
3384  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3385  set_destroy_opcode(0U);
3386  }
3387  set_interface(&subcompositor_interface);
3388  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3389  { return subcompositor_t(p); });
3390 }
3391 
3392 subcompositor_t::subcompositor_t()
3393 {
3394  set_interface(&subcompositor_interface);
3395  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3396  { return subcompositor_t(p); });
3397 }
3398 
3399 subcompositor_t::subcompositor_t(wl_subcompositor *p, wrapper_type t)
3400  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
3402  {
3403  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3404  set_destroy_opcode(0U);
3405  }
3406  set_interface(&subcompositor_interface);
3407  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3408  { return subcompositor_t(p); });
3409 }
3410 
3411 subcompositor_t::subcompositor_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
3412  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
3413  set_interface(&subcompositor_interface);
3414  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3415  { return subcompositor_t(p); });
3416 }
3417 
3418 subcompositor_t subcompositor_t::proxy_create_wrapper()
3419 {
3420  return {*this, construct_proxy_wrapper_tag()};
3421 }
3422 
3423 const std::string subcompositor_t::interface_name = "wl_subcompositor";
3424 
3425 subcompositor_t::operator wl_subcompositor*() const
3426 {
3427  return reinterpret_cast<wl_subcompositor*> (c_ptr());
3428 }
3429 
3431 {
3432  proxy_t p = marshal_constructor(1U, &subsurface_interface, nullptr, surface.proxy_has_object() ? reinterpret_cast<wl_object*>(surface.c_ptr()) : nullptr, parent.proxy_has_object() ? reinterpret_cast<wl_object*>(parent.c_ptr()) : nullptr);
3433  return subsurface_t(p);
3434 }
3435 
3436 int subcompositor_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
3437 {
3438  return 0;
3439 }
3440 
3441 
3442 subsurface_t::subsurface_t(const proxy_t &p)
3443  : proxy_t(p)
3444 {
3446  {
3447  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3448  set_destroy_opcode(0U);
3449  }
3450  set_interface(&subsurface_interface);
3451  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3452  { return subsurface_t(p); });
3453 }
3454 
3455 subsurface_t::subsurface_t()
3456 {
3457  set_interface(&subsurface_interface);
3458  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3459  { return subsurface_t(p); });
3460 }
3461 
3462 subsurface_t::subsurface_t(wl_subsurface *p, wrapper_type t)
3463  : proxy_t(reinterpret_cast<wl_proxy*> (p), t){
3465  {
3466  set_events(std::shared_ptr<detail::events_base_t>(new events_t), dispatcher);
3467  set_destroy_opcode(0U);
3468  }
3469  set_interface(&subsurface_interface);
3470  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3471  { return subsurface_t(p); });
3472 }
3473 
3474 subsurface_t::subsurface_t(proxy_t const &wrapped_proxy, construct_proxy_wrapper_tag /*unused*/)
3475  : proxy_t(wrapped_proxy, construct_proxy_wrapper_tag()){
3476  set_interface(&subsurface_interface);
3477  set_copy_constructor([] (const proxy_t &p) -> proxy_t
3478  { return subsurface_t(p); });
3479 }
3480 
3481 subsurface_t subsurface_t::proxy_create_wrapper()
3482 {
3483  return {*this, construct_proxy_wrapper_tag()};
3484 }
3485 
3486 const std::string subsurface_t::interface_name = "wl_subsurface";
3487 
3488 subsurface_t::operator wl_subsurface*() const
3489 {
3490  return reinterpret_cast<wl_subsurface*> (c_ptr());
3491 }
3492 
3493 void subsurface_t::set_position(int32_t x, int32_t y)
3494 {
3495  marshal(1U, x, y);
3496 }
3497 
3499 {
3500  marshal(2U, sibling.proxy_has_object() ? reinterpret_cast<wl_object*>(sibling.c_ptr()) : nullptr);
3501 }
3502 
3504 {
3505  marshal(3U, sibling.proxy_has_object() ? reinterpret_cast<wl_object*>(sibling.c_ptr()) : nullptr);
3506 }
3507 
3509 {
3510  marshal(4U);
3511 }
3512 
3514 {
3515  marshal(5U);
3516 }
3517 
3518 int subsurface_t::dispatcher(uint32_t opcode, const std::vector<any>& args, const std::shared_ptr<detail::events_base_t>& e)
3519 {
3520  return 0;
3521 }
3522 
3523 
3524 
shared memory support
static const detail::bitfield< 4, 8 > bottom
bottom edge
std::function< void(uint32_t)> & on_ping()
ping client
static constexpr std::uint32_t release_since_version
Minimum protocol version required for the release function.
std::function< void(std::string, int)> & on_send()
send the data
void set_buffer_scale(int32_t scale)
sets the buffer scaling factor
std::function< void()> & on_popup_done()
popup interaction is done
void release()
destroy data device
void pong(uint32_t serial)
respond to a ping event
void accept(uint32_t serial, std::string const &mime_type)
accept one of the offered mime types
void set_opaque_region(region_t const &region)
set opaque region
std::function< void(shm_format)> & on_format()
pixel format description
void set_transient(surface_t const &parent, int32_t x, int32_t y, shell_surface_transient const &flags)
make the surface a transient surface
std::function< void(uint32_t)> & on_done()
done event
std::function< void(uint32_t, uint32_t, surface_t, int32_t, double, double)> & on_down()
touch down event and beginning of a touch sequence
std::function< void(std::string)> & on_offer()
advertise offered mime type
content for a wl_surface
std::function< void(uint32_t, surface_t)> & on_leave()
leave event
std::function< void(int32_t, int32_t, int32_t, int32_t, output_subpixel, std::string, std::string, output_transform)> & on_geometry()
properties of the output
bool can_release() const
Check whether the release function is available with the currently bound version of the protocol...
static constexpr std::uint32_t release_since_version
Minimum protocol version required for the release function.
void add(int32_t x, int32_t y, int32_t width, int32_t height)
add rectangle to region
bool can_release() const
Check whether the release function is available with the currently bound version of the protocol...
std::function< void(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)> & on_modifiers()
modifier and group state
shm_pool_t create_pool(int fd, int32_t size)
create a shm pool
void set_cursor(uint32_t serial, surface_t const &surface, int32_t hotspot_x, int32_t hotspot_y)
set the pointer surface
void set_input_region(region_t const &region)
set input region
static const detail::bitfield< 3, 21 > normal
no transform
static const detail::bitfield< 3, 6 > ask
ask action
group of input devices
bool can_release() const
Check whether the release function is available with the currently bound version of the protocol...
bool can_release() const
Check whether the release function is available with the currently bound version of the protocol...
wl_proxy * c_ptr() const
Get a pointer to the underlying C struct.
std::function< void(uint32_t)> & on_global_remove()
announce removal of global object
std::function< void()> & on_frame()
end of touch frame event
std::function< void()> & on_done()
sent all information about output
std::function< void(uint32_t, uint32_t, uint32_t, keyboard_key_state)> & on_key()
key event
void place_below(surface_t const &sibling)
restack the sub-surface
bool can_release() const
Check whether the release function is available with the currently bound version of the protocol...
static const detail::bitfield< 3, 21 > flipped_270
flip and rotate 270 degrees counter-clockwise
static constexpr std::uint32_t release_since_version
Minimum protocol version required for the release function.
wrapper_type get_wrapper_type() const
Get the type of a proxy object.
void set_actions(data_device_manager_dnd_action const &dnd_actions, data_device_manager_dnd_action const &preferred_action)
set the available/preferred drag-and-drop actions
static const detail::bitfield< 4, 8 > top
top edge
proxy_t bind(uint32_t name, proxy_t &interface, uint32_t version)
bind an object to the display
desktop-style metadata interface
static const detail::bitfield< 1, 9 > inactive
do not set keyboard focus
void set_buffer_transform(output_transform const &transform)
sets the buffer transformation
void move(seat_t const &seat, uint32_t serial)
start an interactive move
static const detail::bitfield< 3, 21 > flipped_90
flip and rotate 90 degrees counter-clockwise
void set_position(int32_t x, int32_t y)
reposition the sub-surface
std::function< void(uint32_t, pointer_axis)> & on_axis_stop()
axis stop event
compositor output region
static constexpr std::uint32_t damage_buffer_since_version
Minimum protocol version required for the damage_buffer function.
std::function< void()> & on_dnd_finished()
the drag-and-drop operation concluded
std::function< void(uint32_t, surface_t, double, double, data_offer_t)> & on_enter()
initiate drag-and-drop session
void release()
release the output object
static const detail::bitfield< 3, 21 > flipped_180
flip and rotate 180 degrees counter-clockwise
void release()
release the keyboard object
static constexpr std::uint32_t release_since_version
Minimum protocol version required for the release function.
void finish()
the offer will no longer be used
std::function< void()> & on_dnd_drop_performed()
the drag-and-drop operation physically finished
void commit()
commit pending surface state
details of transient behaviour
subsurface_t get_subsurface(surface_t const &surface, surface_t const &parent)
give a surface the role sub-surface
std::function< void()> & on_release()
compositor releases buffer
static constexpr std::uint32_t release_since_version
Minimum protocol version required for the release function.
static const detail::bitfield< 3, 21 > _180
180 degrees counter-clockwise
std::function< void(keyboard_keymap_format, int, uint32_t)> & on_keymap()
keyboard mapping
static const detail::bitfield< 2, 22 > current
indicates this is the current mode
std::function< void(uint32_t, uint32_t, uint32_t, pointer_button_state)> & on_button()
pointer button event
std::function< void(uint32_t, std::string, uint32_t)> & on_global()
announce global object
pointer_t get_pointer()
return pointer object
bool can_set_actions() const
Check whether the set_actions function is available with the currently bound version of the protocol...
uint32_t get_version() const
Get the protocol object version of a proxy object.
void release()
release the seat object
global registry object
static const detail::bitfield< 3, 6 > none
no action
std::function< void(data_offer_t)> & on_data_offer()
introduce a new wl_data_offer
std::function< void()> & on_drop()
end drag-and-drop session successfully
void set_title(std::string const &title)
set surface title
the compositor singleton
std::function< void(output_t)> & on_enter()
surface enters an output
void set_fullscreen(shell_surface_fullscreen_method const &method, uint32_t framerate, output_t const &output)
make the surface a fullscreen surface
std::function< void(uint32_t, double, double)> & on_motion()
drag-and-drop session motion
static const detail::bitfield< 3, 12 > pointer
the seat has pointer devices
static const detail::bitfield< 3, 6 > copy
copy action
static const detail::bitfield< 2, 22 > preferred
indicates this is the preferred mode
std::function< void(uint32_t, surface_t, array_t)> & on_enter()
enter event
std::function< void(uint32_t, uint32_t, int32_t)> & on_up()
end of a touch event sequence
void receive(std::string const &mime_type, int fd)
request that the data is transferred
static const detail::bitfield< 4, 8 > right
right edge
static const detail::bitfield< 4, 8 > top_left
top and left edges
bool can_damage_buffer() const
Check whether the damage_buffer function is available with the currently bound version of the protoco...
void resize(int32_t size)
change the size of the pool mapping
static const detail::bitfield< 4, 8 > bottom_right
bottom and right edges
data_source_t create_data_source()
create a new data source
std::function< void(uint32_t, surface_t)> & on_leave()
leave event
void subtract(int32_t x, int32_t y, int32_t width, int32_t height)
subtract rectangle from region
static const detail::bitfield< 3, 12 > keyboard
the seat has one or more keyboards
static const detail::bitfield< 3, 21 > _90
90 degrees counter-clockwise
void resize(seat_t const &seat, uint32_t serial, shell_surface_resize const &edges)
start an interactive resize
void set_maximized(output_t const &output)
make the surface a maximized surface
sub-surface interface to a wl_surface
bool can_set_actions() const
Check whether the set_actions function is available with the currently bound version of the protocol...
void release()
release the pointer object
keyboard input device
Represents a protocol object on the client side.
void release()
release the touch object
void place_above(surface_t const &sibling)
restack the sub-surface
static const detail::bitfield< 3, 12 > touch
the seat has touch devices
void set_desync()
set sub-surface to desynchronized mode
std::function< void()> & on_frame()
end of a pointer event sequence
static constexpr std::uint32_t finish_since_version
Minimum protocol version required for the finish function.
std::function< void()> & on_cancel()
touch session cancelled
void set_toplevel()
make the surface a toplevel surface
static const detail::bitfield< 4, 8 > top_right
top and right edges
shell_surface_t get_shell_surface(surface_t const &surface)
create a shell surface from a surface
create desktop-style surfaces
std::function< void(data_offer_t)> & on_selection()
advertise new selection
std::function< void(uint32_t, double, double)> & on_motion()
pointer motion event
std::function< void(pointer_axis_source)> & on_axis_source()
axis source event
buffer_t create_buffer(int32_t offset, int32_t width, int32_t height, int32_t stride, shm_format const &format)
create a buffer from the pool
void damage(int32_t x, int32_t y, int32_t width, int32_t height)
mark part of the surface damaged
void offer(std::string const &mime_type)
add an offered mime type
static constexpr std::uint32_t set_buffer_scale_since_version
Minimum protocol version required for the set_buffer_scale function.
void attach(buffer_t const &buffer, int32_t x, int32_t y)
set the surface contents
static constexpr std::uint32_t set_buffer_transform_since_version
Minimum protocol version required for the set_buffer_transform function.
surface_t create_surface()
create new surface
void start_drag(data_source_t const &source, surface_t const &origin, surface_t const &icon, uint32_t serial)
start drag-and-drop operation
std::function< void(data_device_manager_dnd_action)> & on_action()
notify the selected action
static const detail::bitfield< 4, 8 > left
left edge
std::function< void(data_device_manager_dnd_action)> & on_action()
notify the selected action
void set_selection(data_source_t const &source, uint32_t serial)
copy data to the selection
void set_popup(seat_t const &seat, uint32_t serial, surface_t const &parent, int32_t x, int32_t y, shell_surface_transient const &flags)
make the surface a popup surface
bool can_release() const
Check whether the release function is available with the currently bound version of the protocol...
bool can_set_buffer_scale() const
Check whether the set_buffer_scale function is available with the currently bound version of the prot...
static const detail::bitfield< 3, 21 > flipped
180 degree flip around a vertical axis
std::function< void(int32_t)> & on_scale()
output scaling properties
std::function< void(output_t)> & on_leave()
surface leaves an output
std::function< void(std::string)> & on_target()
a target accepts an offered mime type
std::function< void(int32_t, double)> & on_orientation()
update orientation of touch point
bool proxy_has_object() const
Check whether this wrapper actually wraps an object.
static constexpr std::uint32_t set_actions_since_version
Minimum protocol version required for the set_actions function.
std::function< void()> & on_cancelled()
selection was cancelled
bool can_set_buffer_transform() const
Check whether the set_buffer_transform function is available with the currently bound version of the ...
static constexpr std::uint32_t release_since_version
Minimum protocol version required for the release function.
std::function< void(shell_surface_resize, int32_t, int32_t)> & on_configure()
suggest resize
std::function< void(int32_t, double, double)> & on_shape()
update shape of touch point
std::function< void(seat_capability)> & on_capabilities()
seat capabilities changed
std::function< void(int32_t, int32_t)> & on_repeat_info()
repeat rate and delay
static const detail::bitfield< 4, 8 > bottom_left
bottom and left edges
void set_class(std::string const &class_)
set surface class
static const detail::bitfield< 4, 8 > none
no edge
std::function< void(uint32_t, pointer_axis, double)> & on_axis()
axis event
std::function< void(std::string)> & on_name()
unique identifier for this seat
std::function< void(output_mode, int32_t, int32_t, int32_t)> & on_mode()
advertise available modes for the output
callback_t frame()
request a frame throttling hint
region_t create_region()
create new region
std::function< void()> & on_leave()
end drag-and-drop session
void damage_buffer(int32_t x, int32_t y, int32_t width, int32_t height)
mark part of the surface damaged using buffer coordinates
std::function< void(data_device_manager_dnd_action)> & on_source_actions()
notify the source-side available actions
void set_sync()
set sub-surface to synchronized mode
keyboard_t get_keyboard()
return keyboard object
std::function< void(uint32_t, int32_t, double, double)> & on_motion()
update of touch point coordinates
static const detail::bitfield< 3, 6 > move
move action
static constexpr std::uint32_t set_actions_since_version
Minimum protocol version required for the set_actions function.
std::function< void(pointer_axis, int32_t)> & on_axis_discrete()
axis click event
std::function< void(uint32_t, surface_t, double, double)> & on_enter()
enter event
bool can_finish() const
Check whether the finish function is available with the currently bound version of the protocol...
data_device_t get_data_device(seat_t const &seat)
create a new data device
transform from framebuffer to output
static const detail::bitfield< 3, 21 > _270
270 degrees counter-clockwise
offer to transfer data
touch_t get_touch()
return touch object
void set_actions(data_device_manager_dnd_action const &dnd_actions)
set the available drag-and-drop actions
touchscreen input device