35using namespace wayland;
41 wl_display* c_display =
nullptr;
42 std::unique_ptr<display_t> display;
46 foreign_display() =
default;
47 foreign_display(
const foreign_display&) =
delete;
48 foreign_display(foreign_display&&) noexcept = delete;
49 foreign_display& operator=(const foreign_display&) = delete;
50 foreign_display& operator=(foreign_display&&) noexcept = delete;
53 ~foreign_display() noexcept
60 wl_display_disconnect(c_display);
65 c_display = wl_display_connect(
nullptr);
68 std::cerr <<
"Cannot connect to Wayland display";
73 registry = display->get_registry();
74 registry.
on_global() = [&] (uint32_t name,
const std::string& interface, uint32_t version)
76 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