wayland: C++ified set_render_order requests for layer and screen
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Fri, 23 Jun 2017 13:04:37 +0000 (15:04 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000 (17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/wayland.hpp

index 44f6cb4..da3cc29 100644 (file)
@@ -257,8 +257,13 @@ struct layer : public wayland_proxy<struct ivi_controller_layer>,
       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<uint32_t> const &ro) {
+      struct wl_array wlro{
+         .size = ro.size() * sizeof(ro[0]),
+         .alloc = ro.capacity() * sizeof(ro[0]),
+         .data = const_cast<void *>(static_cast<void const *>(ro.data()))
+      };
+      ivi_controller_layer_set_render_order(this->proxy, &wlro);
    }
 };
 
@@ -276,6 +281,14 @@ struct screen : public wayland_proxy<struct ivi_controller_screen>,
    void add_layer(layer *l) {
       ivi_controller_screen_add_layer(this->proxy, l->proxy);
    }
+   void set_render_order(std::vector<uint32_t> const &ro) {
+      struct wl_array wlro{
+         .size = ro.size() * sizeof(ro[0]),
+         .alloc = ro.capacity() * sizeof(ro[0]),
+         .data = const_cast<void *>(static_cast<void const *>(ro.data()))
+      };
+      ivi_controller_screen_set_render_order(this->proxy, &wlro);
+   }
 };
 
 //                  _             _ _