wayland: simpler layout for controller::proxy_to_id maps
[staging/windowmanager.git] / src / wayland.hpp
index 9a5541d..60a045b 100644 (file)
@@ -208,19 +208,9 @@ struct layer : public wayland_proxy<struct ivi_controller_layer>,
 struct screen : public wayland_proxy<struct ivi_controller_screen>,
                 controller_child {
    screen(uint32_t i, struct controller *c, struct ivi_controller_screen *p);
-
-   void clear() { ivi_controller_screen_clear(this->proxy); }
-   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);
-   }
+   void clear();
+   void add_layer(layer *l);
+   void set_render_order(std::vector<uint32_t> const &ro);
 };
 
 //                  _             _ _
@@ -231,10 +221,11 @@ struct screen : public wayland_proxy<struct ivi_controller_screen>,
 //
 struct controller : public wayland_proxy<struct ivi_controller> {
    std::unordered_map<uintptr_t, uint32_t> surface_proxy_to_id;
-   std::unordered_map<uint32_t, std::unique_ptr<struct surface>> surfaces;
    std::unordered_map<uintptr_t, uint32_t> layer_proxy_to_id;
-   std::unordered_map<uint32_t, std::unique_ptr<struct layer>> layers;
    std::unordered_map<uintptr_t, uint32_t> screen_proxy_to_id;
+
+   std::unordered_map<uint32_t, std::unique_ptr<struct surface>> surfaces;
+   std::unordered_map<uint32_t, std::unique_ptr<struct layer>> layers;
    std::unordered_map<uint32_t, std::unique_ptr<struct screen>> screens;
 
    typedef std::pair<char const *, std::function<void(struct controller *)>>