X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwm_layer.hpp;h=4002c4b8415ebf6c39c736c75244c95c450c4aba;hb=a4584342e35332223e9fb16a346b2316a6507343;hp=6cfd9c24da7ec8085304ec930e532e8023a0c055;hpb=726a95bc8c63ddd1c968028b61068ba2c33b994e;p=apps%2Fagl-service-windowmanager.git diff --git a/src/wm_layer.hpp b/src/wm_layer.hpp index 6cfd9c2..4002c4b 100644 --- a/src/wm_layer.hpp +++ b/src/wm_layer.hpp @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef WM_LAYERS_H -#define WM_LAYERS_H +#ifndef WM_LAYER_HPP +#define WM_LAYER_HPP #include #include @@ -28,18 +28,26 @@ struct json_object; namespace wm { +class WMClient; class LayerState { public: LayerState(); ~LayerState() = default; + void attachIdToArea(const std::string& area, const WMClient&); + const std::unordered_map popCurrentState(); + const std::unordered_map getCurrentState(); + const std::vector getIviIdList(); + void addLayer(unsigned layer); + void removeLayer(unsigned layer); + void setArea(const std::string& app, const std::string& area); + private: - std::vector _ivi_layer_id_list; - std::unordered_map area2ivi_layer_id; - // std::map _render_order; + std::vector render_order; + std::unordered_map area2appid; }; -class LayerSetting +class WMLayer { public: enum MANAGEMENT_TYPE @@ -48,51 +56,40 @@ class LayerSetting STACK }; - explicit LayerSetting(const std::string& name, MANAGEMENT_TYPE type, unsigned begin, unsigned end); - ~LayerSetting() = default; + explicit WMLayer(json_object* j, unsigned uuid); + ~WMLayer() = default; - const std::string& layerName() { return this->name; } - MANAGEMENT_TYPE layerType() { return this->type; }; - void appendRole(const std::string& role); - void appendArea(const std::string& area); + // Status & Setting API + unsigned getNewLayerID(const std::string& role); unsigned idBegin() { return this->id_begin; } unsigned idEnd() { return this->id_end; } - unsigned getNewLayerID(const std::string& role); + unsigned getUuid() { return this->uuid; } + const std::string& layerName(); + MANAGEMENT_TYPE layerType() { return this->type; } + void appendArea(const std::string& area); void removeLayerID(unsigned id); + LayerState& getLayerState() { return tmp_state; } + WMError setLayerState(const LayerState& l); + bool hasLayerID(unsigned id); + bool hasRole(const std::string& role); -/* 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 list); */ + // Manipulation + void addLayer(unsigned layer); + WMError commitChange(); private: + LayerState tmp_state; + LayerState state; + unsigned uuid; std::string name = ""; // Layer name MANAGEMENT_TYPE type; - std::vector role_list; + std::string role_list; std::vector area_list; std::vector id_list; unsigned id_begin; unsigned id_end; }; -class WMLayer -{ - public: - WMLayer(); - WMLayer(json_object* j); - ~WMLayer() = default; - unsigned getNewLayerID(const std::string& role); - LayerState getLayerState() const { return before_state; } - WMError setLayerState(const LayerState& l); - bool checkIDBelongTo(unsigned id); - private: - LayerState before_state; - LayerState state; - std::unique_ptr setting; -}; - } // namespace wm -#endif // WM_LAYERS_H +#endif // WM_LAYER_HPP