diff options
author | 2018-06-08 18:24:04 +0900 | |
---|---|---|
committer | 2018-06-08 18:24:04 +0900 | |
commit | e05891ff9f7343a0c536215fc5b4ef8decfa6983 (patch) | |
tree | 4465640b4cd94a2e6ad8e9a07474bc8c722dbc1d /src/applist.cpp | |
parent | be2a72a0759f50e0f76b45382772ed039a60e44f (diff) |
Enable functions
* lookUpFloatingSurface
* appendRole
Change-Id: I3153cb0bbb266401f7beb0c709e2e3b64af42199
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/applist.cpp')
-rw-r--r-- | src/applist.cpp | 40 |
1 files changed, 39 insertions, 1 deletions
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) |