1#include <wayland-server-protocol.hpp>
3using namespace wayland;
4using namespace wayland::detail;
5using namespace wayland::server;
6using namespace wayland::server::detail;
8const wl_interface* display_interface_sync_request_server[1] = {
12const wl_interface* display_interface_get_registry_request_server[1] = {
16const wl_interface* display_interface_error_event_server[3] = {
22const wl_interface* display_interface_delete_id_event_server[1] = {
26const wl_message display_interface_requests_server[2] = {
30 display_interface_sync_request_server,
35 display_interface_get_registry_request_server,
39const wl_message display_interface_events_server[2] = {
43 display_interface_error_event_server,
48 display_interface_delete_id_event_server,
52const wl_interface wayland::server::detail::display_interface =
57 display_interface_requests_server,
59 display_interface_events_server,
62const wl_interface* registry_interface_bind_request_server[2] = {
67const wl_interface* registry_interface_global_event_server[3] = {
73const wl_interface* registry_interface_global_remove_event_server[1] = {
77const wl_message registry_interface_requests_server[1] = {
81 registry_interface_bind_request_server,
85const wl_message registry_interface_events_server[2] = {
89 registry_interface_global_event_server,
94 registry_interface_global_remove_event_server,
98const wl_interface wayland::server::detail::registry_interface =
103 registry_interface_requests_server,
105 registry_interface_events_server,
108const wl_interface* callback_interface_done_event_server[1] = {
112const wl_message callback_interface_requests_server[0] = {
115const wl_message callback_interface_events_server[1] = {
119 callback_interface_done_event_server,
123const wl_interface wayland::server::detail::callback_interface =
128 callback_interface_requests_server,
130 callback_interface_events_server,
133const wl_interface* compositor_interface_create_surface_request_server[1] = {
137const wl_interface* compositor_interface_create_region_request_server[1] = {
141const wl_message compositor_interface_requests_server[2] = {
145 compositor_interface_create_surface_request_server,
150 compositor_interface_create_region_request_server,
154const wl_message compositor_interface_events_server[0] = {
157const wl_interface wayland::server::detail::compositor_interface =
162 compositor_interface_requests_server,
164 compositor_interface_events_server,
167const wl_interface* shm_pool_interface_create_buffer_request_server[6] = {
176const wl_interface* shm_pool_interface_destroy_request_server[0] = {
179const wl_interface* shm_pool_interface_resize_request_server[1] = {
183const wl_message shm_pool_interface_requests_server[3] = {
187 shm_pool_interface_create_buffer_request_server,
192 shm_pool_interface_destroy_request_server,
197 shm_pool_interface_resize_request_server,
201const wl_message shm_pool_interface_events_server[0] = {
204const wl_interface wayland::server::detail::shm_pool_interface =
209 shm_pool_interface_requests_server,
211 shm_pool_interface_events_server,
214const wl_interface* shm_interface_create_pool_request_server[3] = {
220const wl_interface* shm_interface_format_event_server[1] = {
224const wl_message shm_interface_requests_server[1] = {
228 shm_interface_create_pool_request_server,
232const wl_message shm_interface_events_server[1] = {
236 shm_interface_format_event_server,
240const wl_interface wayland::server::detail::shm_interface =
245 shm_interface_requests_server,
247 shm_interface_events_server,
250const wl_interface* buffer_interface_destroy_request_server[0] = {
253const wl_interface* buffer_interface_release_event_server[0] = {
256const wl_message buffer_interface_requests_server[1] = {
260 buffer_interface_destroy_request_server,
264const wl_message buffer_interface_events_server[1] = {
268 buffer_interface_release_event_server,
272const wl_interface wayland::server::detail::buffer_interface =
277 buffer_interface_requests_server,
279 buffer_interface_events_server,
282const wl_interface* data_offer_interface_accept_request_server[2] = {
287const wl_interface* data_offer_interface_receive_request_server[2] = {
292const wl_interface* data_offer_interface_destroy_request_server[0] = {
295const wl_interface* data_offer_interface_finish_request_server[0] = {
298const wl_interface* data_offer_interface_set_actions_request_server[2] = {
303const wl_interface* data_offer_interface_offer_event_server[1] = {
307const wl_interface* data_offer_interface_source_actions_event_server[1] = {
311const wl_interface* data_offer_interface_action_event_server[1] = {
315const wl_message data_offer_interface_requests_server[5] = {
319 data_offer_interface_accept_request_server,
324 data_offer_interface_receive_request_server,
329 data_offer_interface_destroy_request_server,
334 data_offer_interface_finish_request_server,
339 data_offer_interface_set_actions_request_server,
343const wl_message data_offer_interface_events_server[3] = {
347 data_offer_interface_offer_event_server,
352 data_offer_interface_source_actions_event_server,
357 data_offer_interface_action_event_server,
361const wl_interface wayland::server::detail::data_offer_interface =
366 data_offer_interface_requests_server,
368 data_offer_interface_events_server,
371const wl_interface* data_source_interface_offer_request_server[1] = {
375const wl_interface* data_source_interface_destroy_request_server[0] = {
378const wl_interface* data_source_interface_set_actions_request_server[1] = {
382const wl_interface* data_source_interface_target_event_server[1] = {
386const wl_interface* data_source_interface_send_event_server[2] = {
391const wl_interface* data_source_interface_cancelled_event_server[0] = {
394const wl_interface* data_source_interface_dnd_drop_performed_event_server[0] = {
397const wl_interface* data_source_interface_dnd_finished_event_server[0] = {
400const wl_interface* data_source_interface_action_event_server[1] = {
404const wl_message data_source_interface_requests_server[3] = {
408 data_source_interface_offer_request_server,
413 data_source_interface_destroy_request_server,
418 data_source_interface_set_actions_request_server,
422const wl_message data_source_interface_events_server[6] = {
426 data_source_interface_target_event_server,
431 data_source_interface_send_event_server,
436 data_source_interface_cancelled_event_server,
439 "dnd_drop_performed",
441 data_source_interface_dnd_drop_performed_event_server,
446 data_source_interface_dnd_finished_event_server,
451 data_source_interface_action_event_server,
455const wl_interface wayland::server::detail::data_source_interface =
460 data_source_interface_requests_server,
462 data_source_interface_events_server,
465const wl_interface* data_device_interface_start_drag_request_server[4] = {
466 &data_source_interface,
472const wl_interface* data_device_interface_set_selection_request_server[2] = {
473 &data_source_interface,
477const wl_interface* data_device_interface_release_request_server[0] = {
480const wl_interface* data_device_interface_data_offer_event_server[1] = {
481 &data_offer_interface,
484const wl_interface* data_device_interface_enter_event_server[5] = {
489 &data_offer_interface,
492const wl_interface* data_device_interface_leave_event_server[0] = {
495const wl_interface* data_device_interface_motion_event_server[3] = {
501const wl_interface* data_device_interface_drop_event_server[0] = {
504const wl_interface* data_device_interface_selection_event_server[1] = {
505 &data_offer_interface,
508const wl_message data_device_interface_requests_server[3] = {
512 data_device_interface_start_drag_request_server,
517 data_device_interface_set_selection_request_server,
522 data_device_interface_release_request_server,
526const wl_message data_device_interface_events_server[6] = {
530 data_device_interface_data_offer_event_server,
535 data_device_interface_enter_event_server,
540 data_device_interface_leave_event_server,
545 data_device_interface_motion_event_server,
550 data_device_interface_drop_event_server,
555 data_device_interface_selection_event_server,
559const wl_interface wayland::server::detail::data_device_interface =
564 data_device_interface_requests_server,
566 data_device_interface_events_server,
569const wl_interface* data_device_manager_interface_create_data_source_request_server[1] = {
570 &data_source_interface,
573const wl_interface* data_device_manager_interface_get_data_device_request_server[2] = {
574 &data_device_interface,
578const wl_message data_device_manager_interface_requests_server[2] = {
580 "create_data_source",
582 data_device_manager_interface_create_data_source_request_server,
587 data_device_manager_interface_get_data_device_request_server,
591const wl_message data_device_manager_interface_events_server[0] = {
594const wl_interface wayland::server::detail::data_device_manager_interface =
596 "wl_data_device_manager",
599 data_device_manager_interface_requests_server,
601 data_device_manager_interface_events_server,
604const wl_interface* shell_interface_get_shell_surface_request_server[2] = {
605 &shell_surface_interface,
609const wl_message shell_interface_requests_server[1] = {
613 shell_interface_get_shell_surface_request_server,
617const wl_message shell_interface_events_server[0] = {
620const wl_interface wayland::server::detail::shell_interface =
625 shell_interface_requests_server,
627 shell_interface_events_server,
630const wl_interface* shell_surface_interface_pong_request_server[1] = {
634const wl_interface* shell_surface_interface_move_request_server[2] = {
639const wl_interface* shell_surface_interface_resize_request_server[3] = {
645const wl_interface* shell_surface_interface_set_toplevel_request_server[0] = {
648const wl_interface* shell_surface_interface_set_transient_request_server[4] = {
655const wl_interface* shell_surface_interface_set_fullscreen_request_server[3] = {
661const wl_interface* shell_surface_interface_set_popup_request_server[6] = {
670const wl_interface* shell_surface_interface_set_maximized_request_server[1] = {
674const wl_interface* shell_surface_interface_set_title_request_server[1] = {
678const wl_interface* shell_surface_interface_set_class_request_server[1] = {
682const wl_interface* shell_surface_interface_ping_event_server[1] = {
686const wl_interface* shell_surface_interface_configure_event_server[3] = {
692const wl_interface* shell_surface_interface_popup_done_event_server[0] = {
695const wl_message shell_surface_interface_requests_server[10] = {
699 shell_surface_interface_pong_request_server,
704 shell_surface_interface_move_request_server,
709 shell_surface_interface_resize_request_server,
714 shell_surface_interface_set_toplevel_request_server,
719 shell_surface_interface_set_transient_request_server,
724 shell_surface_interface_set_fullscreen_request_server,
729 shell_surface_interface_set_popup_request_server,
734 shell_surface_interface_set_maximized_request_server,
739 shell_surface_interface_set_title_request_server,
744 shell_surface_interface_set_class_request_server,
748const wl_message shell_surface_interface_events_server[3] = {
752 shell_surface_interface_ping_event_server,
757 shell_surface_interface_configure_event_server,
762 shell_surface_interface_popup_done_event_server,
766const wl_interface wayland::server::detail::shell_surface_interface =
771 shell_surface_interface_requests_server,
773 shell_surface_interface_events_server,
776const wl_interface* surface_interface_destroy_request_server[0] = {
779const wl_interface* surface_interface_attach_request_server[3] = {
785const wl_interface* surface_interface_damage_request_server[4] = {
792const wl_interface* surface_interface_frame_request_server[1] = {
796const wl_interface* surface_interface_set_opaque_region_request_server[1] = {
800const wl_interface* surface_interface_set_input_region_request_server[1] = {
804const wl_interface* surface_interface_commit_request_server[0] = {
807const wl_interface* surface_interface_set_buffer_transform_request_server[1] = {
811const wl_interface* surface_interface_set_buffer_scale_request_server[1] = {
815const wl_interface* surface_interface_damage_buffer_request_server[4] = {
822const wl_interface* surface_interface_offset_request_server[2] = {
827const wl_interface* surface_interface_enter_event_server[1] = {
831const wl_interface* surface_interface_leave_event_server[1] = {
835const wl_message surface_interface_requests_server[11] = {
839 surface_interface_destroy_request_server,
844 surface_interface_attach_request_server,
849 surface_interface_damage_request_server,
854 surface_interface_frame_request_server,
859 surface_interface_set_opaque_region_request_server,
864 surface_interface_set_input_region_request_server,
869 surface_interface_commit_request_server,
872 "set_buffer_transform",
874 surface_interface_set_buffer_transform_request_server,
879 surface_interface_set_buffer_scale_request_server,
884 surface_interface_damage_buffer_request_server,
889 surface_interface_offset_request_server,
893const wl_message surface_interface_events_server[2] = {
897 surface_interface_enter_event_server,
902 surface_interface_leave_event_server,
906const wl_interface wayland::server::detail::surface_interface =
911 surface_interface_requests_server,
913 surface_interface_events_server,
916const wl_interface* seat_interface_get_pointer_request_server[1] = {
920const wl_interface* seat_interface_get_keyboard_request_server[1] = {
924const wl_interface* seat_interface_get_touch_request_server[1] = {
928const wl_interface* seat_interface_release_request_server[0] = {
931const wl_interface* seat_interface_capabilities_event_server[1] = {
935const wl_interface* seat_interface_name_event_server[1] = {
939const wl_message seat_interface_requests_server[4] = {
943 seat_interface_get_pointer_request_server,
948 seat_interface_get_keyboard_request_server,
953 seat_interface_get_touch_request_server,
958 seat_interface_release_request_server,
962const wl_message seat_interface_events_server[2] = {
966 seat_interface_capabilities_event_server,
971 seat_interface_name_event_server,
975const wl_interface wayland::server::detail::seat_interface =
980 seat_interface_requests_server,
982 seat_interface_events_server,
985const wl_interface* pointer_interface_set_cursor_request_server[4] = {
992const wl_interface* pointer_interface_release_request_server[0] = {
995const wl_interface* pointer_interface_enter_event_server[4] = {
1002const wl_interface* pointer_interface_leave_event_server[2] = {
1007const wl_interface* pointer_interface_motion_event_server[3] = {
1013const wl_interface* pointer_interface_button_event_server[4] = {
1020const wl_interface* pointer_interface_axis_event_server[3] = {
1026const wl_interface* pointer_interface_frame_event_server[0] = {
1029const wl_interface* pointer_interface_axis_source_event_server[1] = {
1033const wl_interface* pointer_interface_axis_stop_event_server[2] = {
1038const wl_interface* pointer_interface_axis_discrete_event_server[2] = {
1043const wl_interface* pointer_interface_axis_value120_event_server[2] = {
1048const wl_message pointer_interface_requests_server[2] = {
1052 pointer_interface_set_cursor_request_server,
1057 pointer_interface_release_request_server,
1061const wl_message pointer_interface_events_server[10] = {
1065 pointer_interface_enter_event_server,
1070 pointer_interface_leave_event_server,
1075 pointer_interface_motion_event_server,
1080 pointer_interface_button_event_server,
1085 pointer_interface_axis_event_server,
1090 pointer_interface_frame_event_server,
1095 pointer_interface_axis_source_event_server,
1100 pointer_interface_axis_stop_event_server,
1105 pointer_interface_axis_discrete_event_server,
1110 pointer_interface_axis_value120_event_server,
1114const wl_interface wayland::server::detail::pointer_interface =
1119 pointer_interface_requests_server,
1121 pointer_interface_events_server,
1124const wl_interface* keyboard_interface_release_request_server[0] = {
1127const wl_interface* keyboard_interface_keymap_event_server[3] = {
1133const wl_interface* keyboard_interface_enter_event_server[3] = {
1139const wl_interface* keyboard_interface_leave_event_server[2] = {
1144const wl_interface* keyboard_interface_key_event_server[4] = {
1151const wl_interface* keyboard_interface_modifiers_event_server[5] = {
1159const wl_interface* keyboard_interface_repeat_info_event_server[2] = {
1164const wl_message keyboard_interface_requests_server[1] = {
1168 keyboard_interface_release_request_server,
1172const wl_message keyboard_interface_events_server[6] = {
1176 keyboard_interface_keymap_event_server,
1181 keyboard_interface_enter_event_server,
1186 keyboard_interface_leave_event_server,
1191 keyboard_interface_key_event_server,
1196 keyboard_interface_modifiers_event_server,
1201 keyboard_interface_repeat_info_event_server,
1205const wl_interface wayland::server::detail::keyboard_interface =
1210 keyboard_interface_requests_server,
1212 keyboard_interface_events_server,
1215const wl_interface* touch_interface_release_request_server[0] = {
1218const wl_interface* touch_interface_down_event_server[6] = {
1227const wl_interface* touch_interface_up_event_server[3] = {
1233const wl_interface* touch_interface_motion_event_server[4] = {
1240const wl_interface* touch_interface_frame_event_server[0] = {
1243const wl_interface* touch_interface_cancel_event_server[0] = {
1246const wl_interface* touch_interface_shape_event_server[3] = {
1252const wl_interface* touch_interface_orientation_event_server[2] = {
1257const wl_message touch_interface_requests_server[1] = {
1261 touch_interface_release_request_server,
1265const wl_message touch_interface_events_server[7] = {
1269 touch_interface_down_event_server,
1274 touch_interface_up_event_server,
1279 touch_interface_motion_event_server,
1284 touch_interface_frame_event_server,
1289 touch_interface_cancel_event_server,
1294 touch_interface_shape_event_server,
1299 touch_interface_orientation_event_server,
1303const wl_interface wayland::server::detail::touch_interface =
1308 touch_interface_requests_server,
1310 touch_interface_events_server,
1313const wl_interface* output_interface_release_request_server[0] = {
1316const wl_interface* output_interface_geometry_event_server[8] = {
1327const wl_interface* output_interface_mode_event_server[4] = {
1334const wl_interface* output_interface_done_event_server[0] = {
1337const wl_interface* output_interface_scale_event_server[1] = {
1341const wl_interface* output_interface_name_event_server[1] = {
1345const wl_interface* output_interface_description_event_server[1] = {
1349const wl_message output_interface_requests_server[1] = {
1353 output_interface_release_request_server,
1357const wl_message output_interface_events_server[6] = {
1361 output_interface_geometry_event_server,
1366 output_interface_mode_event_server,
1371 output_interface_done_event_server,
1376 output_interface_scale_event_server,
1381 output_interface_name_event_server,
1386 output_interface_description_event_server,
1390const wl_interface wayland::server::detail::output_interface =
1395 output_interface_requests_server,
1397 output_interface_events_server,
1400const wl_interface* region_interface_destroy_request_server[0] = {
1403const wl_interface* region_interface_add_request_server[4] = {
1410const wl_interface* region_interface_subtract_request_server[4] = {
1417const wl_message region_interface_requests_server[3] = {
1421 region_interface_destroy_request_server,
1426 region_interface_add_request_server,
1431 region_interface_subtract_request_server,
1435const wl_message region_interface_events_server[0] = {
1438const wl_interface wayland::server::detail::region_interface =
1443 region_interface_requests_server,
1445 region_interface_events_server,
1448const wl_interface* subcompositor_interface_destroy_request_server[0] = {
1451const wl_interface* subcompositor_interface_get_subsurface_request_server[3] = {
1452 &subsurface_interface,
1457const wl_message subcompositor_interface_requests_server[2] = {
1461 subcompositor_interface_destroy_request_server,
1466 subcompositor_interface_get_subsurface_request_server,
1470const wl_message subcompositor_interface_events_server[0] = {
1473const wl_interface wayland::server::detail::subcompositor_interface =
1478 subcompositor_interface_requests_server,
1480 subcompositor_interface_events_server,
1483const wl_interface* subsurface_interface_destroy_request_server[0] = {
1486const wl_interface* subsurface_interface_set_position_request_server[2] = {
1491const wl_interface* subsurface_interface_place_above_request_server[1] = {
1495const wl_interface* subsurface_interface_place_below_request_server[1] = {
1499const wl_interface* subsurface_interface_set_sync_request_server[0] = {
1502const wl_interface* subsurface_interface_set_desync_request_server[0] = {
1505const wl_message subsurface_interface_requests_server[6] = {
1509 subsurface_interface_destroy_request_server,
1514 subsurface_interface_set_position_request_server,
1519 subsurface_interface_place_above_request_server,
1524 subsurface_interface_place_below_request_server,
1529 subsurface_interface_set_sync_request_server,
1534 subsurface_interface_set_desync_request_server,
1538const wl_message subsurface_interface_events_server[0] = {
1541const wl_interface wayland::server::detail::subsurface_interface =
1546 subsurface_interface_requests_server,
1548 subsurface_interface_events_server,
1551registry_t::registry_t(
const client_t& client, uint32_t
id,
int version)
1552 : resource_t(client, &server::detail::registry_interface, id, version)
1554 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1557registry_t::registry_t(
const resource_t &resource)
1558 : resource_t(resource)
1560 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1563const std::string registry_t::interface_name =
"wl_registry";
1565registry_t::operator wl_registry*()
const
1567 return reinterpret_cast<wl_registry*
> (c_ptr());
1572 return std::static_pointer_cast<events_t>(get_events())->bind;
1578 send_event(post, 0, name, interface, version);
1583 send_event(post, 1, name);
1586int registry_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
1588 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1592 if(events->bind) events->bind(args[0].get<uint32_t>(), args[1].get<resource_t>());
1598callback_t::callback_t(
const client_t& client, uint32_t
id,
int version)
1599 : resource_t(client, &server::detail::callback_interface, id, version)
1601 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1604callback_t::callback_t(
const resource_t &resource)
1605 : resource_t(resource)
1607 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1610const std::string callback_t::interface_name =
"wl_callback";
1612callback_t::operator wl_callback*()
const
1614 return reinterpret_cast<wl_callback*
> (c_ptr());
1619 send_event(post, 0, callback_data);
1622int callback_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
1627compositor_t::compositor_t(
const client_t& client, uint32_t
id,
int version)
1628 : resource_t(client, &server::detail::compositor_interface, id, version)
1630 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1633compositor_t::compositor_t(
const resource_t &resource)
1634 : resource_t(resource)
1636 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1639const std::string compositor_t::interface_name =
"wl_compositor";
1641compositor_t::operator wl_compositor*()
const
1643 return reinterpret_cast<wl_compositor*
> (c_ptr());
1648 return std::static_pointer_cast<events_t>(get_events())->create_surface;
1654 return std::static_pointer_cast<events_t>(get_events())->create_region;
1658int compositor_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
1660 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1664 if(events->create_surface) events->create_surface(
surface_t(args[0].get<resource_t>()));
1667 if(events->create_region) events->create_region(
region_t(args[0].get<resource_t>()));
1673shm_pool_t::shm_pool_t(
const client_t& client, uint32_t
id,
int version)
1674 : resource_t(client, &server::detail::shm_pool_interface, id, version)
1676 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1679shm_pool_t::shm_pool_t(
const resource_t &resource)
1680 : resource_t(resource)
1682 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1685const std::string shm_pool_t::interface_name =
"wl_shm_pool";
1687shm_pool_t::operator wl_shm_pool*()
const
1689 return reinterpret_cast<wl_shm_pool*
> (c_ptr());
1694 return std::static_pointer_cast<events_t>(get_events())->create_buffer;
1700 return std::static_pointer_cast<events_t>(get_events())->destroy;
1706 return std::static_pointer_cast<events_t>(get_events())->resize;
1710int shm_pool_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
1712 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1716 if(events->create_buffer) events->create_buffer(
buffer_t(args[0].get<resource_t>()), args[1].get<int32_t>(), args[2].get<int32_t>(), args[3].get<int32_t>(), args[4].get<int32_t>(), shm_format(args[5].get<uint32_t>()));
1719 if(events->destroy) events->destroy();
1722 if(events->resize) events->resize(args[0].get<int32_t>());
1728shm_t::shm_t(
const client_t& client, uint32_t
id,
int version)
1729 : resource_t(client, &server::detail::shm_interface, id, version)
1731 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1734shm_t::shm_t(
const resource_t &resource)
1735 : resource_t(resource)
1737 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1740const std::string shm_t::interface_name =
"wl_shm";
1742shm_t::operator wl_shm*()
const
1744 return reinterpret_cast<wl_shm*
> (c_ptr());
1749 return std::static_pointer_cast<events_t>(get_events())->create_pool;
1755 send_event(post, 0,
static_cast<uint32_t
>(
format));
1760 post_error(
static_cast<uint32_t
>(shm_error::invalid_format), msg);
1765 post_error(
static_cast<uint32_t
>(shm_error::invalid_stride), msg);
1770 post_error(
static_cast<uint32_t
>(shm_error::invalid_fd), msg);
1773int shm_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
1775 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1779 if(events->create_pool) events->create_pool(
shm_pool_t(args[0].get<resource_t>()), args[1].get<int>(), args[2].get<int32_t>());
1787buffer_t::buffer_t(
const client_t& client, uint32_t
id,
int version)
1788 : resource_t(client, &server::detail::buffer_interface, id, version)
1790 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1793buffer_t::buffer_t(
const resource_t &resource)
1794 : resource_t(resource)
1796 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1799const std::string buffer_t::interface_name =
"wl_buffer";
1801buffer_t::operator wl_buffer*()
const
1803 return reinterpret_cast<wl_buffer*
> (c_ptr());
1808 return std::static_pointer_cast<events_t>(get_events())->destroy;
1814 send_event(post, 0);
1817int buffer_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
1819 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1823 if(events->destroy) events->destroy();
1829data_offer_t::data_offer_t(
const client_t& client, uint32_t
id,
int version)
1830 : resource_t(client, &server::detail::data_offer_interface, id, version)
1832 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1835data_offer_t::data_offer_t(
const resource_t &resource)
1836 : resource_t(resource)
1838 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1841const std::string data_offer_t::interface_name =
"wl_data_offer";
1843data_offer_t::operator wl_data_offer*()
const
1845 return reinterpret_cast<wl_data_offer*
> (c_ptr());
1850 return std::static_pointer_cast<events_t>(get_events())->accept;
1856 return std::static_pointer_cast<events_t>(get_events())->receive;
1862 return std::static_pointer_cast<events_t>(get_events())->destroy;
1868 return std::static_pointer_cast<events_t>(get_events())->finish;
1874 return std::static_pointer_cast<events_t>(get_events())->set_actions;
1880 send_event(post, 0, mime_type);
1895 send_event(post, 2,
static_cast<uint32_t
>(dnd_action));
1905 post_error(
static_cast<uint32_t
>(data_offer_error::invalid_finish), msg);
1910 post_error(
static_cast<uint32_t
>(data_offer_error::invalid_action_mask), msg);
1915 post_error(
static_cast<uint32_t
>(data_offer_error::invalid_action), msg);
1920 post_error(
static_cast<uint32_t
>(data_offer_error::invalid_offer), msg);
1923int data_offer_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
1925 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
1929 if(events->accept) events->accept(args[0].get<uint32_t>(), args[1].get<std::string>());
1932 if(events->receive) events->receive(args[0].get<std::string>(), args[1].get<int>());
1935 if(events->destroy) events->destroy();
1938 if(events->finish) events->finish();
1948data_source_t::data_source_t(
const client_t& client, uint32_t
id,
int version)
1949 : resource_t(client, &server::detail::data_source_interface, id, version)
1951 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1954data_source_t::data_source_t(
const resource_t &resource)
1955 : resource_t(resource)
1957 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
1960const std::string data_source_t::interface_name =
"wl_data_source";
1962data_source_t::operator wl_data_source*()
const
1964 return reinterpret_cast<wl_data_source*
> (c_ptr());
1969 return std::static_pointer_cast<events_t>(get_events())->offer;
1975 return std::static_pointer_cast<events_t>(get_events())->destroy;
1981 return std::static_pointer_cast<events_t>(get_events())->set_actions;
1987 send_event(post, 0, mime_type);
1992 send_event(post, 1, mime_type, argument_t::fd(fd));
1997 send_event(post, 2);
2002 send_event(post, 3);
2012 send_event(post, 4);
2022 send_event(post, 5,
static_cast<uint32_t
>(dnd_action));
2032 post_error(
static_cast<uint32_t
>(data_source_error::invalid_action_mask), msg);
2037 post_error(
static_cast<uint32_t
>(data_source_error::invalid_source), msg);
2040int data_source_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2042 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2046 if(events->offer) events->offer(args[0].get<std::string>());
2049 if(events->destroy) events->destroy();
2059data_device_t::data_device_t(
const client_t& client, uint32_t
id,
int version)
2060 : resource_t(client, &server::detail::data_device_interface, id, version)
2062 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2065data_device_t::data_device_t(
const resource_t &resource)
2066 : resource_t(resource)
2068 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2071const std::string data_device_t::interface_name =
"wl_data_device";
2073data_device_t::operator wl_data_device*()
const
2075 return reinterpret_cast<wl_data_device*
> (c_ptr());
2080 return std::static_pointer_cast<events_t>(get_events())->start_drag;
2086 return std::static_pointer_cast<events_t>(get_events())->set_selection;
2092 return std::static_pointer_cast<events_t>(get_events())->release;
2098 send_event(post, 0,
nullptr);
2103 send_event(post, 1, serial, surface.proxy_has_object() ?
reinterpret_cast<wl_object*
>(surface.c_ptr()) :
nullptr, x, y,
id.proxy_has_object() ?
reinterpret_cast<wl_object*
>(
id.c_ptr()) :
nullptr);
2108 send_event(post, 2);
2113 send_event(post, 3, time, x, y);
2118 send_event(post, 4);
2123 send_event(post, 5,
id.proxy_has_object() ?
reinterpret_cast<wl_object*
>(
id.c_ptr()) :
nullptr);
2128 post_error(
static_cast<uint32_t
>(data_device_error::role), msg);
2131int data_device_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2133 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2137 if(events->start_drag) events->start_drag(
data_source_t(args[0].get<resource_t>()),
surface_t(args[1].get<resource_t>()),
surface_t(args[2].get<resource_t>()), args[3].get<uint32_t>());
2140 if(events->set_selection) events->set_selection(
data_source_t(args[0].get<resource_t>()), args[1].get<uint32_t>());
2143 if(events->release) events->release();
2150data_device_manager_t::data_device_manager_t(
const client_t& client, uint32_t
id,
int version)
2151 : resource_t(client, &server::detail::data_device_manager_interface, id, version)
2153 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2156data_device_manager_t::data_device_manager_t(
const resource_t &resource)
2157 : resource_t(resource)
2159 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2162const std::string data_device_manager_t::interface_name =
"wl_data_device_manager";
2164data_device_manager_t::operator wl_data_device_manager*()
const
2166 return reinterpret_cast<wl_data_device_manager*
> (c_ptr());
2171 return std::static_pointer_cast<events_t>(get_events())->create_data_source;
2177 return std::static_pointer_cast<events_t>(get_events())->get_data_device;
2181int data_device_manager_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2183 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2187 if(events->create_data_source) events->create_data_source(
data_source_t(args[0].get<resource_t>()));
2190 if(events->get_data_device) events->get_data_device(
data_device_t(args[0].get<resource_t>()),
seat_t(args[1].get<resource_t>()));
2201shell_t::shell_t(
const client_t& client, uint32_t
id,
int version)
2202 : resource_t(client, &server::detail::shell_interface, id, version)
2204 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2207shell_t::shell_t(
const resource_t &resource)
2208 : resource_t(resource)
2210 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2213const std::string shell_t::interface_name =
"wl_shell";
2215shell_t::operator wl_shell*()
const
2217 return reinterpret_cast<wl_shell*
> (c_ptr());
2222 return std::static_pointer_cast<events_t>(get_events())->get_shell_surface;
2228 post_error(
static_cast<uint32_t
>(shell_error::role), msg);
2231int shell_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2233 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2237 if(events->get_shell_surface) events->get_shell_surface(
shell_surface_t(args[0].get<resource_t>()),
surface_t(args[1].get<resource_t>()));
2244shell_surface_t::shell_surface_t(
const client_t& client, uint32_t
id,
int version)
2245 : resource_t(client, &server::detail::shell_surface_interface, id, version)
2247 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2250shell_surface_t::shell_surface_t(
const resource_t &resource)
2251 : resource_t(resource)
2253 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2256const std::string shell_surface_t::interface_name =
"wl_shell_surface";
2258shell_surface_t::operator wl_shell_surface*()
const
2260 return reinterpret_cast<wl_shell_surface*
> (c_ptr());
2265 return std::static_pointer_cast<events_t>(get_events())->pong;
2271 return std::static_pointer_cast<events_t>(get_events())->move;
2277 return std::static_pointer_cast<events_t>(get_events())->resize;
2283 return std::static_pointer_cast<events_t>(get_events())->set_toplevel;
2289 return std::static_pointer_cast<events_t>(get_events())->set_transient;
2295 return std::static_pointer_cast<events_t>(get_events())->set_fullscreen;
2301 return std::static_pointer_cast<events_t>(get_events())->set_popup;
2307 return std::static_pointer_cast<events_t>(get_events())->set_maximized;
2313 return std::static_pointer_cast<events_t>(get_events())->set_title;
2319 return std::static_pointer_cast<events_t>(get_events())->set_class;
2325 send_event(post, 0, serial);
2330 send_event(post, 1,
static_cast<uint32_t
>(edges), width, height);
2335 send_event(post, 2);
2338int shell_surface_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2340 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2344 if(events->pong) events->pong(args[0].get<uint32_t>());
2347 if(events->move) events->move(
seat_t(args[0].get<resource_t>()), args[1].get<uint32_t>());
2350 if(events->resize) events->resize(
seat_t(args[0].get<resource_t>()), args[1].get<uint32_t>(),
shell_surface_resize(args[2].get<uint32_t>()));
2353 if(events->set_toplevel) events->set_toplevel();
2356 if(events->set_transient) events->set_transient(
surface_t(args[0].get<resource_t>()), args[1].get<int32_t>(), args[2].get<int32_t>(),
shell_surface_transient(args[3].get<uint32_t>()));
2359 if(events->set_fullscreen) events->set_fullscreen(shell_surface_fullscreen_method(args[0].get<uint32_t>()), args[1].get<uint32_t>(),
output_t(args[2].get<resource_t>()));
2362 if(events->set_popup) events->set_popup(
seat_t(args[0].get<resource_t>()), args[1].get<uint32_t>(),
surface_t(args[2].get<resource_t>()), args[3].get<int32_t>(), args[4].get<int32_t>(),
shell_surface_transient(args[5].get<uint32_t>()));
2365 if(events->set_maximized) events->set_maximized(
output_t(args[0].get<resource_t>()));
2368 if(events->set_title) events->set_title(args[0].get<std::string>());
2371 if(events->set_class) events->set_class(args[0].get<std::string>());
2390surface_t::surface_t(
const client_t& client, uint32_t
id,
int version)
2391 : resource_t(client, &server::detail::surface_interface, id, version)
2393 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2396surface_t::surface_t(
const resource_t &resource)
2397 : resource_t(resource)
2399 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2402const std::string surface_t::interface_name =
"wl_surface";
2404surface_t::operator wl_surface*()
const
2406 return reinterpret_cast<wl_surface*
> (c_ptr());
2411 return std::static_pointer_cast<events_t>(get_events())->destroy;
2417 return std::static_pointer_cast<events_t>(get_events())->attach;
2423 return std::static_pointer_cast<events_t>(get_events())->damage;
2429 return std::static_pointer_cast<events_t>(get_events())->frame;
2435 return std::static_pointer_cast<events_t>(get_events())->set_opaque_region;
2441 return std::static_pointer_cast<events_t>(get_events())->set_input_region;
2447 return std::static_pointer_cast<events_t>(get_events())->commit;
2453 return std::static_pointer_cast<events_t>(get_events())->set_buffer_transform;
2459 return std::static_pointer_cast<events_t>(get_events())->set_buffer_scale;
2465 return std::static_pointer_cast<events_t>(get_events())->damage_buffer;
2471 return std::static_pointer_cast<events_t>(get_events())->offset;
2477 send_event(post, 0, output.proxy_has_object() ?
reinterpret_cast<wl_object*
>(output.c_ptr()) :
nullptr);
2482 send_event(post, 1, output.proxy_has_object() ?
reinterpret_cast<wl_object*
>(output.c_ptr()) :
nullptr);
2487 post_error(
static_cast<uint32_t
>(surface_error::invalid_scale), msg);
2492 post_error(
static_cast<uint32_t
>(surface_error::invalid_transform), msg);
2497 post_error(
static_cast<uint32_t
>(surface_error::invalid_size), msg);
2502 post_error(
static_cast<uint32_t
>(surface_error::invalid_offset), msg);
2505int surface_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2507 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2511 if(events->destroy) events->destroy();
2514 if(events->attach) events->attach(
buffer_t(args[0].get<resource_t>()), args[1].get<int32_t>(), args[2].get<int32_t>());
2517 if(events->damage) events->damage(args[0].get<int32_t>(), args[1].get<int32_t>(), args[2].get<int32_t>(), args[3].get<int32_t>());
2520 if(events->frame) events->frame(
callback_t(args[0].get<resource_t>()));
2523 if(events->set_opaque_region) events->set_opaque_region(
region_t(args[0].get<resource_t>()));
2526 if(events->set_input_region) events->set_input_region(
region_t(args[0].get<resource_t>()));
2529 if(events->commit) events->commit();
2532 if(events->set_buffer_transform) events->set_buffer_transform(
output_transform(args[0].get<int32_t>()));
2535 if(events->set_buffer_scale) events->set_buffer_scale(args[0].get<int32_t>());
2538 if(events->damage_buffer) events->damage_buffer(args[0].get<int32_t>(), args[1].get<int32_t>(), args[2].get<int32_t>(), args[3].get<int32_t>());
2541 if(events->offset) events->offset(args[0].get<int32_t>(), args[1].get<int32_t>());
2548seat_t::seat_t(
const client_t& client, uint32_t
id,
int version)
2549 : resource_t(client, &server::detail::seat_interface, id, version)
2551 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2554seat_t::seat_t(
const resource_t &resource)
2555 : resource_t(resource)
2557 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2560const std::string seat_t::interface_name =
"wl_seat";
2562seat_t::operator wl_seat*()
const
2564 return reinterpret_cast<wl_seat*
> (c_ptr());
2569 return std::static_pointer_cast<events_t>(get_events())->get_pointer;
2575 return std::static_pointer_cast<events_t>(get_events())->get_keyboard;
2581 return std::static_pointer_cast<events_t>(get_events())->get_touch;
2587 return std::static_pointer_cast<events_t>(get_events())->release;
2593 send_event(post, 0,
static_cast<uint32_t
>(
capabilities));
2598 send_event(post, 1, name);
2608 post_error(
static_cast<uint32_t
>(seat_error::missing_capability), msg);
2611int seat_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2613 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2617 if(events->get_pointer) events->get_pointer(
pointer_t(args[0].get<resource_t>()));
2620 if(events->get_keyboard) events->get_keyboard(
keyboard_t(args[0].get<resource_t>()));
2623 if(events->get_touch) events->get_touch(
touch_t(args[0].get<resource_t>()));
2626 if(events->release) events->release();
2637pointer_t::pointer_t(
const client_t& client, uint32_t
id,
int version)
2638 : resource_t(client, &server::detail::pointer_interface, id, version)
2640 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2643pointer_t::pointer_t(
const resource_t &resource)
2644 : resource_t(resource)
2646 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2649const std::string pointer_t::interface_name =
"wl_pointer";
2651pointer_t::operator wl_pointer*()
const
2653 return reinterpret_cast<wl_pointer*
> (c_ptr());
2658 return std::static_pointer_cast<events_t>(get_events())->set_cursor;
2664 return std::static_pointer_cast<events_t>(get_events())->release;
2670 send_event(post, 0, serial, surface.proxy_has_object() ?
reinterpret_cast<wl_object*
>(surface.c_ptr()) :
nullptr, surface_x, surface_y);
2675 send_event(post, 1, serial, surface.proxy_has_object() ?
reinterpret_cast<wl_object*
>(surface.c_ptr()) :
nullptr);
2680 send_event(post, 2, time, surface_x, surface_y);
2683void pointer_t::button(uint32_t serial, uint32_t time, uint32_t button, pointer_button_state
const& state,
bool post)
2685 send_event(post, 3, serial, time,
button,
static_cast<uint32_t
>(state));
2690 send_event(post, 4, time,
static_cast<uint32_t
>(
axis), value);
2695 send_event(post, 5);
2705 send_event(post, 6,
static_cast<uint32_t
>(
axis_source));
2715 send_event(post, 7, time,
static_cast<uint32_t
>(
axis));
2725 send_event(post, 8,
static_cast<uint32_t
>(
axis), discrete);
2735 send_event(post, 9,
static_cast<uint32_t
>(
axis), value120);
2745 post_error(
static_cast<uint32_t
>(pointer_error::role), msg);
2748int pointer_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2750 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2754 if(events->set_cursor) events->set_cursor(args[0].get<uint32_t>(),
surface_t(args[1].get<resource_t>()), args[2].get<int32_t>(), args[3].get<int32_t>());
2757 if(events->release) events->release();
2767keyboard_t::keyboard_t(
const client_t& client, uint32_t
id,
int version)
2768 : resource_t(client, &server::detail::keyboard_interface, id, version)
2770 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2773keyboard_t::keyboard_t(
const resource_t &resource)
2774 : resource_t(resource)
2776 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2779const std::string keyboard_t::interface_name =
"wl_keyboard";
2781keyboard_t::operator wl_keyboard*()
const
2783 return reinterpret_cast<wl_keyboard*
> (c_ptr());
2788 return std::static_pointer_cast<events_t>(get_events())->release;
2794 send_event(post, 0,
static_cast<uint32_t
>(format), argument_t::fd(fd), size);
2799 send_event(post, 1, serial, surface.proxy_has_object() ?
reinterpret_cast<wl_object*
>(surface.c_ptr()) :
nullptr, keys);
2804 send_event(post, 2, serial, surface.proxy_has_object() ?
reinterpret_cast<wl_object*
>(surface.c_ptr()) :
nullptr);
2807void keyboard_t::key(uint32_t serial, uint32_t time, uint32_t key, keyboard_key_state
const& state,
bool post)
2809 send_event(post, 3, serial, time,
key,
static_cast<uint32_t
>(state));
2812void keyboard_t::modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group,
bool post)
2814 send_event(post, 4, serial, mods_depressed, mods_latched, mods_locked, group);
2819 send_event(post, 5, rate, delay);
2827int keyboard_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2829 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2833 if(events->release) events->release();
2841touch_t::touch_t(
const client_t& client, uint32_t
id,
int version)
2842 : resource_t(client, &server::detail::touch_interface, id, version)
2844 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2847touch_t::touch_t(
const resource_t &resource)
2848 : resource_t(resource)
2850 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2853const std::string touch_t::interface_name =
"wl_touch";
2855touch_t::operator wl_touch*()
const
2857 return reinterpret_cast<wl_touch*
> (c_ptr());
2862 return std::static_pointer_cast<events_t>(get_events())->release;
2868 send_event(post, 0, serial, time, surface.proxy_has_object() ?
reinterpret_cast<wl_object*
>(surface.c_ptr()) :
nullptr, id, x, y);
2871void touch_t::up(uint32_t serial, uint32_t time, int32_t
id,
bool post)
2873 send_event(post, 1, serial, time,
id);
2878 send_event(post, 2, time,
id, x, y);
2883 send_event(post, 3);
2888 send_event(post, 4);
2893 send_event(post, 5,
id, major, minor);
2911int touch_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
2913 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
2917 if(events->release) events->release();
2923output_t::output_t(
const client_t& client, uint32_t
id,
int version)
2924 : resource_t(client, &server::detail::output_interface, id, version)
2926 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2929output_t::output_t(
const resource_t &resource)
2930 : resource_t(resource)
2932 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
2935const std::string output_t::interface_name =
"wl_output";
2937output_t::operator wl_output*()
const
2939 return reinterpret_cast<wl_output*
> (c_ptr());
2944 return std::static_pointer_cast<events_t>(get_events())->release;
2948void output_t::geometry(int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, output_subpixel
const& subpixel, std::string
const& make, std::string
const& model,
output_transform const& transform,
bool post)
2950 send_event(post, 0, x, y, physical_width, physical_height,
static_cast<int32_t
>(subpixel), make, model,
static_cast<int32_t
>(transform));
2955 send_event(post, 1,
static_cast<uint32_t
>(flags), width, height, refresh);
2960 send_event(post, 2);
2970 send_event(post, 3, factor);
2980 send_event(post, 4, name);
2998int output_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
3000 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
3004 if(events->release) events->release();
3023region_t::region_t(
const client_t& client, uint32_t
id,
int version)
3024 : resource_t(client, &server::detail::region_interface, id, version)
3026 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
3029region_t::region_t(
const resource_t &resource)
3030 : resource_t(resource)
3032 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
3035const std::string region_t::interface_name =
"wl_region";
3037region_t::operator wl_region*()
const
3039 return reinterpret_cast<wl_region*
> (c_ptr());
3044 return std::static_pointer_cast<events_t>(get_events())->destroy;
3050 return std::static_pointer_cast<events_t>(get_events())->add;
3056 return std::static_pointer_cast<events_t>(get_events())->subtract;
3060int region_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
3062 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
3066 if(events->destroy) events->destroy();
3069 if(events->add) events->add(args[0].get<int32_t>(), args[1].get<int32_t>(), args[2].get<int32_t>(), args[3].get<int32_t>());
3072 if(events->subtract) events->subtract(args[0].get<int32_t>(), args[1].get<int32_t>(), args[2].get<int32_t>(), args[3].get<int32_t>());
3078subcompositor_t::subcompositor_t(
const client_t& client, uint32_t
id,
int version)
3079 : resource_t(client, &server::detail::subcompositor_interface, id, version)
3081 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
3084subcompositor_t::subcompositor_t(
const resource_t &resource)
3085 : resource_t(resource)
3087 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
3090const std::string subcompositor_t::interface_name =
"wl_subcompositor";
3092subcompositor_t::operator wl_subcompositor*()
const
3094 return reinterpret_cast<wl_subcompositor*
> (c_ptr());
3099 return std::static_pointer_cast<events_t>(get_events())->destroy;
3105 return std::static_pointer_cast<events_t>(get_events())->get_subsurface;
3111 post_error(
static_cast<uint32_t
>(subcompositor_error::bad_surface), msg);
3114int subcompositor_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
3116 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
3120 if(events->destroy) events->destroy();
3123 if(events->get_subsurface) events->get_subsurface(
subsurface_t(args[0].get<resource_t>()),
surface_t(args[1].get<resource_t>()),
surface_t(args[2].get<resource_t>()));
3130subsurface_t::subsurface_t(
const client_t& client, uint32_t
id,
int version)
3131 : resource_t(client, &server::detail::subsurface_interface, id, version)
3133 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
3136subsurface_t::subsurface_t(
const resource_t &resource)
3137 : resource_t(resource)
3139 set_events(std::shared_ptr<resource_t::events_base_t>(
new events_t), dispatcher);
3142const std::string subsurface_t::interface_name =
"wl_subsurface";
3144subsurface_t::operator wl_subsurface*()
const
3146 return reinterpret_cast<wl_subsurface*
> (c_ptr());
3151 return std::static_pointer_cast<events_t>(get_events())->destroy;
3157 return std::static_pointer_cast<events_t>(get_events())->set_position;
3163 return std::static_pointer_cast<events_t>(get_events())->place_above;
3169 return std::static_pointer_cast<events_t>(get_events())->place_below;
3175 return std::static_pointer_cast<events_t>(get_events())->set_sync;
3181 return std::static_pointer_cast<events_t>(get_events())->set_desync;
3187 post_error(
static_cast<uint32_t
>(subsurface_error::bad_surface), msg);
3190int subsurface_t::dispatcher(
int opcode,
const std::vector<any>& args,
const std::shared_ptr<resource_t::events_base_t>& e)
3192 std::shared_ptr<events_t> events = std::static_pointer_cast<events_t>(e);
3196 if(events->destroy) events->destroy();
3199 if(events->set_position) events->set_position(args[0].get<int32_t>(), args[1].get<int32_t>());
3202 if(events->place_above) events->place_above(
surface_t(args[0].get<resource_t>()));
3205 if(events->place_below) events->place_below(
surface_t(args[0].get<resource_t>()));
3208 if(events->set_sync) events->set_sync();
3211 if(events->set_desync) events->set_desync();
void release(bool post=true)
compositor releases buffer
std::function< void()> & on_destroy()
destroy a buffer
void done(uint32_t callback_data, bool post=true)
done event
std::function< void(surface_t)> & on_create_surface()
create new surface
std::function< void(region_t)> & on_create_region()
create new region
std::function< void(data_device_t, seat_t)> & on_get_data_device()
create a new data device
std::function< void(data_source_t)> & on_create_data_source()
create a new data source
void post_role(std::string const &msg)
Post error: given wl_surface has another role.
std::function< void(data_source_t, uint32_t)> & on_set_selection()
copy data to the selection
std::function< void()> & on_release()
destroy data device
void enter(uint32_t serial, surface_t const &surface, double x, double y, data_offer_t const &id, bool post=true)
initiate drag-and-drop session
void leave(bool post=true)
end drag-and-drop session
void data_offer(bool post=true)
introduce a new wl_data_offer
void motion(uint32_t time, double x, double y, bool post=true)
drag-and-drop session motion
std::function< void(data_source_t, surface_t, surface_t, uint32_t)> & on_start_drag()
start drag-and-drop operation
void drop(bool post=true)
end drag-and-drop session successfully
void selection(data_offer_t const &id, bool post=true)
advertise new selection
void offer(std::string const &mime_type, bool post=true)
advertise offered mime type
std::function< void()> & on_destroy()
destroy data offer
std::function< void(std::string, int)> & on_receive()
request that the data is transferred
std::function< void(data_device_manager_dnd_action, data_device_manager_dnd_action)> & on_set_actions()
set the available/preferred drag-and-drop actions
void source_actions(data_device_manager_dnd_action const &source_actions, bool post=true)
notify the source-side available actions
std::function< void(uint32_t, std::string)> & on_accept()
accept one of the offered mime types
void post_invalid_finish(std::string const &msg)
Post error: finish request was called untimely.
bool can_source_actions() const
Check whether the source_actions function is available with the currently bound version of the protoc...
bool can_action() const
Check whether the action function is available with the currently bound version of the protocol.
std::function< void()> & on_finish()
the offer will no longer be used
static constexpr std::uint32_t source_actions_since_version
Minimum protocol version required for the source_actions function.
void post_invalid_action(std::string const &msg)
Post error: action argument has an invalid value.
static constexpr std::uint32_t action_since_version
Minimum protocol version required for the action function.
void post_invalid_offer(std::string const &msg)
Post error: offer doesn't accept this request.
void post_invalid_action_mask(std::string const &msg)
Post error: action mask contains invalid values.
void action(data_device_manager_dnd_action const &dnd_action, bool post=true)
notify the selected action
void cancelled(bool post=true)
selection was cancelled
static constexpr std::uint32_t dnd_drop_performed_since_version
Minimum protocol version required for the dnd_drop_performed function.
void dnd_drop_performed(bool post=true)
the drag-and-drop operation physically finished
void post_invalid_action_mask(std::string const &msg)
Post error: action mask contains invalid values.
static constexpr std::uint32_t dnd_finished_since_version
Minimum protocol version required for the dnd_finished function.
bool can_dnd_drop_performed() const
Check whether the dnd_drop_performed function is available with the currently bound version of the pr...
bool can_action() const
Check whether the action function is available with the currently bound version of the protocol.
std::function< void(data_device_manager_dnd_action)> & on_set_actions()
set the available drag-and-drop actions
std::function< void(std::string)> & on_offer()
add an offered mime type
std::function< void()> & on_destroy()
destroy the data source
static constexpr std::uint32_t action_since_version
Minimum protocol version required for the action function.
void send(std::string const &mime_type, int fd, bool post=true)
send the data
bool can_dnd_finished() const
Check whether the dnd_finished function is available with the currently bound version of the protocol...
void action(data_device_manager_dnd_action const &dnd_action, bool post=true)
notify the selected action
void target(std::string const &mime_type, bool post=true)
a target accepts an offered mime type
void dnd_finished(bool post=true)
the drag-and-drop operation concluded
void post_invalid_source(std::string const &msg)
Post error: source doesn't accept this request.
void enter(uint32_t serial, surface_t const &surface, array_t const &keys, bool post=true)
enter event
void modifiers(uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group, bool post=true)
modifier and group state
void keymap(keyboard_keymap_format const &format, int fd, uint32_t size, bool post=true)
keyboard mapping
void repeat_info(int32_t rate, int32_t delay, bool post=true)
repeat rate and delay
void leave(uint32_t serial, surface_t const &surface, bool post=true)
leave event
void key(uint32_t serial, uint32_t time, uint32_t key, keyboard_key_state const &state, bool post=true)
key event
static constexpr std::uint32_t repeat_info_since_version
Minimum protocol version required for the repeat_info function.
std::function< void()> & on_release()
release the keyboard object
bool can_repeat_info() const
Check whether the repeat_info function is available with the currently bound version of the protocol.
static constexpr std::uint32_t done_since_version
Minimum protocol version required for the done function.
std::function< void()> & on_release()
release the output object
bool can_name() const
Check whether the name function is available with the currently bound version of the protocol.
void name(std::string const &name, bool post=true)
name of this output
void mode(output_mode const &flags, int32_t width, int32_t height, int32_t refresh, bool post=true)
advertise available modes for the output
void done(bool post=true)
sent all information about output
void geometry(int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, output_subpixel const &subpixel, std::string const &make, std::string const &model, output_transform const &transform, bool post=true)
properties of the output
static constexpr std::uint32_t name_since_version
Minimum protocol version required for the name function.
void scale(int32_t factor, bool post=true)
output scaling properties
bool can_scale() const
Check whether the scale function is available with the currently bound version of the protocol.
bool can_done() const
Check whether the done function is available with the currently bound version of the protocol.
void description(std::string const &description, bool post=true)
human-readable description of this output
bool can_description() const
Check whether the description function is available with the currently bound version of the protocol.
static constexpr std::uint32_t scale_since_version
Minimum protocol version required for the scale function.
static constexpr std::uint32_t description_since_version
Minimum protocol version required for the description function.
void motion(uint32_t time, double surface_x, double surface_y, bool post=true)
pointer motion event
void axis(uint32_t time, pointer_axis const &axis, double value, bool post=true)
axis event
void axis_stop(uint32_t time, pointer_axis const &axis, bool post=true)
axis stop event
std::function< void(uint32_t, surface_t, int32_t, int32_t)> & on_set_cursor()
set the pointer surface
void frame(bool post=true)
end of a pointer event sequence
static constexpr std::uint32_t axis_source_since_version
Minimum protocol version required for the axis_source function.
void post_role(std::string const &msg)
Post error: given wl_surface has another role.
void leave(uint32_t serial, surface_t const &surface, bool post=true)
leave event
bool can_axis_discrete() const
Check whether the axis_discrete function is available with the currently bound version of the protoco...
static constexpr std::uint32_t frame_since_version
Minimum protocol version required for the frame function.
bool can_axis_source() const
Check whether the axis_source function is available with the currently bound version of the protocol.
void axis_discrete(pointer_axis const &axis, int32_t discrete, bool post=true)
axis click event
static constexpr std::uint32_t axis_discrete_since_version
Minimum protocol version required for the axis_discrete function.
std::function< void()> & on_release()
release the pointer object
void axis_value120(pointer_axis const &axis, int32_t value120, bool post=true)
axis high-resolution scroll event
void button(uint32_t serial, uint32_t time, uint32_t button, pointer_button_state const &state, bool post=true)
pointer button event
void axis_source(pointer_axis_source const &axis_source, bool post=true)
axis source event
bool can_axis_value120() const
Check whether the axis_value120 function is available with the currently bound version of the protoco...
void enter(uint32_t serial, surface_t const &surface, double surface_x, double surface_y, bool post=true)
enter event
bool can_axis_stop() const
Check whether the axis_stop function is available with the currently bound version of the protocol.
bool can_frame() const
Check whether the frame function is available with the currently bound version of the protocol.
static constexpr std::uint32_t axis_stop_since_version
Minimum protocol version required for the axis_stop function.
static constexpr std::uint32_t axis_value120_since_version
Minimum protocol version required for the axis_value120 function.
std::function< void()> & on_destroy()
destroy region
std::function< void(int32_t, int32_t, int32_t, int32_t)> & on_add()
add rectangle to region
std::function< void(int32_t, int32_t, int32_t, int32_t)> & on_subtract()
subtract rectangle from region
void global(uint32_t name, std::string const &interface, uint32_t version, bool post=true)
announce global object
std::function< void(uint32_t, resource_t)> & on_bind()
bind an object to the display
void global_remove(uint32_t name, bool post=true)
announce removal of global object
void name(std::string const &name, bool post=true)
unique identifier for this seat
std::function< void(pointer_t)> & on_get_pointer()
return pointer object
void post_missing_capability(std::string const &msg)
Post error: get_pointer, get_keyboard or get_touch called on seat without the matching capability.
std::function< void(keyboard_t)> & on_get_keyboard()
return keyboard object
std::function< void(touch_t)> & on_get_touch()
return touch object
std::function< void()> & on_release()
release the seat object
void capabilities(seat_capability const &capabilities, bool post=true)
seat capabilities changed
bool can_name() const
Check whether the name function is available with the currently bound version of the protocol.
static constexpr std::uint32_t name_since_version
Minimum protocol version required for the name function.
desktop-style metadata interface
std::function< void(seat_t, uint32_t)> & on_move()
start an interactive move
std::function< void(std::string)> & on_set_class()
set surface class
std::function< void(seat_t, uint32_t, shell_surface_resize)> & on_resize()
start an interactive resize
std::function< void(std::string)> & on_set_title()
set surface title
std::function< void(surface_t, int32_t, int32_t, shell_surface_transient)> & on_set_transient()
make the surface a transient surface
std::function< void(output_t)> & on_set_maximized()
make the surface a maximized surface
void ping(uint32_t serial, bool post=true)
ping client
std::function< void(shell_surface_fullscreen_method, uint32_t, output_t)> & on_set_fullscreen()
make the surface a fullscreen surface
std::function< void()> & on_set_toplevel()
make the surface a toplevel surface
std::function< void(uint32_t)> & on_pong()
respond to a ping event
void popup_done(bool post=true)
popup interaction is done
void configure(shell_surface_resize const &edges, int32_t width, int32_t height, bool post=true)
suggest resize
std::function< void(seat_t, uint32_t, surface_t, int32_t, int32_t, shell_surface_transient)> & on_set_popup()
make the surface a popup surface
std::function< void(shell_surface_t, surface_t)> & on_get_shell_surface()
create a shell surface from a surface
void post_role(std::string const &msg)
Post error: given wl_surface has another role.
std::function< void()> & on_destroy()
destroy the pool
std::function< void(int32_t)> & on_resize()
change the size of the pool mapping
std::function< void(buffer_t, int32_t, int32_t, int32_t, int32_t, shm_format)> & on_create_buffer()
create a buffer from the pool
void post_invalid_format(std::string const &msg)
Post error: buffer format is not known.
std::function< void(shm_pool_t, int, int32_t)> & on_create_pool()
create a shm pool
void post_invalid_fd(std::string const &msg)
Post error: mmapping the file descriptor failed.
void format(shm_format const &format, bool post=true)
pixel format description
void post_invalid_stride(std::string const &msg)
Post error: invalid size or stride during pool or buffer creation.
std::function< void(subsurface_t, surface_t, surface_t)> & on_get_subsurface()
give a surface the role sub-surface
std::function< void()> & on_destroy()
unbind from the subcompositor interface
void post_bad_surface(std::string const &msg)
Post error: the to-be sub-surface is invalid.
sub-surface interface to a wl_surface
std::function< void()> & on_set_sync()
set sub-surface to synchronized mode
std::function< void()> & on_set_desync()
set sub-surface to desynchronized mode
std::function< void(int32_t, int32_t)> & on_set_position()
reposition the sub-surface
std::function< void(surface_t)> & on_place_below()
restack the sub-surface
std::function< void(surface_t)> & on_place_above()
restack the sub-surface
void post_bad_surface(std::string const &msg)
Post error: wl_surface is not a sibling or the parent.
std::function< void()> & on_destroy()
remove sub-surface interface
void enter(output_t const &output, bool post=true)
surface enters an output
std::function< void(buffer_t, int32_t, int32_t)> & on_attach()
set the surface contents
void post_invalid_offset(std::string const &msg)
Post error: buffer offset is invalid.
std::function< void(region_t)> & on_set_input_region()
set input region
void post_invalid_scale(std::string const &msg)
Post error: buffer scale value is invalid.
std::function< void(int32_t, int32_t, int32_t, int32_t)> & on_damage()
mark part of the surface damaged
std::function< void(callback_t)> & on_frame()
request a frame throttling hint
std::function< void(int32_t, int32_t)> & on_offset()
set the surface contents offset
std::function< void(int32_t)> & on_set_buffer_scale()
sets the buffer scaling factor
void post_invalid_size(std::string const &msg)
Post error: buffer size is invalid.
std::function< void(region_t)> & on_set_opaque_region()
set opaque region
std::function< void()> & on_commit()
commit pending surface state
std::function< void(int32_t, int32_t, int32_t, int32_t)> & on_damage_buffer()
mark part of the surface damaged using buffer coordinates
void leave(output_t const &output, bool post=true)
surface leaves an output
std::function< void()> & on_destroy()
delete surface
void post_invalid_transform(std::string const &msg)
Post error: buffer transform value is invalid.
std::function< void(output_transform)> & on_set_buffer_transform()
sets the buffer transformation
void cancel(bool post=true)
touch session cancelled
void motion(uint32_t time, int32_t id, double x, double y, bool post=true)
update of touch point coordinates
void orientation(int32_t id, double orientation, bool post=true)
update orientation of touch point
void up(uint32_t serial, uint32_t time, int32_t id, bool post=true)
end of a touch event sequence
void down(uint32_t serial, uint32_t time, surface_t const &surface, int32_t id, double x, double y, bool post=true)
touch down event and beginning of a touch sequence
void shape(int32_t id, double major, double minor, bool post=true)
update shape of touch point
static constexpr std::uint32_t shape_since_version
Minimum protocol version required for the shape function.
bool can_shape() const
Check whether the shape function is available with the currently bound version of the protocol.
static constexpr std::uint32_t orientation_since_version
Minimum protocol version required for the orientation function.
void frame(bool post=true)
end of touch frame event
bool can_orientation() const
Check whether the orientation function is available with the currently bound version of the protocol.
std::function< void()> & on_release()
release the touch object
static const wayland::detail::bitfield< 3, 6 > copy
copy action
static const wayland::detail::bitfield< 3, 6 > move
move action
static const wayland::detail::bitfield< 3, 6 > ask
ask action
static const wayland::detail::bitfield< 3, 6 > none
no action
static const wayland::detail::bitfield< 2, 22 > current
indicates this is the current mode
static const wayland::detail::bitfield< 2, 22 > preferred
indicates this is the preferred mode
static const wayland::detail::bitfield< 3, 12 > keyboard
the seat has one or more keyboards
static const wayland::detail::bitfield< 3, 12 > touch
the seat has touch devices
static const wayland::detail::bitfield< 3, 12 > pointer
the seat has pointer devices
static const wayland::detail::bitfield< 4, 8 > bottom_left
bottom and left edges
static const wayland::detail::bitfield< 4, 8 > top_right
top and right edges
static const wayland::detail::bitfield< 4, 8 > bottom_right
bottom and right edges
static const wayland::detail::bitfield< 4, 8 > bottom
bottom edge
static const wayland::detail::bitfield< 4, 8 > right
right edge
static const wayland::detail::bitfield< 4, 8 > left
left edge
static const wayland::detail::bitfield< 4, 8 > none
no edge
static const wayland::detail::bitfield< 4, 8 > top
top edge
static const wayland::detail::bitfield< 4, 8 > top_left
top and left edges
details of transient behaviour
static const wayland::detail::bitfield< 1, 9 > inactive
do not set keyboard focus