- 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;
-
- 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 *)>>
- name_task_pair;
- std::vector<name_task_pair> pending;
+ // This controller is still missing ivi-input
+
+ 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;
+
+ typedef std::unordered_map<uint32_t, struct surface_properties> props_map;
+
+ // 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
+ // proxy-to-id mapping. I.e. the *_proxy_to_id members need to be valid
+ // 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.
+ 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;
+
+ props_map sprops;
+ props_map lprops;
+
+ surface_map_type surfaces;
+ layer_map_type layers;
+ screen_map_type screens;