Bug Fix : set source rectangle x, y is not 0
[apps/agl-service-windowmanager.git] / src / applist.hpp
index 0f2285b..b4ac9e0 100644 (file)
@@ -20,9 +20,9 @@
 #include <string>
 #include <map>
 #include <memory>
-#include "wm-client.hpp"
+#include "wm_client.hpp"
 #include "request.hpp"
-#include "wm-error.h"
+#include "wm_error.hpp"
 
 namespace wm
 {
@@ -30,12 +30,18 @@ namespace wm
 /* using std::experimental::nullopt;
 using std::experimental::optional; */
 
+struct FloatingSurface
+{
+    unsigned surface_id;
+    unsigned pid;
+};
+
 class AppList
 {
   public:
     AppList();
-    virtual ~AppList();
-    AppList(const AppList &obj) = delete;
+    virtual ~AppList() = default;
+    AppList(const AppList &obj);
 
     // Client Database Interface
     void addClient(const std::string &appid, const std::string &role);
@@ -45,6 +51,14 @@ class AppList
     int  countClient() const;
     std::shared_ptr<WMClient> lookUpClient(const std::string &appid);
     void removeSurface(unsigned surface);
+    WMError appendRole(const std::string &appid, const std::string &role, unsigned surface);
+
+    // Floating surface & client control
+    void addFloatingClient(const std::string &appid, unsigned layer, const std::string &role);
+    void addFloatingSurface(unsigned surface, unsigned pid);
+    WMError popFloatingSurface(unsigned pid, unsigned *surface);
+    WMError popFloatingSurface(const std::string &appid, unsigned *surface);
+    void removeFloatingSurface(unsigned surface);
 
     // Request Interface
     unsigned currentRequestNumber() const;
@@ -61,16 +75,20 @@ class AppList
     void next();
     bool haveRequest() const;
 
-    struct WMTrigger getRequest(unsigned req_num);
-    const std::vector<struct WMAction> &getActions(unsigned req_num);
+    struct WMTrigger getRequest(unsigned req_num, bool* found);
+    const std::vector<struct WMAction> &getActions(unsigned req_num, bool* found);
 
     void clientDump();
     void reqDump();
+    void dumpFloatingSurfaces();
 
   private:
     std::vector<WMRequest> req_list;
     std::unordered_map<std::string, std::shared_ptr<WMClient>> app2client;
     unsigned current_req;
+
+    std::vector<struct FloatingSurface> floating_surfaces;
+    //std::vector<FloatingSurface> floating_clients;
 };
 
 } // namespace wm