From e05891ff9f7343a0c536215fc5b4ef8decfa6983 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Fri, 8 Jun 2018 18:24:04 +0900 Subject: Enable functions * lookUpFloatingSurface * appendRole Change-Id: I3153cb0bbb266401f7beb0c709e2e3b64af42199 Signed-off-by: Kazumasa Mitsunari --- src/applist.cpp | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'src/applist.cpp') diff --git a/src/applist.cpp b/src/applist.cpp index 9b06c84..64f5f64 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -25,6 +25,11 @@ using std::vector; namespace wm { +struct FloatingSurface{ + unsigned surface_id; + unsigned pid; +}; + AppList::AppList() : req_list(0), app2client(0), @@ -93,7 +98,40 @@ unsigned AppList::currentRequestNumber() const return this->current_req; } -// Is this function necessary ? +WMError AppList::lookUpFloatingSurface(unsigned pid, unsigned *surface) +{ + WMError ret = WMError::NO_ENTRY; + + for (auto itr = this->floating_surfaces.begin(); itr != this->floating_surfaces.end(); ++itr) + { + if(pid == itr->pid){ + *surface = itr->surface_id; + itr = this->floating_surfaces.erase(itr); + ret = WMError::SUCCESS; + HMI_DEBUG("wm", "Erase surface %d", *surface); + break; + } + } + return ret; +} + +WMError AppList::lookUpFloatingSurface(const std::string &appid, unsigned *surface) +{ + return WMError::SUCCESS; +} + +WMError AppList::appendRole(const std::string &id, const std::string &role, unsigned surface) +{ + WMError wm_err = WMError::NO_ENTRY; + if (this->contains(id)) + { + auto x = this->lookUpClient(id); + x->addSurface(role, surface); + wm_err = WMError::SUCCESS; + } + return wm_err; +} + unsigned AppList::getRequestNumber(const string &appid) const { for (const auto &x : this->req_list) -- cgit 1.2.3-korg