aboutsummaryrefslogtreecommitdiffstats
path: root/src/wm_layer_control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm_layer_control.cpp')
-rw-r--r--src/wm_layer_control.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/wm_layer_control.cpp b/src/wm_layer_control.cpp
index a14c334..b15ebbb 100644
--- a/src/wm_layer_control.cpp
+++ b/src/wm_layer_control.cpp
@@ -118,6 +118,34 @@ void LayerControl::undoUpdate() {}
WMError LayerControl::loadLayerSetting(const string &path)
{
+ HMI_DEBUG("loading WMLayer(Application Containers) Setting from %s", path);
+
+ json_object *json_obj, *json_cfg;
+ int ret = jh::inputJsonFilie(path.c_str(), &json_obj);
+ if (0 > ret)
+ {
+ HMI_DEBUG("Could not open %s, so use default area information", path.c_str());
+ return WMError::FAIL;
+ }
+ HMI_INFO("json_obj dump:%s", json_object_get_string(json_obj));
+
+ if (!json_object_object_get_ex(json_obj, "mappings", &json_cfg))
+ {
+ HMI_ERROR("Parse Error!!");
+ return WMError::FAIL;
+ }
+
+ int len = json_object_array_length(json_cfg);
+ HMI_DEBUG("json_cfg len:%d", len);
+
+ for (int i = 0; i < len; i++)
+ {
+ json_object *json_tmp = json_object_array_get_idx(json_cfg, i);
+ HMI_DEBUG("> json_tmp dump:%s", json_object_get_string(json_tmp));
+
+ this->wm_layers.emplace_back(std::make_shared<WMLayer>(json_tmp));
+ }
+
return WMError::SUCCESS;
}
@@ -128,7 +156,7 @@ WMError LayerControl::loadAreaDb(const std::string& path)
int ret = jh::inputJsonFilie(path.c_str(), &json_obj);
if (0 > ret)
{
- HMI_DEBUG("Could not open area.db, so use default area information");
+ HMI_DEBUG("Could not open %s, so use default area information", path.c_str());
return WMError::FAIL;
}
HMI_INFO("json_obj dump:%s", json_object_get_string(json_obj));
@@ -143,7 +171,6 @@ WMError LayerControl::loadAreaDb(const std::string& path)
int len = json_object_array_length(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++)