+struct layer
+{
+ using json = nlohmann::json;
+
+ // A more or less descriptive name?
+ std::string name = "";
+ // The actual layer ID
+ int layer_id = -1;
+ // The rectangular region surfaces are allowed to draw on
+ // this layer, note however, width and hieght of the rect
+ // can be negative, in which case they specify that
+ // the actual value is computed using MAX + 1 - w
+ // That is; allow us to specify dimensions dependent on
+ // e.g. screen dimension, w/o knowing the actual screen size.
+ compositor::rect rect;
+ // Specify a role prefix for surfaces that should be
+ // put on this layer.
+ std::string role;
+ // TODO: perhaps a zorder is needed here?
+ std::vector<struct split_layout> layouts;
+
+ mutable struct LayoutState state;
+
+ // Flag of normal layout only
+ bool is_normal_layout_only;
+
+ explicit layer(nlohmann::json const &j);
+
+ 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;