Wayland++  1.0.0
C++ Bindings for Wayland
wayland-server-protocol-extra.hpp
1 #pragma once
2 
3 #include <array>
4 #include <functional>
5 #include <memory>
6 #include <string>
7 #include <vector>
8 
9 #include <wayland-server.hpp>
10 #include <wayland-server-protocol.hpp>
11 
12 struct wp_presentation;
13 struct wp_presentation_feedback;
14 struct wp_viewporter;
15 struct wp_viewport;
16 struct xdg_wm_base;
17 struct xdg_positioner;
18 struct xdg_surface;
19 struct xdg_toplevel;
20 struct xdg_popup;
21 
22 namespace wayland
23 {
24 namespace server
25 {
26 class presentation_t;
27 enum class presentation_error : uint32_t;
28 class presentation_feedback_t;
29 struct presentation_feedback_kind;
30 class viewporter_t;
31 enum class viewporter_error : uint32_t;
32 class viewport_t;
33 enum class viewport_error : uint32_t;
34 class xdg_wm_base_t;
35 enum class xdg_wm_base_error : uint32_t;
36 class xdg_positioner_t;
37 enum class xdg_positioner_error : uint32_t;
38 enum class xdg_positioner_anchor : uint32_t;
39 enum class xdg_positioner_gravity : uint32_t;
40 struct xdg_positioner_constraint_adjustment;
41 class xdg_surface_t;
42 enum class xdg_surface_error : uint32_t;
43 class xdg_toplevel_t;
44 enum class xdg_toplevel_error : uint32_t;
45 struct xdg_toplevel_resize_edge;
46 enum class xdg_toplevel_state : uint32_t;
47 class xdg_popup_t;
48 enum class xdg_popup_error : uint32_t;
49 
50 namespace detail
51 {
52  extern const wl_interface presentation_interface;
53  extern const wl_interface presentation_feedback_interface;
54  extern const wl_interface viewporter_interface;
55  extern const wl_interface viewport_interface;
56  extern const wl_interface xdg_wm_base_interface;
57  extern const wl_interface xdg_positioner_interface;
58  extern const wl_interface xdg_surface_interface;
59  extern const wl_interface xdg_toplevel_interface;
60  extern const wl_interface xdg_popup_interface;
61 }
62 
79 class presentation_t : public resource_t
80 {
81 private:
82  struct events_t : public resource_t::events_base_t
83  {
84  std::function<void()> destroy;
85  std::function<void(surface_t, presentation_feedback_t)> feedback;
86  };
87 
88  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
89 
90 protected:
91  static constexpr const wl_interface *interface = &wayland::server::detail::presentation_interface;
92  static constexpr const unsigned int max_version = 1;
93 
94  friend class global_t<presentation_t>;
95  friend class global_base_t;
96 
97 public:
98  presentation_t() = default;
99  presentation_t(const client_t& client, uint32_t id, int version = 1);
100  presentation_t(const resource_t &resource);
101 
102  static const std::string interface_name;
103 
104  operator wp_presentation*() const;
105 
113  std::function<void()> &on_destroy();
114 
129  std::function<void(surface_t, presentation_feedback_t)> &on_feedback();
130 
165  void clock_id(uint32_t clk_id, bool post = true);
166 
169  static constexpr std::uint32_t clock_id_since_version = 1;
170 
173  void post_invalid_timestamp(std::string const& msg);
174 
177  void post_invalid_flag(std::string const& msg);
178 
179 };
180 
182 
189 enum class presentation_error : uint32_t
190  {
192  invalid_timestamp = 0,
194  invalid_flag = 1
195 };
196 
197 
213 class presentation_feedback_t : public resource_t
214 {
215 private:
216  struct events_t : public resource_t::events_base_t
217  {
218  };
219 
220  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
221 
222 protected:
223  static constexpr const wl_interface *interface = &wayland::server::detail::presentation_feedback_interface;
224  static constexpr const unsigned int max_version = 1;
225 
226  friend class global_t<presentation_feedback_t>;
227  friend class global_base_t;
228 
229 public:
230  presentation_feedback_t() = default;
231  presentation_feedback_t(const client_t& client, uint32_t id, int version = 1);
232  presentation_feedback_t(const resource_t &resource);
233 
234  static const std::string interface_name;
235 
236  operator wp_presentation_feedback*() const;
237 
251  void sync_output(output_t const& output, bool post = true);
252 
255  static constexpr std::uint32_t sync_output_since_version = 1;
256 
309  void presented(uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec, uint32_t refresh, uint32_t seq_hi, uint32_t seq_lo, presentation_feedback_kind const& flags, bool post = true);
310 
313  static constexpr std::uint32_t presented_since_version = 1;
314 
320  void discarded(bool post = true);
321 
324  static constexpr std::uint32_t discarded_since_version = 1;
325 
326 };
327 
329 
338 struct presentation_feedback_kind : public wayland::detail::bitfield<4, 1>
339 {
340  presentation_feedback_kind(const wayland::detail::bitfield<4, 1> &b)
341  : wayland::detail::bitfield<4, 1>(b) {}
342  presentation_feedback_kind(const uint32_t value)
343  : wayland::detail::bitfield<4, 1>(value) {}
344  static const wayland::detail::bitfield<4, 1> vsync;
345  static const wayland::detail::bitfield<4, 1> hw_clock;
346  static const wayland::detail::bitfield<4, 1> hw_completion;
347  static const wayland::detail::bitfield<4, 1> zero_copy;
348 };
349 
350 
361 class viewporter_t : public resource_t
362 {
363 private:
364  struct events_t : public resource_t::events_base_t
365  {
366  std::function<void()> destroy;
367  std::function<void(viewport_t, surface_t)> get_viewport;
368  };
369 
370  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
371 
372 protected:
373  static constexpr const wl_interface *interface = &wayland::server::detail::viewporter_interface;
374  static constexpr const unsigned int max_version = 1;
375 
376  friend class global_t<viewporter_t>;
377  friend class global_base_t;
378 
379 public:
380  viewporter_t() = default;
381  viewporter_t(const client_t& client, uint32_t id, int version = 1);
382  viewporter_t(const resource_t &resource);
383 
384  static const std::string interface_name;
385 
386  operator wp_viewporter*() const;
387 
395  std::function<void()> &on_destroy();
396 
407  std::function<void(viewport_t, surface_t)> &on_get_viewport();
408 
411  void post_viewport_exists(std::string const& msg);
412 
413 };
414 
416 
420 enum class viewporter_error : uint32_t
421  {
423  viewport_exists = 0
424 };
425 
426 
492 class viewport_t : public resource_t
493 {
494 private:
495  struct events_t : public resource_t::events_base_t
496  {
497  std::function<void()> destroy;
498  std::function<void(double, double, double, double)> set_source;
499  std::function<void(int32_t, int32_t)> set_destination;
500  };
501 
502  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
503 
504 protected:
505  static constexpr const wl_interface *interface = &wayland::server::detail::viewport_interface;
506  static constexpr const unsigned int max_version = 1;
507 
508  friend class global_t<viewport_t>;
509  friend class global_base_t;
510 
511 public:
512  viewport_t() = default;
513  viewport_t(const client_t& client, uint32_t id, int version = 1);
514  viewport_t(const resource_t &resource);
515 
516  static const std::string interface_name;
517 
518  operator wp_viewport*() const;
519 
526  std::function<void()> &on_destroy();
527 
547  std::function<void(double, double, double, double)> &on_set_source();
548 
566  std::function<void(int32_t, int32_t)> &on_set_destination();
567 
570  void post_bad_value(std::string const& msg);
571 
574  void post_bad_size(std::string const& msg);
575 
578  void post_out_of_buffer(std::string const& msg);
579 
582  void post_no_surface(std::string const& msg);
583 
584 };
585 
587 
591 enum class viewport_error : uint32_t
592  {
594  bad_value = 0,
596  bad_size = 1,
598  out_of_buffer = 2,
600  no_surface = 3
601 };
602 
603 
613 class xdg_wm_base_t : public resource_t
614 {
615 private:
616  struct events_t : public resource_t::events_base_t
617  {
618  std::function<void()> destroy;
619  std::function<void(xdg_positioner_t)> create_positioner;
620  std::function<void(xdg_surface_t, surface_t)> get_xdg_surface;
621  std::function<void(uint32_t)> pong;
622  };
623 
624  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
625 
626 protected:
627  static constexpr const wl_interface *interface = &wayland::server::detail::xdg_wm_base_interface;
628  static constexpr const unsigned int max_version = 4;
629 
630  friend class global_t<xdg_wm_base_t>;
631  friend class global_base_t;
632 
633 public:
634  xdg_wm_base_t() = default;
635  xdg_wm_base_t(const client_t& client, uint32_t id, int version = 4);
636  xdg_wm_base_t(const resource_t &resource);
637 
638  static const std::string interface_name;
639 
640  operator xdg_wm_base*() const;
641 
651  std::function<void()> &on_destroy();
652 
661  std::function<void(xdg_positioner_t)> &on_create_positioner();
662 
682  std::function<void(xdg_surface_t, surface_t)> &on_get_xdg_surface();
683 
691  std::function<void(uint32_t)> &on_pong();
692 
709  void ping(uint32_t serial, bool post = true);
710 
713  static constexpr std::uint32_t ping_since_version = 1;
714 
717  void post_role(std::string const& msg);
718 
721  void post_defunct_surfaces(std::string const& msg);
722 
725  void post_not_the_topmost_popup(std::string const& msg);
726 
729  void post_invalid_popup_parent(std::string const& msg);
730 
733  void post_invalid_surface_state(std::string const& msg);
734 
737  void post_invalid_positioner(std::string const& msg);
738 
739 };
740 
742 
746 enum class xdg_wm_base_error : uint32_t
747  {
749  role = 0,
751  defunct_surfaces = 1,
753  not_the_topmost_popup = 2,
755  invalid_popup_parent = 3,
757  invalid_surface_state = 4,
759  invalid_positioner = 5
760 };
761 
762 
786 class xdg_positioner_t : public resource_t
787 {
788 private:
789  struct events_t : public resource_t::events_base_t
790  {
791  std::function<void()> destroy;
792  std::function<void(int32_t, int32_t)> set_size;
793  std::function<void(int32_t, int32_t, int32_t, int32_t)> set_anchor_rect;
794  std::function<void(xdg_positioner_anchor)> set_anchor;
795  std::function<void(xdg_positioner_gravity)> set_gravity;
796  std::function<void(xdg_positioner_constraint_adjustment)> set_constraint_adjustment;
797  std::function<void(int32_t, int32_t)> set_offset;
798  std::function<void()> set_reactive;
799  std::function<void(int32_t, int32_t)> set_parent_size;
800  std::function<void(uint32_t)> set_parent_configure;
801  };
802 
803  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
804 
805 protected:
806  static constexpr const wl_interface *interface = &wayland::server::detail::xdg_positioner_interface;
807  static constexpr const unsigned int max_version = 4;
808 
809  friend class global_t<xdg_positioner_t>;
810  friend class global_base_t;
811 
812 public:
813  xdg_positioner_t() = default;
814  xdg_positioner_t(const client_t& client, uint32_t id, int version = 4);
815  xdg_positioner_t(const resource_t &resource);
816 
817  static const std::string interface_name;
818 
819  operator xdg_positioner*() const;
820 
826  std::function<void()> &on_destroy();
827 
839  std::function<void(int32_t, int32_t)> &on_set_size();
840 
859  std::function<void(int32_t, int32_t, int32_t, int32_t)> &on_set_anchor_rect();
860 
872  std::function<void(xdg_positioner_anchor)> &on_set_anchor();
873 
885  std::function<void(xdg_positioner_gravity)> &on_set_gravity();
886 
906 
924  std::function<void(int32_t, int32_t)> &on_set_offset();
925 
936  std::function<void()> &on_set_reactive();
937 
951  std::function<void(int32_t, int32_t)> &on_set_parent_size();
952 
962  std::function<void(uint32_t)> &on_set_parent_configure();
963 
966  void post_invalid_input(std::string const& msg);
967 
968 };
969 
971 
975 enum class xdg_positioner_error : uint32_t
976  {
978  invalid_input = 0
979 };
980 
984 enum class xdg_positioner_anchor : uint32_t
985  {
986  none = 0,
987  top = 1,
988  bottom = 2,
989  left = 3,
990  right = 4,
991  top_left = 5,
992  bottom_left = 6,
993  top_right = 7,
994  bottom_right = 8
995 };
996 
1000 enum class xdg_positioner_gravity : uint32_t
1001  {
1002  none = 0,
1003  top = 1,
1004  bottom = 2,
1005  left = 3,
1006  right = 4,
1007  top_left = 5,
1008  bottom_left = 6,
1009  top_right = 7,
1010  bottom_right = 8
1011 };
1012 
1028 struct xdg_positioner_constraint_adjustment : public wayland::detail::bitfield<6, 8>
1029 {
1030  xdg_positioner_constraint_adjustment(const wayland::detail::bitfield<6, 8> &b)
1031  : wayland::detail::bitfield<6, 8>(b) {}
1032  xdg_positioner_constraint_adjustment(const uint32_t value)
1033  : wayland::detail::bitfield<6, 8>(value) {}
1034  static const wayland::detail::bitfield<6, 8> none;
1035  static const wayland::detail::bitfield<6, 8> slide_x;
1036  static const wayland::detail::bitfield<6, 8> slide_y;
1037  static const wayland::detail::bitfield<6, 8> flip_x;
1038  static const wayland::detail::bitfield<6, 8> flip_y;
1039  static const wayland::detail::bitfield<6, 8> resize_x;
1040  static const wayland::detail::bitfield<6, 8> resize_y;
1041 };
1042 
1043 
1093 class xdg_surface_t : public resource_t
1094 {
1095 private:
1096  struct events_t : public resource_t::events_base_t
1097  {
1098  std::function<void()> destroy;
1099  std::function<void(xdg_toplevel_t)> get_toplevel;
1100  std::function<void(xdg_popup_t, xdg_surface_t, xdg_positioner_t)> get_popup;
1101  std::function<void(int32_t, int32_t, int32_t, int32_t)> set_window_geometry;
1102  std::function<void(uint32_t)> ack_configure;
1103  };
1104 
1105  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
1106 
1107 protected:
1108  static constexpr const wl_interface *interface = &wayland::server::detail::xdg_surface_interface;
1109  static constexpr const unsigned int max_version = 4;
1110 
1111  friend class global_t<xdg_surface_t>;
1112  friend class global_base_t;
1113 
1114 public:
1115  xdg_surface_t() = default;
1116  xdg_surface_t(const client_t& client, uint32_t id, int version = 4);
1117  xdg_surface_t(const resource_t &resource);
1118 
1119  static const std::string interface_name;
1120 
1121  operator xdg_surface*() const;
1122 
1129  std::function<void()> &on_destroy();
1130 
1141  std::function<void(xdg_toplevel_t)> &on_get_toplevel();
1142 
1158  std::function<void(xdg_popup_t, xdg_surface_t, xdg_positioner_t)> &on_get_popup();
1159 
1197  std::function<void(int32_t, int32_t, int32_t, int32_t)> &on_set_window_geometry();
1198 
1223  std::function<void(uint32_t)> &on_ack_configure();
1224 
1246  void configure(uint32_t serial, bool post = true);
1247 
1250  static constexpr std::uint32_t configure_since_version = 1;
1251 
1254  void post_not_constructed(std::string const& msg);
1255 
1258  void post_already_constructed(std::string const& msg);
1259 
1262  void post_unconfigured_buffer(std::string const& msg);
1263 
1264 };
1265 
1267 
1271 enum class xdg_surface_error : uint32_t
1272  {
1273  not_constructed = 1,
1274  already_constructed = 2,
1275  unconfigured_buffer = 3
1276 };
1277 
1278 
1300 class xdg_toplevel_t : public resource_t
1301 {
1302 private:
1303  struct events_t : public resource_t::events_base_t
1304  {
1305  std::function<void()> destroy;
1306  std::function<void(xdg_toplevel_t)> set_parent;
1307  std::function<void(std::string)> set_title;
1308  std::function<void(std::string)> set_app_id;
1309  std::function<void(seat_t, uint32_t, int32_t, int32_t)> show_window_menu;
1310  std::function<void(seat_t, uint32_t)> move;
1311  std::function<void(seat_t, uint32_t, xdg_toplevel_resize_edge)> resize;
1312  std::function<void(int32_t, int32_t)> set_max_size;
1313  std::function<void(int32_t, int32_t)> set_min_size;
1314  std::function<void()> set_maximized;
1315  std::function<void()> unset_maximized;
1316  std::function<void(output_t)> set_fullscreen;
1317  std::function<void()> unset_fullscreen;
1318  std::function<void()> set_minimized;
1319  };
1320 
1321  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
1322 
1323 protected:
1324  static constexpr const wl_interface *interface = &wayland::server::detail::xdg_toplevel_interface;
1325  static constexpr const unsigned int max_version = 4;
1326 
1327  friend class global_t<xdg_toplevel_t>;
1328  friend class global_base_t;
1329 
1330 public:
1331  xdg_toplevel_t() = default;
1332  xdg_toplevel_t(const client_t& client, uint32_t id, int version = 4);
1333  xdg_toplevel_t(const resource_t &resource);
1334 
1335  static const std::string interface_name;
1336 
1337  operator xdg_toplevel*() const;
1338 
1345  std::function<void()> &on_destroy();
1346 
1368  std::function<void(xdg_toplevel_t)> &on_set_parent();
1369 
1382  std::function<void(std::string)> &on_set_title();
1383 
1412  std::function<void(std::string)> &on_set_app_id();
1413 
1433  std::function<void(seat_t, uint32_t, int32_t, int32_t)> &on_show_window_menu();
1434 
1457  std::function<void(seat_t, uint32_t)> &on_move();
1458 
1497  std::function<void(seat_t, uint32_t, xdg_toplevel_resize_edge)> &on_resize();
1498 
1539  std::function<void(int32_t, int32_t)> &on_set_max_size();
1540 
1581  std::function<void(int32_t, int32_t)> &on_set_min_size();
1582 
1606  std::function<void()> &on_set_maximized();
1607 
1633  std::function<void()> &on_unset_maximized();
1634 
1663  std::function<void(output_t)> &on_set_fullscreen();
1664 
1686  std::function<void()> &on_unset_fullscreen();
1687 
1700  std::function<void()> &on_set_minimized();
1701 
1728  void configure(int32_t width, int32_t height, array_t const& states, bool post = true);
1729 
1732  static constexpr std::uint32_t configure_since_version = 1;
1733 
1746  void close(bool post = true);
1747 
1750  static constexpr std::uint32_t close_since_version = 1;
1751 
1773  void configure_bounds(int32_t width, int32_t height, bool post = true);
1774 
1777  static constexpr std::uint32_t configure_bounds_since_version = 4;
1778 
1782  bool can_configure_bounds() const;
1783 
1786  void post_invalid_resize_edge(std::string const& msg);
1787 
1788 };
1789 
1791 
1795 enum class xdg_toplevel_error : uint32_t
1796  {
1798  invalid_resize_edge = 0
1799 };
1800 
1807 struct xdg_toplevel_resize_edge : public wayland::detail::bitfield<4, 11>
1808 {
1809  xdg_toplevel_resize_edge(const wayland::detail::bitfield<4, 11> &b)
1810  : wayland::detail::bitfield<4, 11>(b) {}
1811  xdg_toplevel_resize_edge(const uint32_t value)
1812  : wayland::detail::bitfield<4, 11>(value) {}
1813  static const wayland::detail::bitfield<4, 11> none;
1814  static const wayland::detail::bitfield<4, 11> top;
1815  static const wayland::detail::bitfield<4, 11> bottom;
1816  static const wayland::detail::bitfield<4, 11> left;
1817  static const wayland::detail::bitfield<4, 11> top_left;
1818  static const wayland::detail::bitfield<4, 11> bottom_left;
1819  static const wayland::detail::bitfield<4, 11> right;
1820  static const wayland::detail::bitfield<4, 11> top_right;
1821  static const wayland::detail::bitfield<4, 11> bottom_right;
1822 };
1823 
1835 enum class xdg_toplevel_state : uint32_t
1836  {
1838  maximized = 1,
1840  fullscreen = 2,
1842  resizing = 3,
1844  activated = 4,
1845  tiled_left = 5,
1846  tiled_right = 6,
1847  tiled_top = 7,
1848  tiled_bottom = 8
1849 };
1850 
1851 
1880 class xdg_popup_t : public resource_t
1881 {
1882 private:
1883  struct events_t : public resource_t::events_base_t
1884  {
1885  std::function<void()> destroy;
1886  std::function<void(seat_t, uint32_t)> grab;
1887  std::function<void(xdg_positioner_t, uint32_t)> reposition;
1888  };
1889 
1890  static int dispatcher(int opcode, const std::vector<wayland::detail::any>& args, const std::shared_ptr<resource_t::events_base_t>& e);
1891 
1892 protected:
1893  static constexpr const wl_interface *interface = &wayland::server::detail::xdg_popup_interface;
1894  static constexpr const unsigned int max_version = 4;
1895 
1896  friend class global_t<xdg_popup_t>;
1897  friend class global_base_t;
1898 
1899 public:
1900  xdg_popup_t() = default;
1901  xdg_popup_t(const client_t& client, uint32_t id, int version = 4);
1902  xdg_popup_t(const resource_t &resource);
1903 
1904  static const std::string interface_name;
1905 
1906  operator xdg_popup*() const;
1907 
1917  std::function<void()> &on_destroy();
1918 
1966  std::function<void(seat_t, uint32_t)> &on_grab();
1967 
1997  std::function<void(xdg_positioner_t, uint32_t)> &on_reposition();
1998 
2019  void configure(int32_t x, int32_t y, int32_t width, int32_t height, bool post = true);
2020 
2023  static constexpr std::uint32_t configure_since_version = 1;
2024 
2032  void popup_done(bool post = true);
2033 
2036  static constexpr std::uint32_t popup_done_since_version = 1;
2037 
2058  void repositioned(uint32_t token, bool post = true);
2059 
2062  static constexpr std::uint32_t repositioned_since_version = 3;
2063 
2067  bool can_repositioned() const;
2068 
2071  void post_invalid_grab(std::string const& msg);
2072 
2073 };
2074 
2076 
2080 enum class xdg_popup_error : uint32_t
2081  {
2083  invalid_grab = 0
2084 };
2085 
2086 
2087 
2088 }
2089 }
static constexpr std::uint32_t discarded_since_version
Minimum protocol version required for the discarded function.
void discarded(bool post=true)
the content update was not displayed
void presented(uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec, uint32_t refresh, uint32_t seq_hi, uint32_t seq_lo, presentation_feedback_kind const &flags, bool post=true)
the content update was displayed
static constexpr std::uint32_t presented_since_version
Minimum protocol version required for the presented function.
static constexpr std::uint32_t sync_output_since_version
Minimum protocol version required for the sync_output function.
void sync_output(output_t const &output, bool post=true)
presentation synchronized to this output
timed presentation related wl_surface requests
void post_invalid_timestamp(std::string const &msg)
Post error: invalid value in tv_nsec.
std::function< void(surface_t, presentation_feedback_t)> & on_feedback()
request presentation feedback information
std::function< void()> & on_destroy()
unbind from the presentation interface
void post_invalid_flag(std::string const &msg)
Post error: invalid flag.
static constexpr std::uint32_t clock_id_since_version
Minimum protocol version required for the clock_id function.
void clock_id(uint32_t clk_id, bool post=true)
clock ID for timestamps
crop and scale interface to a wl_surface
void post_bad_size(std::string const &msg)
Post error: destination size is not integer.
std::function< void(int32_t, int32_t)> & on_set_destination()
set the surface size for scaling
void post_no_surface(std::string const &msg)
Post error: the wl_surface was destroyed.
std::function< void()> & on_destroy()
remove scaling and cropping from the surface
void post_bad_value(std::string const &msg)
Post error: negative or zero values in width or height.
void post_out_of_buffer(std::string const &msg)
Post error: source rectangle extends outside of the content area.
std::function< void(double, double, double, double)> & on_set_source()
set the source rectangle for cropping
std::function< void(viewport_t, surface_t)> & on_get_viewport()
extend surface interface for crop and scale
std::function< void()> & on_destroy()
unbind from the cropping and scaling interface
void post_viewport_exists(std::string const &msg)
Post error: the surface already has a viewport object associated.
short-lived, popup surfaces for menus
std::function< void(seat_t, uint32_t)> & on_grab()
make the popup take an explicit grab
bool can_repositioned() const
Check whether the repositioned function is available with the currently bound version of the protocol...
void configure(int32_t x, int32_t y, int32_t width, int32_t height, bool post=true)
configure the popup surface
std::function< void(xdg_positioner_t, uint32_t)> & on_reposition()
recalculate the popup's location
void popup_done(bool post=true)
popup interaction is done
void post_invalid_grab(std::string const &msg)
Post error: tried to grab after being mapped.
void repositioned(uint32_t token, bool post=true)
signal the completion of a repositioned request
static constexpr std::uint32_t configure_since_version
Minimum protocol version required for the configure function.
static constexpr std::uint32_t repositioned_since_version
Minimum protocol version required for the repositioned function.
std::function< void()> & on_destroy()
remove xdg_popup interface
static constexpr std::uint32_t popup_done_since_version
Minimum protocol version required for the popup_done function.
std::function< void(xdg_positioner_gravity)> & on_set_gravity()
set child surface gravity
void post_invalid_input(std::string const &msg)
Post error: invalid input provided.
std::function< void(int32_t, int32_t)> & on_set_size()
set the size of the to-be positioned rectangle
std::function< void(xdg_positioner_anchor)> & on_set_anchor()
set anchor rectangle anchor
std::function< void()> & on_destroy()
destroy the xdg_positioner object
std::function< void(xdg_positioner_constraint_adjustment)> & on_set_constraint_adjustment()
set the adjustment to be done when constrained
std::function< void(int32_t, int32_t)> & on_set_offset()
set surface position offset
std::function< void(int32_t, int32_t)> & on_set_parent_size()
std::function< void()> & on_set_reactive()
continuously reconstrain the surface
std::function< void(uint32_t)> & on_set_parent_configure()
set parent configure this is a response to
std::function< void(int32_t, int32_t, int32_t, int32_t)> & on_set_anchor_rect()
set the anchor rectangle within the parent surface
desktop user interface surface base interface
std::function< void()> & on_destroy()
destroy the xdg_surface
void post_not_constructed(std::string const &msg)
Post error:
void post_already_constructed(std::string const &msg)
Post error:
std::function< void(xdg_toplevel_t)> & on_get_toplevel()
assign the xdg_toplevel surface role
void post_unconfigured_buffer(std::string const &msg)
Post error:
void configure(uint32_t serial, bool post=true)
suggest a surface change
std::function< void(int32_t, int32_t, int32_t, int32_t)> & on_set_window_geometry()
set the new window geometry
std::function< void(uint32_t)> & on_ack_configure()
ack a configure event
static constexpr std::uint32_t configure_since_version
Minimum protocol version required for the configure function.
std::function< void(xdg_popup_t, xdg_surface_t, xdg_positioner_t)> & on_get_popup()
assign the xdg_popup surface role
std::function< void(int32_t, int32_t)> & on_set_min_size()
set the minimum size
std::function< void(seat_t, uint32_t, int32_t, int32_t)> & on_show_window_menu()
show the window menu
std::function< void()> & on_unset_maximized()
unmaximize the window
static constexpr std::uint32_t configure_bounds_since_version
Minimum protocol version required for the configure_bounds function.
static constexpr std::uint32_t close_since_version
Minimum protocol version required for the close function.
std::function< void()> & on_unset_fullscreen()
unset the window as fullscreen
bool can_configure_bounds() const
Check whether the configure_bounds function is available with the currently bound version of the prot...
std::function< void(xdg_toplevel_t)> & on_set_parent()
set the parent of this surface
std::function< void(std::string)> & on_set_app_id()
set application ID
static constexpr std::uint32_t configure_since_version
Minimum protocol version required for the configure function.
std::function< void(int32_t, int32_t)> & on_set_max_size()
set the maximum size
void close(bool post=true)
surface wants to be closed
void post_invalid_resize_edge(std::string const &msg)
Post error: provided value is not a valid variant of the resize_edge enum.
std::function< void(std::string)> & on_set_title()
set surface title
std::function< void(seat_t, uint32_t)> & on_move()
start an interactive move
std::function< void()> & on_set_maximized()
maximize the window
std::function< void(seat_t, uint32_t, xdg_toplevel_resize_edge)> & on_resize()
start an interactive resize
std::function< void(output_t)> & on_set_fullscreen()
set the window as fullscreen on an output
std::function< void()> & on_set_minimized()
set the window as minimized
void configure_bounds(int32_t width, int32_t height, bool post=true)
recommended window geometry bounds
void configure(int32_t width, int32_t height, array_t const &states, bool post=true)
suggest a surface change
std::function< void()> & on_destroy()
destroy the xdg_toplevel
std::function< void()> & on_destroy()
destroy xdg_wm_base
std::function< void(uint32_t)> & on_pong()
respond to a ping event
void post_invalid_surface_state(std::string const &msg)
Post error: the client provided an invalid surface state.
void post_invalid_popup_parent(std::string const &msg)
Post error: the client specified an invalid popup parent surface.
void post_role(std::string const &msg)
Post error: given wl_surface has another role.
void post_defunct_surfaces(std::string const &msg)
Post error: xdg_wm_base was destroyed before children.
void ping(uint32_t serial, bool post=true)
check if the client is alive
std::function< void(xdg_positioner_t)> & on_create_positioner()
create a positioner object
void post_invalid_positioner(std::string const &msg)
Post error: the client provided an invalid positioner.
std::function< void(xdg_surface_t, surface_t)> & on_get_xdg_surface()
create a shell surface from a surface
void post_not_the_topmost_popup(std::string const &msg)
Post error: the client tried to map or destroy a non-topmost popup.
static constexpr std::uint32_t ping_since_version
Minimum protocol version required for the ping function.