scripts: wm-request uses afb-client-demo
[staging/windowmanager.git] / src / layers.hpp
index a33f24a..ee32054 100644 (file)
@@ -18,6 +18,8 @@
 #define TMCAGLWM_LAYERS_H
 
 #include <json.hpp>
+
+#include <regex>
 #include <set>
 #include <string>
 
 
 namespace wm {
 
+struct split_layout {
+   std::string name;
+   std::string main_match;
+   std::string sub_match;
+   int prio;  // no entirely sure we will use this
+};
+
 struct layer {
    using json = nlohmann::json;
 
@@ -47,6 +56,7 @@ struct layer {
    // put on this layer.
    std::string role;
    // XXX perhaps a zorder is needed here?
+   std::vector<struct split_layout> layouts;
 
    explicit layer(nlohmann::json const &j);
 
@@ -60,10 +70,10 @@ struct layer {
 struct layer_map {
    using json = nlohmann::json;
 
-   typedef std::set<struct layer> storage_type;
-   typedef std::vector<unsigned int> layers_type;
-   typedef std::vector<std::pair<std::string, int>> role_to_layer_map;
-   typedef std::map<unsigned, unsigned> addsurf_layer_map;
+   using storage_type = std::set<struct layer>;
+   using layers_type = std::vector<uint32_t>;
+   using role_to_layer_map = std::vector<std::pair<std::string, int>>;
+   using addsurf_layer_map = std::map<int, int>;
 
    // XXX: we also will need a layer_id to layer map, perhaps
    // make this the primary map, and the surface_id->layer a
@@ -90,7 +100,7 @@ struct layer_map {
       return this->layers.size();
    }
 
-   void add_surface(unsigned surface_id, unsigned layer_id) {
+   void add_surface(int surface_id, int layer_id) {
       this->surfaces[surface_id] = layer_id;
    }