X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwm_layer.hpp;h=c291151ff465b257bff0218d335b82ba94a190a0;hb=dd6bcaad18c8e61321b2881f08c3fd17f483a466;hp=001134a8f88c8b26d92ad285157f6d0098cf66cf;hpb=0b011c00b0c8aa847a4d0aa460a335c5eae8f010;p=apps%2Fagl-service-windowmanager.git diff --git a/src/wm_layer.hpp b/src/wm_layer.hpp index 001134a..c291151 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 @@ -38,13 +38,19 @@ class LayerState 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); + + // Debug + void dump(); private: std::vector render_order; std::unordered_map area2appid; }; -class LayerSetting +class WMLayer { public: enum MANAGEMENT_TYPE @@ -53,26 +59,36 @@ 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 setRoleList(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); - void removeLayerID(unsigned id); + unsigned getUuid() { return this->uuid; } + const std::string& layerName(); + MANAGEMENT_TYPE layerType() { return this->type; } + void appendArea(const std::string& area); + 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 addLayerToState(unsigned layer); + void removeLayerFromState(unsigned layer); + void setAreaToState(const std::string& app, const std::string& area); + void terminateApp(unsigned layer); + WMError commitChange(); + + // Debug + void dump(); private: + LayerState tmp_state; + LayerState state; + unsigned uuid; std::string name = ""; // Layer name MANAGEMENT_TYPE type; std::string role_list; @@ -82,22 +98,6 @@ class LayerSetting 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