diff options
author | 2017-07-10 10:44:29 +0200 | |
---|---|---|
committer | 2017-08-08 17:24:00 +0200 | |
commit | 0c673801b78c98fe116b4d14bf37fb18f8b749dc (patch) | |
tree | 2600e18722fa4e0694ed33afbadf0c0b83640ebf /src/wayland.hpp | |
parent | 8c587d6defaf73c1ddbe50d88f6fdd7360b63507 (diff) |
Track surface/layer properties with one struct
As both share the exact same properties this makes sense, we now can
write code once and work on both layer and surface properties. This
however is only relevant in the wayland "level" of things, as in WM
semantics layers are always fullscreen.
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/wayland.hpp')
-rw-r--r-- | src/wayland.hpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/wayland.hpp b/src/wayland.hpp index 7e005f1..740a703 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -136,6 +136,16 @@ struct controller_child { virtual ~controller_child() {} }; +struct surface_properties { + uint32_t id; // let's just save an ID here too + struct rect dst_rect; + struct rect src_rect; + struct size size; + int32_t orientation; + int32_t visibility; + float opacity; +}; + // __ // ___ _ _ _ __ / _| __ _ ___ ___ // / __| | | | '__| |_ / _` |/ __/ _ \ @@ -144,13 +154,6 @@ struct controller_child { // struct surface : public wayland_proxy<struct ivi_controller_surface>, controller_child { - struct rect dst_rect; - struct rect src_rect; - struct size size; - int32_t orientation; - int32_t visibility; - float opacity; - surface(surface const &) = delete; surface &operator=(surface const &) = delete; surface(uint32_t i, struct controller *c); @@ -177,13 +180,6 @@ struct surface : public wayland_proxy<struct ivi_controller_surface>, // |___/ struct layer : public wayland_proxy<struct ivi_controller_layer>, controller_child { - struct rect dst_rect; - struct rect src_rect; - struct size size; - int32_t orientation; - int32_t visibility; - float opacity; - layer(layer const &) = delete; layer &operator=(layer const &) = delete; layer(uint32_t i, struct controller *c); @@ -236,6 +232,8 @@ struct controller : public wayland_proxy<struct ivi_controller> { 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 @@ -251,14 +249,15 @@ struct controller : public wayland_proxy<struct ivi_controller> { layer_map_type layers; screen_map_type screens; + props_map sprops; + props_map lprops; + typedef std::pair<char const *, std::function<void(struct controller *)>> name_task_pair; std::vector<name_task_pair> pending; size output_size; - void debug_dump_current_status(); - void add_proxy_to_id_mapping(struct ivi_controller_surface *p, uint32_t id); void remove_proxy_to_id_mapping(struct ivi_controller_surface *p); void add_proxy_to_id_mapping(struct ivi_controller_layer *p, uint32_t id); |