Improve window manager
[apps/agl-service-windowmanager-2017.git] / src / applist.cpp
index 44865f6..be5fe57 100644 (file)
@@ -169,24 +169,10 @@ int AppList::countClient() const
  * Returns AppID if found.
  *
  * @param     unsigned[in] surfaceID
- * @param     string[in]   role
  * @param     bool[in,out] AppID is found or not
  * @return    AppID
  * @attention If AppID is not found, param found will be false.
  */
-/* string AppList::getAppID(unsigned surface, const string& role, bool* found) const
-{
-    *found = false;
-    for (const auto &x : this->app2client)
-    {
-        if(x.second->surfaceID(role) == surface){
-            *found = true;
-            return x.second->appID();
-        }
-    }
-    return string("");
-} */
-
 string AppList::getAppID(unsigned surface, bool* found) const
 {
     *found = false;
@@ -200,64 +186,6 @@ string AppList::getAppID(unsigned surface, bool* found) const
     return string("");
 }
 
-WMError AppList::popFloatingSurface(unsigned pid, unsigned *surface)
-{
-    WMError ret = WMError::NO_ENTRY;
-
-    auto fwd_itr = std::remove_if(this->floating_surfaces.begin(), this->floating_surfaces.end(),
-                                    [pid, surface, &ret](FloatingSurface x) {
-                                        if(pid == x.pid){
-                                            *surface = x.surface_id;
-                                            ret = WMError::SUCCESS;
-                                            return true;
-                                        }
-                                        else{
-                                            return false;
-                                        }
-                                    });
-    if (fwd_itr != this->floating_surfaces.cend())
-    {
-        HMI_INFO("pop floating surface: %d", *surface);
-    }
-    this->floating_surfaces.erase(fwd_itr, this->floating_surfaces.end());
-    return ret;
-}
-
-// =================== 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");
-    return WMError::SUCCESS;
-}
-
-void AppList::addFloatingClient(const string &appid, unsigned layer, const string &role)
-{
-}
-
-void AppList::addFloatingSurface(const string &appid, unsigned surface, unsigned pid)
-{
-    struct FloatingSurface fsurface{appid, surface, pid};
-    this->floating_surfaces.push_back(fsurface);
-    this->dumpFloatingSurfaces();
-}
-
-void AppList::removeFloatingSurface(unsigned surface)
-{
-    this->dumpFloatingSurfaces();
-    auto fwd_itr = std::remove_if(
-        this->floating_surfaces.begin(), this->floating_surfaces.end(),
-        [surface](FloatingSurface x) {
-            return x.surface_id == surface;
-        });
-    if(fwd_itr != this->floating_surfaces.cend()){
-        HMI_INFO("remove floating surface: %d", surface);
-    }
-    this->floating_surfaces.erase(fwd_itr, this->floating_surfaces.end());
-}
-
 // =================== Request Date container API ===================
 
 /**
@@ -621,15 +549,4 @@ void AppList::reqDump()
     }
     DUMP("======= req dump end =====");
 }
-
-void AppList::dumpFloatingSurfaces()
-{
-    DUMP("======= floating surface dump =====");
-    for (const auto &x : this->floating_surfaces)
-    {
-        DUMP("surface : %d, pid : %d", x.surface_id, x.pid);
-    }
-    DUMP("======= floating surface dump end =====\n");
-}
-
 } // namespace wm