diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-08-08 18:32:27 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-08-08 18:32:27 +0900 |
commit | 5c74a62af029d1138416a76a6d44d1711ce97ff6 (patch) | |
tree | 02285c1673294c5eb9b0af7b6195e0144c42efa0 | |
parent | 25e4aae46a08a2a58a8d05702e11451fec235f7d (diff) |
Add new classsandbox/knimitz/layer
Change-Id: I6bebfb030879b1bb2c7521bcd1d23d18d8174b36
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r-- | src/layers.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/layers.hpp b/src/layers.hpp index adfd733..c384895 100644 --- a/src/layers.hpp +++ b/src/layers.hpp @@ -65,6 +65,54 @@ struct layer json to_json() const; }; +/* + * WMLayer is the logical container of application/system application(such like HomeScreen) + * This is handled by Window Manager to classify the application. + */ +class WMLayer +{ + public: + enum MANAGEMENT_TYPE + { + TILE, + STACK + }; + + explicit WMLayer(const std::string& name, MANAGEMENT_TYPE type, unsigned begin, unsigned end); + virtual ~WMLayer(); + + const std::string& layerName(); + MANAGEMENT_TYPE layerType(); + void appendRole(const std::string& name); + void appendArea(const std::string& area); + +/* unsigned getNewID(const std::string& role); + void remove(unsigned ivi_layer_id); + void clear(); + bool attach(unsigned ivi_layer_id, const std::string& area); + void stack(unsigned ivi_layer_id, const std::string& area); + bool updateRenderOrder(const std::vector<unsigned> list); */ + + private: + std::string _name = ""; // Layer name + MANAGEMENT_TYPE _type; + std::vector<std::string> _roles; + unsigned _id_begin; + unsigned _id_end; + // current holding apps. This dynamically changes. + std::vector<unsigned> _ivi_layer_id_list; + // std::map<std::string, unsigned> _render_order; +}; + +class LayerManager +{ + public: + void setRenderOrder(const std::vector<unsigned> layer_render_order); + std::vector<unsigned> getAllRenderOrder(); + std::vector<std::shared_ptr<WMLayer>>& getAllLayers(); + std::vector<unsigned> getRenderOrder(const std::string& layer_name); +}; + struct layer_map { using json = nlohmann::json; |