Clean: Remove split_layout structure
[apps/agl-service-windowmanager.git] / src / layers.hpp
index e4160a5..3a16985 100644 (file)
 namespace wm
 {
 
-struct split_layout
-{
-    std::string name;
-    std::string main_match;
-    std::string sub_match;
-};
-
 struct layer
 {
     using json = nlohmann::json;
@@ -43,23 +36,14 @@ struct layer
     // 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.
+    // this layer.
     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;
@@ -114,6 +98,14 @@ struct layer_map
     }
 
     json to_json() const;
+    void setupArea(double scaling);
+    compositor::rect getAreaSize(const std::string &area);
+    int loadAreaDb();
+
+  private:
+    std::unordered_map<std::string, compositor::rect> area2size;
+
+    static const char *kDefaultAreaDb;
 };
 
 struct result<struct layer_map> to_layer_map(nlohmann::json const &j);