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<wl::output>(r, name, v));
- });
+ "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) {
+ c.outputs.emplace_back(std::make_unique<wl::output>(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<genivi::controller>(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<struct wl_proxy *>(
- 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<struct wl_proxy *>(
+ c.outputs.back()->proxy.get())));
});
// First level objects
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);
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;
});
#include <vector>
#ifdef __GNUC__
-#define ATTR_FORMAT(stringindex, firsttocheck) __attribute__((format(printf, stringindex, firsttocheck)))
+#define ATTR_FORMAT(stringindex, firsttocheck) \
+ __attribute__((format(printf, stringindex, firsttocheck)))
#else
#define ATTR_FORMAT(stringindex, firsttocheck)
#endif
-void lognotice(char const *fmt, ...) ATTR_FORMAT(1,2);
-void logerror(char const *fmt, ...) ATTR_FORMAT(1,2);
-void fatal(char const *fmt, ...) ATTR_FORMAT(1,2);
+void lognotice(char const *fmt, ...) ATTR_FORMAT(1, 2);
+void logerror(char const *fmt, ...) ATTR_FORMAT(1, 2);
+void fatal(char const *fmt, ...) ATTR_FORMAT(1, 2);
#ifdef DEBUG_OUTPUT
-void logdebug(char const *fmt, ...) ATTR_FORMAT(1,2);
+void logdebug(char const *fmt, ...) ATTR_FORMAT(1, 2);
#else
-static inline void logdebug(char const * fmt, ...) ATTR_FORMAT(1,2);
-static inline void logdebug(char const * fmt, ...) {}
+static inline void logdebug(char const *fmt, ...) ATTR_FORMAT(1, 2);
+static inline void logdebug(char const *fmt, ...) {}
#endif
// _ _ _ __ _
void controller::layer_screen(struct layer *l, struct wl_output *screen) {
logdebug("genivi::layer %s @ %p s %p", __func__, this->proxy.get(), screen);
-
}
void controller::layer_destroyed(struct layer *l) {
for (auto const &i : this->surfaces) {
auto const &r = i.second->dst_rect;
auto const &s = i.second->size;
- printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h,
- r.x, r.y);
+ printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h, r.x,
+ r.y);
}
puts("\b\b ");
}
for (auto const &i : this->layers) {
auto const &r = i.second->dst_rect;
auto const &s = i.second->size;
- printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h,
- r.x, r.y);
+ printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h, r.x,
+ r.y);
}
puts("\b\b ");
}
#include "util.hpp"
#include <functional>
-#include <unordered_map>
#include <memory>
+#include <unordered_map>
#include <vector>
// _ _
void done();
void scale(int32_t factor);
};
-}
+} // namespace wl
// _ __ __ _ _ __ ___ ___ ___ _ __ __ _ ___ ___
// | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \
void surface_orientation(struct surface *s, int32_t orientation);
void surface_pixelformat(struct surface *s, int32_t pixelformat);
void surface_layer(struct surface *s, struct ivi_controller_layer *layer);
- void surface_stats(struct surface *s, uint32_t redraw_count, uint32_t frame_count,
- uint32_t update_count, uint32_t pid,
+ void surface_stats(struct surface *s, uint32_t redraw_count,
+ uint32_t frame_count, uint32_t update_count, uint32_t pid,
const char *process_name);
void surface_destroyed(struct surface *s);
void surface_content(struct surface *s, int32_t content_state);
// layer
void layer_visibility(struct layer *l, int32_t visibility);
void layer_opacity(struct layer *l, float opacity);
- void layer_source_rectangle(struct layer *l, int32_t x, int32_t y, int32_t width,
- int32_t height);
+ void layer_source_rectangle(struct layer *l, int32_t x, int32_t y,
+ int32_t width, int32_t height);
void layer_destination_rectangle(struct layer *l, int32_t x, int32_t y,
int32_t width, int32_t height);
void layer_configuration(struct layer *l, int32_t width, int32_t height);
void layer_screen(struct layer *l, struct wl_output *screen);
void layer_destroyed(struct layer *l);
};
-}
+} // namespace genivi
#endif // !WM_WAYLAND_HPP