this->clientDump();
}
+void AppList::addClient(const string &appid, unsigned layer, const string &role)
+{
+ std::lock_guard<std::mutex> lock(this->mtx);
+ shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, layer, role);
+ this->app2client[appid] = client;
+ this->clientDump();
+}
+
/**
* Remove WMClient from the list
*
{
std::lock_guard<std::mutex> lock(this->mtx);
this->app2client.erase(appid);
- HMI_INFO("wm", "Remove client %s", appid.c_str());
+ HMI_INFO("Remove client %s", appid.c_str());
}
/**
{
ret = x.second->removeSurfaceIfExist(surface);
if(ret){
- HMI_DEBUG("wm", "remove surface %d from Client %s finish",
+ HMI_DEBUG("remove surface %d from Client %s finish",
surface, x.second->appID().c_str());
break;
}
});
if (fwd_itr != this->floating_surfaces.cend())
{
- HMI_INFO("wm", "pop floating surface: %d", *surface);
+ HMI_INFO("pop floating surface: %d", *surface);
}
this->floating_surfaces.erase(fwd_itr, this->floating_surfaces.end());
return ret;
WMError AppList::popFloatingSurface(const string &appid, unsigned *surface)
{
- HMI_ERROR("wm", "This function is not implemented");
+ HMI_ERROR("This function is not implemented");
return WMError::SUCCESS;
}
return x.surface_id == surface;
});
if(fwd_itr != this->floating_surfaces.cend()){
- HMI_INFO("wm", "remove floating surface: %d", surface);
+ HMI_INFO("remove floating surface: %d", surface);
}
this->floating_surfaces.erase(fwd_itr, this->floating_surfaces.end());
}
-WMError AppList::appendRole(const string &id, const string &role, unsigned surface)
+WMError AppList::appendRole(const string &id, const string &role)
{
WMError wm_err = WMError::NO_ENTRY;
- HMI_ERROR("wm", "This function is disabled");
- /* if (this->contains(id))
+ if (this->contains(id))
{
auto x = this->lookUpClient(id);
- x->addSurface(role, surface);
+ x->appendRole(role);
wm_err = WMError::SUCCESS;
- } */
+ }
return wm_err;
}
* otherwise (visible is false) app should be invisible. Then enddraw_finished param is set to true.
* This function doesn't support actions for focus yet.
*/
-WMError AppList::setAction(unsigned req_num, const string &appid, const string &role, const string &area, TaskVisible visible)
+WMError AppList::setAction(unsigned req_num, shared_ptr<WMClient> client, const string &role, const string &area, TaskVisible visible)
{
std::lock_guard<std::mutex> lock(this->mtx);
WMError result = WMError::FAIL;
}
// If visible task is not invisible, redraw is required -> true
bool edraw_f = (visible != TaskVisible::INVISIBLE) ? false : true;
- WMAction action{appid, role, area, visible, edraw_f};
+ WMAction action{req_num, client, role, area, visible, edraw_f};
x.sync_draw_req.push_back(action);
result = WMError::SUCCESS;
{
for (auto &y : x.sync_draw_req)
{
- if (y.appid == appid && y.role == role)
+ if (y.client->appID() == appid && y.role == role)
{
HMI_SEQ_INFO(req_num, "Role %s finish redraw", y.role.c_str());
y.end_draw_finished = true;
{
DUMP(
"Action : (APPID :%s, ROLE :%s, AREA :%s, VISIBLE : %s, END_DRAW_FINISHED: %d)",
- y.appid.c_str(),
+ y.client->appID().c_str(),
y.role.c_str(),
y.area.c_str(),
(y.visible == TaskVisible::INVISIBLE) ? "invisible" : "visible",