From edb416241ef3a38dbade052c8361b8b96049894e Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Fri, 23 Jun 2017 14:09:32 +0200 Subject: wayland: store layer properties Signed-off-by: Marcus Fritzsch --- src/wayland.cpp | 22 +++++++++++++--------- src/wayland.hpp | 8 ++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/wayland.cpp b/src/wayland.cpp index 3983da8..66efb72 100644 --- a/src/wayland.cpp +++ b/src/wayland.cpp @@ -194,12 +194,12 @@ constexpr struct ivi_controller_listener listener = { controller::controller(struct wl_registry *r, uint32_t name, uint32_t version) : wayland_proxy( - wl_registry_bind(r, name, &ivi_controller_interface, version)) - , surfaces{} - , layers{} - , screens{} - , pending{} - , output_size{} { + wl_registry_bind(r, name, &ivi_controller_interface, version)), + surfaces{}, + layers{}, + screens{}, + pending{}, + output_size{} { ivi_controller_add_listener(this->proxy, &listener, this); } @@ -306,9 +306,7 @@ constexpr struct ivi_controller_layer_listener layer_listener = { }; } -layer::layer(uint32_t i, struct controller *c) - : layer(i, 0, 0, c) { -} +layer::layer(uint32_t i, struct controller *c) : layer(i, 0, 0, c) {} layer::layer(uint32_t i, int32_t w, int32_t h, struct controller *c) : wayland_proxy(ivi_controller_layer_create(c->proxy, i, w, h)), @@ -324,32 +322,38 @@ layer::~layer() { void controller::layer_visibility(uint32_t id, int32_t visibility) { logdebug("genivi::layer %s @ %p v %i", __func__, this->proxy, visibility); + this->layers[id]->visibility = visibility; } void controller::layer_opacity(uint32_t id, float opacity) { logdebug("genivi::layer %s @ %p o %f", __func__, this->proxy, opacity); + this->layers[id]->opacity = opacity; } void controller::layer_source_rectangle(uint32_t id, int32_t x, int32_t y, int32_t width, int32_t height) { logdebug("genivi::layer %s @ %p x %i y %i w %i h %i", __func__, this->proxy, x, y, width, height); + this->layers[id]->src_rect = rect{uint32_t(width), uint32_t(height), x, y}; } void controller::layer_destination_rectangle(uint32_t id, int32_t x, int32_t y, int32_t width, int32_t height) { logdebug("genivi::layer %s @ %p x %i y %i w %i h %i", __func__, this->proxy, x, y, width, height); + this->layers[id]->dst_rect = rect{uint32_t(width), uint32_t(height), x, y}; } void controller::layer_configuration(uint32_t id, int32_t width, int32_t height) { logdebug("genivi::layer %s @ %p w %i h %i", __func__, this->proxy, width, height); + this->layers[id]->size = size{uint32_t(width), uint32_t(height)}; } void controller::layer_orientation(uint32_t id, int32_t orientation) { logdebug("genivi::layer %s @ %p o %i", __func__, this->proxy, orientation); + this->layers[id]->orientation = orientation; } void controller::layer_screen(uint32_t id, struct wl_output *screen) { diff --git a/src/wayland.hpp b/src/wayland.hpp index a98c36d..c8a7113 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -201,6 +201,13 @@ struct surface : public wayland_proxy, // |___/ struct layer : public wayland_proxy, controlled_entity { + struct rect dst_rect; + struct rect src_rect; + struct size size; + int32_t orientation; + int32_t visibility; + float opacity; + layer(uint32_t i, struct controller *c); layer(uint32_t i, int32_t w, int32_t h, struct controller *c); ~layer() override; @@ -299,6 +306,7 @@ struct controller : public wayland_proxy { } this->pending.clear(); ivi_controller_commit_changes(this->proxy); + // XXX: No flush here... } } -- cgit 1.2.3-korg