X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain.cpp;h=571ffcaf84371669fc123becde265cd19f53d92f;hb=9753260ef3e5bad3fc600987dbf9d82af259a4ea;hp=85169deb37cf0bcb6ea1462a774cd0d61b95e932;hpb=e86177d7a54d8c2c0e096fd856e64bb9671267a4;p=staging%2Fwindowmanager.git diff --git a/src/main.cpp b/src/main.cpp index 85169de..571ffca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,19 +86,20 @@ int main(int /*argc*/, char ** /*argv*/) { struct connection c {}; d.r.add_global_handler( - "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) { - c.outputs.emplace_back(std::make_unique(r, name, v)); - }); + "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) { + c.outputs.emplace_back(std::make_unique(r, name, v)); + }); d.r.add_global_handler( "ivi_controller", [&c](wl_registry *r, uint32_t name, uint32_t v) { c.c = std::make_unique(r, name, v); - // XXX: This protocol needs the output, so lets just add our mapping here... - c.c->add_proxy_to_id_mapping(c.outputs.back()->proxy.get(), - wl_proxy_get_id( - reinterpret_cast( - c.outputs.back()->proxy.get()))); + // XXX: This protocol needs the output, so lets just add our mapping + // here... + c.c->add_proxy_to_id_mapping( + c.outputs.back()->proxy.get(), + wl_proxy_get_id(reinterpret_cast( + c.outputs.back()->proxy.get()))); }); // First level objects @@ -112,18 +113,16 @@ int main(int /*argc*/, char ** /*argv*/) { fatal("Could not init layout: %s", e); } - struct Poller p{}; + struct Poller p {}; p.add_fd(STDIN_FILENO, [&c](int fd) { - int buf; - ssize_t ret; - ret = read(fd, &buf, sizeof(buf)); - c.c->debug_dump_current_status(); - return ret == 0 ? -1 : 0; + int buf; + ssize_t ret; + ret = read(fd, &buf, sizeof(buf)); + c.c->debug_dump_current_status(); + return ret == 0 ? -1 : 0; }); - p.add_fd(d.get_fd(), [&d](int fd) { - return d.dispatch(); - }); + p.add_fd(d.get_fd(), [&d](int fd) { return d.dispatch(); }); sigset_t sset{}; sigemptyset(&sset); @@ -135,7 +134,7 @@ int main(int /*argc*/, char ** /*argv*/) { p.add_fd(sfd.fd, [](int fd) { struct signalfd_siginfo si; while (read(fd, &si, sizeof(si)) == sizeof(si)) { - lognotice("Received signal %u", si.ssi_signo); + lognotice("Received signal %u", si.ssi_signo); } return -1; });