{
lm_setting_path += "/etc/layers_setting.json";
}
- this->lm = std::make_shared<LayoutManager>(lm_setting_path);
+ this->lm = std::make_shared<LayerControl>(lm_setting_path);
/* try
{
const char *role = this->convertRoleOldToNew(drawing_name);
auto lid = this->layers.get_layer_id(string(role));
- if (!lid)
+ unsigned l_id = this->lm->getNewLayerID(role);
+ if (l_id != 0)
{
/**
* register drawing_name as fallback and make it displayed.
*/
lid = this->layers.get_layer_id(string("fallback"));
+ l_id = this->lm->getNewLayerID("fallback");
HMI_DEBUG("wm", "%s is not registered in layers.json, then fallback as normal app", role);
if (!lid)
{
}
}
- auto rname = this->lookup_id(role);
- if (!rname)
- {
+ // generate surface ID for ivi-shell application
+
+ // auto rname = this->lookup_id(role);
+ // if (!rname)
+ // {
// name does not exist yet, allocate surface id...
auto id = int(this->id_alloc.generate_id(role));
- this->layers.add_surface(id, *lid);
+ // this->layers.add_surface(id, *lid);
// set the main_surface[_name] here and now
- if (!this->layers.main_surface_name.empty() &&
- this->layers.main_surface_name == drawing_name)
- {
- this->layers.main_surface = id;
- HMI_DEBUG("wm", "Set main_surface id to %u", id);
- }
+ // if (!this->layers.main_surface_name.empty() &&
+ // this->layers.main_surface_name == drawing_name)
+ // {
+ // this->layers.main_surface = id;
+ // HMI_DEBUG("wm", "Set main_surface id to %u", id);
+ // }
// add client into the db
string appid_str(appid);
- g_app_list.addClient(appid_str, *lid, id, string(role));
+ if(g_app_list.contains(appid_str))
+ {
+ // add surface into app
+ auto client = g_app_list.lookUpClient(appid_str);
+ // client.addSurface(id);
+ }
+ else
+ {
+ g_app_list.addClient(appid_str, l_id, id, string(role));
+ }
// Set role map of (new, old)
this->rolenew2old[role] = string(drawing_name);
return Ok<int>(id);
- }
+ // }
// Check currently registered drawing names if it is already there.
return Err<int>("Surface already present");
#include "hmi-debug.h"
#include "request.hpp"
#include "wm_error.hpp"
-#include "layout_manager.hpp"
+#include "wm_layer_control.hpp"
struct json_object;
std::unordered_map<std::string, struct compositor::rect> area2size;
std::unordered_map<std::string, std::string> roleold2new;
std::unordered_map<std::string, std::string> rolenew2old;
- std::shared_ptr<LayoutManager> lm;
+ std::shared_ptr<LayerControl> lm;
PMWrapper pmw;
static const char* kDefaultOldRoleDb;
\r
#include <assert.h>\r
#include "layers.hpp"\r
-#include "layout_manager.hpp"\r
+#include "wm_layer_control.hpp"\r
\r
using std::string;\r
\r
namespace wm {\r
\r
-LayoutManager::LayoutManager(const string& path) : wm_layers()\r
+LayerControl::LayerControl(const string& path) : wm_layers()\r
{\r
WMError ret = this->load(path);\r
assert(ret == WMError::SUCCESS);\r
}\r
\r
-LayoutManager::~LayoutManager()\r
+LayerControl::~LayerControl()\r
{}\r
\r
-unsigned LayoutManager::getNewLayerID(const string& role)\r
+unsigned LayerControl::getNewLayerID(const string& role)\r
{\r
unsigned ret = 0;\r
for(const auto& l: this->wm_layers)\r
return ret;\r
}\r
\r
-WMError LayoutManager::updateLayer(WMLayer& wm_layer)\r
+WMError LayerControl::updateLayer(WMLayer& wm_layer)\r
{\r
return WMError::SUCCESS;\r
}\r
\r
-void LayoutManager::commitChange() {}\r
+void LayerControl::commitChange() {}\r
\r
-void LayoutManager::undoUpdate() {}\r
+void LayerControl::undoUpdate() {}\r
\r
-WMError LayoutManager::load(const string &path)\r
+WMError LayerControl::load(const string &path)\r
{\r
return WMError::SUCCESS;\r
}\r