35 using namespace wayland;
47 dumper(
const dumper&) =
delete;
48 dumper(dumper&&) noexcept = delete;
49 ~dumper() noexcept = default;
50 dumper& operator=(const dumper&) = delete;
51 dumper& operator=(dumper&&) noexcept = delete;
55 std::vector<output_t> outputs;
58 registry.
on_global() = [&] (uint32_t name,
const std::string& interface, uint32_t version)
60 std::cout <<
"* Global interface " <<
interface << " (name " << name << " version " << version << ")" << std::endl;
61 if(interface == output_t::interface_name)
63 outputs.emplace_back();
64 auto& output = outputs.back();
65 registry.
bind(name, output, version);
70 std::cout <<
"------" << std::endl;
72 for(
auto& output : outputs)
74 output.on_geometry() = [&](int32_t x, int32_t y, int32_t physw, int32_t physh, output_subpixel subp,
const std::string& make,
const std::string& model,
const output_transform& transform)
76 std::cout <<
"* Output geometry for " << output.get_id() <<
":" << std::endl
77 <<
" Maker: " << make << std::endl
78 <<
" Model: " << model << std::endl
79 <<
" X: " << x << std::endl
80 <<
" Y: " << y << std::endl
81 <<
" PhysW: " << physw <<
" mm" << std::endl
82 <<
" PhysH: " << physh <<
" mm" << std::endl
83 <<
" Subpix: " <<
static_cast<unsigned int>(subp) << std::endl
84 <<
" Transf: " <<
static_cast<unsigned int>(transform) << std::endl;
86 output.on_scale() = [&](int32_t scale)
88 std::cout <<
"* Output scale for " << output.get_id() <<
": " << scale << std::endl;
90 output.on_mode() = [&](uint32_t flags, int32_t width, int32_t height, int32_t refresh)
92 std::cout <<
"* Output mode for " << output.get_id() <<
":" << std::endl
93 <<
" Width: " << width << std::endl
94 <<
" Height: " << height << std::endl
95 <<
" Refresh: " << refresh <<
" mHz" << std::endl
96 <<
" Flags: " << flags << std::endl;
104 for(
auto &output : outputs)
Represents a connection to the compositor and acts as a proxy to the display singleton object.
int roundtrip()
Block until all pending request are processed by the server.
registry_t get_registry()
get global registry object
std::function< void(uint32_t, std::string, uint32_t)> & on_global()
announce global object
proxy_t bind(uint32_t name, proxy_t &interface, uint32_t version)
bind an object to the display