diff options
Diffstat (limited to 'src/wayland.hpp')
-rw-r--r-- | src/wayland.hpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/wayland.hpp b/src/wayland.hpp index 4865e42..7e005f1 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -228,6 +228,14 @@ struct screen : public wayland_proxy<struct ivi_controller_screen>, // \___\___/|_| |_|\__|_| \___/|_|_|\___|_| // struct controller : public wayland_proxy<struct ivi_controller> { + typedef std::unordered_map<uintptr_t, uint32_t> proxy_to_id_map_type; + typedef std::unordered_map<uint32_t, std::unique_ptr<struct surface>> + surface_map_type; + typedef std::unordered_map<uint32_t, std::unique_ptr<struct layer>> + layer_map_type; + typedef std::unordered_map<uint32_t, std::unique_ptr<struct screen>> + screen_map_type; + // HACK: // The order of these member is mandatory, as when objects are destroyed // they will call their parent (that's us right here!) and remove their @@ -235,13 +243,13 @@ struct controller : public wayland_proxy<struct ivi_controller> { // when the surfaces/layers/screens maps are destroyed. This sucks, but // I cannot see a better solution w/o globals or some other horrible // call-our-parent construct. - std::unordered_map<uintptr_t, uint32_t> surface_proxy_to_id; - std::unordered_map<uintptr_t, uint32_t> layer_proxy_to_id; - std::unordered_map<uintptr_t, uint32_t> screen_proxy_to_id; + proxy_to_id_map_type surface_proxy_to_id; + proxy_to_id_map_type layer_proxy_to_id; + proxy_to_id_map_type 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; + surface_map_type surfaces; + layer_map_type layers; + screen_map_type screens; typedef std::pair<char const *, std::function<void(struct controller *)>> name_task_pair; |