36using namespace wayland;
42 wl_display* c_display =
nullptr;
43 std::unique_ptr<display_t> display;
47 foreign_display() =
default;
48 foreign_display(
const foreign_display&) =
delete;
49 foreign_display(foreign_display&&) noexcept = delete;
50 foreign_display& operator=(const foreign_display&) = delete;
51 foreign_display& operator=(foreign_display&&) noexcept = delete;
54 ~foreign_display() noexcept
61 wl_display_disconnect(c_display);
66 c_display = wl_display_connect(
nullptr);
69 std::cerr <<
"Cannot connect to Wayland display";
74 registry = display->get_registry();
75 registry.
on_global() = [&] (uint32_t name,
const std::string& interface, uint32_t version)
77 std::cout <<
"* Global interface " <<
interface << " (name
" << name << " version
" << version << ")
" << std::endl;
Represents a connection to the compositor and acts as a proxy to the display singleton object.
void proxy_release()
Release the wrapped object (if any), making this an empty wrapper.
std::function< void(uint32_t, std::string, uint32_t)> & on_global()
announce global object