diff options
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) |