X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwm_layer.hpp;h=a6a359e091a6abe706c3d1274565d11f5a82e11e;hb=b77279919e694ff49dc8032840aff0f5be8b7967;hp=2a5f9bdc3449e0c3d030a368555d5fc565b2ae46;hpb=58561703d4053dfd454fe564b59215ce025c4a12;p=apps%2Fagl-service-windowmanager.git diff --git a/src/wm_layer.hpp b/src/wm_layer.hpp index 2a5f9bd..a6a359e 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 @@ -42,6 +42,9 @@ class LayerState 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; @@ -56,22 +59,37 @@ class WMLayer STACK }; - explicit WMLayer(json_object* j); + explicit WMLayer(json_object* j, unsigned uuid); ~WMLayer() = default; + + // Status & Setting API unsigned getNewLayerID(const std::string& role); unsigned idBegin() { return this->id_begin; } unsigned idEnd() { return this->id_end; } + 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 before_state; } + LayerState& getLayerState() { return tmp_state; } WMError setLayerState(const LayerState& l); bool hasLayerID(unsigned id); bool hasRole(const std::string& role); + + // Manipulation + void addLayerToState(unsigned layer); + void removeLayerFromState(unsigned layer); + void setAreaToState(const std::string& app, const std::string& area); + void terminateApp(unsigned layer); + void update(); + void undo(); + + // Debug + void dump(); + private: - LayerState before_state; + LayerState tmp_state; LayerState state; + unsigned uuid; std::string name = ""; // Layer name MANAGEMENT_TYPE type; std::string role_list; @@ -83,4 +101,4 @@ class WMLayer } // namespace wm -#endif // WM_LAYERS_H +#endif // WM_LAYER_HPP