#include "json_helper.hpp"
#include "layers.hpp"
#include "util.hpp"
+#include "hmi-debug.h"
namespace wm {
jr["width"], jr["height"], jr["x"], jr["y"],
};
}
+
+ // Init flag of normal layout only
+ this->is_normal_layout_only = true;
+
auto split_layouts = j.find("split_layouts");
if (split_layouts != j.end()) {
+
+ // Clear flag of normal layout only
+ this->is_normal_layout_only = false;
+
auto &sls = j["split_layouts"];
// this->layouts.reserve(sls.size());
std::transform(std::cbegin(sls), std::cend(sls),
std::back_inserter(this->layouts), [this](json const &sl) {
struct split_layout l {
sl["name"], sl["main_match"], sl["sub_match"] };
- logdebug(
+ HMI_DEBUG("wm",
"layer %d add split_layout \"%s\" (main: \"%s\") (sub: "
"\"%s\")", this->layer_id,
l.name.c_str(), l.main_match.c_str(),
return l;
});
}
+ HMI_DEBUG("wm", "layer_id:%d is_normal_layout_only:%d\n",
+ this->layer_id, this->is_normal_layout_only);
}
struct result<struct layer_map> to_layer_map(nlohmann::json const &j) {
for (auto const &r : this->roles) {
auto re = std::regex(r.first);
if (std::regex_match(role, re)) {
- logdebug("role %s matches layer %d", role.c_str(), r.second);
+ HMI_DEBUG("wm", "role %s matches layer %d", role.c_str(), r.second);
return optional<int>(r.second);
}
}
- logdebug("role %s does NOT match any layer", role.c_str());
+ HMI_DEBUG("wm", "role %s does NOT match any layer", role.c_str());
return nullopt;
}