X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapplist.cpp;h=e27bd0393226bced4a81c87439cc7e8428b7c79a;hb=1b1051702003391f958f4bf68c5dfe88676d56d4;hp=0267eb78f459e3004c898d9459e9fc7562dcb778;hpb=58da0c77b98af1b771e4af28b42d0a3ddec09877;p=apps%2Fagl-service-windowmanager.git diff --git a/src/applist.cpp b/src/applist.cpp index 0267eb7..e27bd03 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -73,6 +73,14 @@ void AppList::addClient(const string &appid, unsigned layer, unsigned surface, c this->clientDump(); } +void AppList::addClient(const string &appid, unsigned layer, const string &role) +{ + std::lock_guard lock(this->mtx); + shared_ptr client = std::make_shared(appid, layer, role); + this->app2client[appid] = client; + this->clientDump(); +} + /** * Remove WMClient from the list * @@ -82,7 +90,7 @@ void AppList::removeClient(const string &appid) { std::lock_guard lock(this->mtx); this->app2client.erase(appid); - HMI_INFO("wm", "Remove client %s", appid.c_str()); + HMI_INFO("Remove client %s", appid.c_str()); } /** @@ -111,7 +119,7 @@ void AppList::removeSurface(unsigned surface){ { 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; } @@ -189,7 +197,7 @@ WMError AppList::popFloatingSurface(unsigned pid, unsigned *surface) }); 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; @@ -199,7 +207,7 @@ WMError AppList::popFloatingSurface(unsigned pid, unsigned *surface) 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; } @@ -223,21 +231,20 @@ void AppList::removeFloatingSurface(unsigned surface) 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; } @@ -421,7 +428,7 @@ WMError AppList::setAction(unsigned req_num, const struct WMAction &action) * 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 client, const string &role, const string &area, TaskVisible visible) { std::lock_guard lock(this->mtx); WMError result = WMError::FAIL; @@ -433,7 +440,7 @@ WMError AppList::setAction(unsigned req_num, const string &appid, const string & } // 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; @@ -469,7 +476,7 @@ bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const st { 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; @@ -584,7 +591,7 @@ void AppList::reqDump() { 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",