{
}
-AppList::~AppList() {}
-
void AppList::addClient(const string &appid, const string &role)
{
shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, role);
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)
return req.req_num; // return 1; if you test time_expire
}
-bool AppList::requestFinished() const
-{
- return this->req_list.empty();
-}
-
struct WMTrigger AppList::getRequest(unsigned req_num)
{
for (const auto &x : this->req_list)
}
}
-bool AppList::setAction(unsigned req_num, const struct WMAction &action)
+WMError AppList::setAction(unsigned req_num, const struct WMAction &action)
{
- bool result = false;
+ WMError result = WMError::FAIL;
for (auto &x : this->req_list)
{
if (req_num != x.req_num)
continue;
}
x.sync_draw_req.push_back(action);
- result = true;
+ result = WMError::SUCCESS;
break;
}
* 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.
*/
-bool AppList::setAction(unsigned req_num, const string &appid, const string &role, const string &area, bool visible)
+WMError AppList::setAction(unsigned req_num, const string &appid, const string &role, const string &area, bool visible)
{
- bool result = false;
+ WMError result = WMError::NOT_REGISTERED;
for (auto &x : req_list)
{
if (req_num != x.req_num)
WMAction action{appid, role, area, visible, edraw_f};
x.sync_draw_req.push_back(action);
- result = true;
+ result = WMError::SUCCESS;
break;
}
return result;