35 using namespace wayland;
56 std::vector<output_t> outputs;
59 registry.
on_global() = [&] (uint32_t name, std::string interface, uint32_t version)
61 std::cout <<
"* Global interface " <<
interface << " (name " << name << " version " << version << ")" << std::endl;
62 if(interface == output_t::interface_name)
64 outputs.emplace_back();
65 auto& output = outputs.back();
66 registry.
bind(name, output, version);
67 output.on_geometry() = [=](int32_t x, int32_t y, int32_t physw, int32_t physh, output_subpixel subp, std::string make, std::string model,
output_transform transform)
69 std::cout <<
"* Output geometry for " << output.
get_id() <<
":" << std::endl
70 <<
" Maker: " << make << std::endl
71 <<
" Model: " << model << std::endl
72 <<
" X: " << x << std::endl
73 <<
" Y: " << y << std::endl
74 <<
" PhysW: " << physw <<
" mm" << std::endl
75 <<
" PhysH: " << physh <<
" mm" << std::endl
76 <<
" Subpix: " << static_cast<unsigned int>(subp) << std::endl
77 <<
" Transf: " << static_cast<unsigned int>(transform) << std::endl;
79 output.on_scale() = [=](int32_t scale)
81 std::cout <<
"* Output scale for " << output.get_id() <<
": " << scale << std::endl;
83 output.on_mode() = [=](uint32_t flags, int32_t width, int32_t height, int32_t refresh)
85 std::cout <<
"* Output mode for " << output.get_id() <<
":" << std::endl
86 <<
" Width: " << width << std::endl
87 <<
" Height: " << height << std::endl
88 <<
" Refresh: " << refresh <<
" mHz" << std::endl
89 <<
" Flags: " << flags << std::endl;
95 std::cout <<
"------" << std::endl;