Code Review
/
apps
/
agl-service-windowmanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Migrate hmi-debug into util
[apps/agl-service-windowmanager.git]
/
src
/
layers.cpp
diff --git
a/src/layers.cpp
b/src/layers.cpp
index
c74f425
..
b79d2f6
100644
(file)
--- a/
src/layers.cpp
+++ b/
src/layers.cpp
@@
-20,7
+20,6
@@
#include "layers.hpp"
#include "json_helper.hpp"
#include "util.hpp"
#include "layers.hpp"
#include "json_helper.hpp"
#include "util.hpp"
-#include "hmi-debug.h"
namespace wm
{
namespace wm
{
@@
-33,7
+32,7
@@
layer::layer(nlohmann::json const &j)
this->name = j["name"];
this->layer_id = j["layer_id"];
this->name = j["name"];
this->layer_id = j["layer_id"];
- HMI_DEBUG("
wm", "
layer_id:%d name:%s", this->layer_id, this->name.c_str());
+ HMI_DEBUG("layer_id:%d name:%s", this->layer_id, this->name.c_str());
}
struct result<struct layer_map> to_layer_map(nlohmann::json const &j)
}
struct result<struct layer_map> to_layer_map(nlohmann::json const &j)
@@
-110,11
+109,11
@@
optional<int> layer_map::get_layer_id(std::string const &role)
auto re = std::regex(r.first);
if (std::regex_match(role, re))
{
auto re = std::regex(r.first);
if (std::regex_match(role, re))
{
- HMI_DEBUG("
wm", "
role %s matches layer %d", role.c_str(), r.second);
+ HMI_DEBUG("role %s matches layer %d", role.c_str(), r.second);
return optional<int>(r.second);
}
}
return optional<int>(r.second);
}
}
- HMI_DEBUG("
wm", "
role %s does NOT match any layer", role.c_str());
+ HMI_DEBUG("role %s does NOT match any layer", role.c_str());
return nullopt;
}
return nullopt;
}
@@
-170,7
+169,7
@@
void layer_map::setupArea(double scaling)
i.second.w = static_cast<int>(scaling * i.second.w + 0.5);
i.second.h = static_cast<int>(scaling * i.second.h + 0.5);
i.second.w = static_cast<int>(scaling * i.second.w + 0.5);
i.second.h = static_cast<int>(scaling * i.second.h + 0.5);
- HMI_DEBUG("
wm:lm", "
area:%s size(after) : x:%d y:%d w:%d h:%d",
+ HMI_DEBUG("area:%s size(after) : x:%d y:%d w:%d h:%d",
i.first.c_str(), i.second.x, i.second.y, i.second.w, i.second.h);
}
}
i.first.c_str(), i.second.x, i.second.y, i.second.w, i.second.h);
}
}
@@
-182,7
+181,7
@@
compositor::rect layer_map::getAreaSize(const std::string &area)
int layer_map::loadAreaDb()
{
int layer_map::loadAreaDb()
{
- HMI_DEBUG("
wm:lm", "
Call");
+ HMI_DEBUG("Call");
std::string file_name(get_file_path("areas.db"));
std::string file_name(get_file_path("areas.db"));
@@
-191,45
+190,45
@@
int layer_map::loadAreaDb()
int ret = jh::inputJsonFilie(file_name.c_str(), &json_obj);
if (0 > ret)
{
int ret = jh::inputJsonFilie(file_name.c_str(), &json_obj);
if (0 > ret)
{
- HMI_DEBUG("
wm:lm", "
Could not open area.db, so use default area information");
+ HMI_DEBUG("Could not open area.db, so use default area information");
json_obj = json_tokener_parse(kDefaultAreaDb);
}
json_obj = json_tokener_parse(kDefaultAreaDb);
}
- HMI_DEBUG("
wm:lm", "
json_obj dump:%s", json_object_get_string(json_obj));
+ HMI_DEBUG("json_obj dump:%s", json_object_get_string(json_obj));
// Perse areas
// Perse areas
- HMI_DEBUG("
wm:lm", "
Perse areas");
+ HMI_DEBUG("Perse areas");
json_object *json_cfg;
if (!json_object_object_get_ex(json_obj, "areas", &json_cfg))
{
json_object *json_cfg;
if (!json_object_object_get_ex(json_obj, "areas", &json_cfg))
{
- HMI_ERROR("
wm:lm", "
Parse Error!!");
+ HMI_ERROR("Parse Error!!");
return -1;
}
int len = json_object_array_length(json_cfg);
return -1;
}
int len = json_object_array_length(json_cfg);
- HMI_DEBUG("
wm:lm", "
json_cfg len:%d", len);
- HMI_DEBUG("
wm:lm", "
json_cfg dump:%s", json_object_get_string(json_cfg));
+ HMI_DEBUG("json_cfg len:%d", len);
+ HMI_DEBUG("json_cfg dump:%s", json_object_get_string(json_cfg));
const char *area;
for (int i = 0; i < len; i++)
{
json_object *json_tmp = json_object_array_get_idx(json_cfg, i);
const char *area;
for (int i = 0; i < len; i++)
{
json_object *json_tmp = json_object_array_get_idx(json_cfg, i);
- HMI_DEBUG("
wm:lm", "
> json_tmp dump:%s", json_object_get_string(json_tmp));
+ HMI_DEBUG("> json_tmp dump:%s", json_object_get_string(json_tmp));
area = jh::getStringFromJson(json_tmp, "name");
if (nullptr == area)
{
area = jh::getStringFromJson(json_tmp, "name");
if (nullptr == area)
{
- HMI_ERROR("
wm:lm", "
Parse Error!!");
+ HMI_ERROR("Parse Error!!");
return -1;
}
return -1;
}
- HMI_DEBUG("
wm:lm", "
> area:%s", area);
+ HMI_DEBUG("> area:%s", area);
json_object *json_rect;
if (!json_object_object_get_ex(json_tmp, "rect", &json_rect))
{
json_object *json_rect;
if (!json_object_object_get_ex(json_tmp, "rect", &json_rect))
{
- HMI_ERROR("
wm:lm", "
Parse Error!!");
+ HMI_ERROR("Parse Error!!");
return -1;
}
return -1;
}
- HMI_DEBUG("
wm:lm", "
> json_rect dump:%s", json_object_get_string(json_rect));
+ HMI_DEBUG("> json_rect dump:%s", json_object_get_string(json_rect));
compositor::rect area_size;
area_size.x = jh::getIntFromJson(json_rect, "x");
compositor::rect area_size;
area_size.x = jh::getIntFromJson(json_rect, "x");
@@
-244,7
+243,7
@@
int layer_map::loadAreaDb()
for (auto itr = this->area2size.begin();
itr != this->area2size.end(); ++itr)
{
for (auto itr = this->area2size.begin();
itr != this->area2size.end(); ++itr)
{
- HMI_DEBUG("
wm:lm", "
area:%s x:%d y:%d w:%d h:%d",
+ HMI_DEBUG("area:%s x:%d y:%d w:%d h:%d",
itr->first.c_str(), itr->second.x, itr->second.y,
itr->second.w, itr->second.h);
}
itr->first.c_str(), itr->second.x, itr->second.y,
itr->second.w, itr->second.h);
}