From: Kazumasa Mitsunari Date: Fri, 14 Sep 2018 12:42:26 +0000 (+0900) Subject: Remove unnecessary functions X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=bb6647d071a188defa2a36b8aead23d48f7df85d;hp=419360d5e88e4036bc9f4fd6a5068052cf8b8703;p=apps%2Fagl-service-windowmanager.git Remove unnecessary functions Change-Id: Ia66c5358572a1a6ea03c6f1e713b187f60979e8c Signed-off-by: Kazumasa Mitsunari --- diff --git a/src/applist.cpp b/src/applist.cpp index 888ab71..1483ea0 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -225,6 +225,8 @@ WMError AppList::popFloatingSurface(unsigned pid, unsigned *surface) // =================== Floating(Temporary) surface/client API =================== +// TODO: After testing setRole, remove these API + WMError AppList::popFloatingSurface(const string &appid, unsigned *surface) { HMI_ERROR("This function is not implemented"); @@ -256,19 +258,6 @@ void AppList::removeFloatingSurface(unsigned surface) this->floating_surfaces.erase(fwd_itr, this->floating_surfaces.end()); } -WMError AppList::appendRole(const string &id, const string &role) -{ - WMError wm_err = WMError::NO_ENTRY; - if (this->contains(id)) - { - auto x = this->lookUpClient(id); - x->appendRole(role); - wm_err = WMError::SUCCESS; - } - return wm_err; -} - - // =================== Request Date container API =================== /** diff --git a/src/applist.hpp b/src/applist.hpp index c31e4a2..36e0524 100644 --- a/src/applist.hpp +++ b/src/applist.hpp @@ -57,9 +57,7 @@ class AppList int countClient() const; std::shared_ptr lookUpClient(const std::string &appid); void removeSurface(unsigned surface); - //std::string getAppID(unsigned surface, const std::string &role, bool *found) const; - std::string getAppID(unsigned surface, bool* found) const; - WMError appendRole(const std::string &appid, const std::string &role); + std::string getAppID(unsigned surface, bool* found) const; // TODO: remove // Floating surface diff --git a/src/wm_client.cpp b/src/wm_client.cpp index baed828..691c3cb 100644 --- a/src/wm_client.cpp +++ b/src/wm_client.cpp @@ -96,27 +96,6 @@ string WMClient::appID() const return this->id; } -unsigned WMClient::surfaceID(const string &role) const -{ - if (0 == this->role2surface.count(role)) - { - return INVALID_SURFACE_ID; - } - return this->role2surface.at(role); -} - -std::string WMClient::role(unsigned surface) const -{ - for(const auto& x : this->role2surface) - { - if(x.second == surface) - { - return x.first; - } - } - return std::string(""); -} - string WMClient::role() const { return this->main_role; @@ -132,41 +111,14 @@ unsigned WMClient::surfaceID() const return this->surface; } -void WMClient::setRole(const string& role) -{ - this->role_list.clear(); - this->role_list.push_back(role); -} - -void WMClient::appendRole(const string& role) -{ - this->role_list.push_back(role); -} - /** - * Add the pair of role and surface to the client + * Add surface to the client * - * This function set the pair of role and surface to the client. - * This function is used for the client which has multi surfaces. - * If the model and relationship for role and surface(layer) - * is changed, this function will be changed - * Current Window Manager doesn't use this function. + * This function add main surface to the client(ivi_layer). * * @param string[in] role - * @param unsigned[in] surface - * @return true + * @return WMError */ -/* bool WMClient::addSurface(const string &role, unsigned surface) -{ - HMI_DEBUG("Add role %s with surface %d", role.c_str(), surface); - if (0 != this->role2surface.count(role)) - { - HMI_NOTICE("override surfaceID %d with %d", this->role2surface[role], surface); - } - this->role2surface[role] = surface; - return true; -} */ - WMError WMClient::addSurface(unsigned surface) { this->surface = surface; @@ -185,28 +137,6 @@ bool WMClient::removeSurfaceIfExist(unsigned surface) if(surface == this->surface) { this->surface = INVALID_SURFACE_ID; - return true; - } - for (auto &x : this->role2surface) - { - if (surface == x.second) - { - HMI_INFO("Remove surface from client %s: role %s, surface: %d", - this->id.c_str(), x.first.c_str(), x.second); - this->role2surface.erase(x.first); - ret = true; - break; - } - } - return ret; -} - -bool WMClient::removeRole(const string &role) -{ - bool ret = false; - if (this->role2surface.count(role) != 0) - { - this->role2surface.erase(role); ret = true; } return ret; @@ -251,10 +181,7 @@ void WMClient::dumpInfo() { DUMP("APPID : %s", id.c_str()); DUMP(" LAYER : %d", layer); - for (const auto &x : this->role2surface) - { - DUMP(" ROLE : %s , SURFACE : %d", x.first.c_str(), x.second); - } + DUMP(" ROLE : %s , SURFACE : %d", main_role.c_str(), surface); } } // namespace wm \ No newline at end of file diff --git a/src/wm_client.hpp b/src/wm_client.hpp index 5342b76..40a0d1d 100644 --- a/src/wm_client.hpp +++ b/src/wm_client.hpp @@ -49,19 +49,15 @@ class WMClient ~WMClient() = default; std::string appID() const; - unsigned surfaceID(const std::string &role) const; + std::string role() const; unsigned layerID() const; unsigned surfaceID() const; - std::vector renderOrder() const; - std::string role(unsigned surface) const; - std::string role() const; - const std::vector &roles() const; - void setRole(const std::string& role); - void appendRole(const std::string& role); - //bool addSurface(const std::string& role, unsigned surface); + // void setRole(const std::string& role); + // void appendRole(const std::string& role); WMError addSurface(unsigned surface); bool removeSurfaceIfExist(unsigned surface); - bool removeRole(const std::string& role); + // bool removeRole(const std::string& role); + std::vector renderOrder() const; #if GTEST_ENABLED bool subscribe(afb_req req, const std::string &event_name); @@ -76,7 +72,7 @@ class WMClient std::string main_role; std::string area; unsigned surface; // currently, main application has only one surface. - std::vector role_list; + //std::vector role_list; std::vector surface_render_order; std::unordered_map service2surfaces; std::unordered_map role2surface;