/*
- * Copyright (C) 2017 Mentor Graphics Development (Deutschland) GmbH
+ * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "json_helper.hpp"
#include "layers.hpp"
#include "util.hpp"
+#include "hmi-debug.h"
namespace wm {
this->role = j["role"];
this->name = j["name"];
this->layer_id = j["layer_id"];
- this->rect = genivi::full_rect;
+ this->rect = compositor::full_rect;
if (j["area"]["type"] == "rect") {
auto jr = j["area"]["rect"];
- this->rect = genivi::rect{
+ this->rect = compositor::rect{
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;
}
json layer::to_json() const {
- auto is_full = this->rect == genivi::full_rect;
+ auto is_full = this->rect == compositor::full_rect;
json r{};
if (is_full) {