From b2dac46f817dcb12c180925a52dae5494ea584a3 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Fri, 23 Jun 2017 15:04:37 +0200 Subject: wayland: C++ified set_render_order requests for layer and screen Signed-off-by: Marcus Fritzsch --- src/wayland.hpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wayland.hpp b/src/wayland.hpp index 44f6cb4..da3cc29 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -257,8 +257,13 @@ struct layer : public wayland_proxy, ivi_controller_layer_remove_surface(this->proxy, surface->proxy); } - inline void set_render_order(struct wl_array *surfaces) { - ivi_controller_layer_set_render_order(this->proxy, surfaces); + void set_render_order(std::vector const &ro) { + struct wl_array wlro{ + .size = ro.size() * sizeof(ro[0]), + .alloc = ro.capacity() * sizeof(ro[0]), + .data = const_cast(static_cast(ro.data())) + }; + ivi_controller_layer_set_render_order(this->proxy, &wlro); } }; @@ -276,6 +281,14 @@ struct screen : public wayland_proxy, void add_layer(layer *l) { ivi_controller_screen_add_layer(this->proxy, l->proxy); } + void set_render_order(std::vector const &ro) { + struct wl_array wlro{ + .size = ro.size() * sizeof(ro[0]), + .alloc = ro.capacity() * sizeof(ro[0]), + .data = const_cast(static_cast(ro.data())) + }; + ivi_controller_screen_set_render_order(this->proxy, &wlro); + } }; // _ _ _ -- cgit 1.2.3-korg