Add stop_timer and revert the function name
[apps/agl-service-windowmanager.git] / src / applist.hpp
index 55355ef..f91e7c8 100644 (file)
@@ -33,19 +33,32 @@ typedef enum Task{
     TASK_RELEASE
 }ResourceTask;
 
-struct WMRequest{
+struct WMTrigger {
+    std::string appid;
+    std::string role;
+    std::string area;
+    Task task;
+};
+
+struct WMAction
+{
+    std::string appid;
+    std::string role;
+    std::string area;
+    bool end_draw_finished;
+};
+
+struct WMRequest
+{
+    WMRequest();
     explicit WMRequest(std::string appid, std::string role,
         std::string area, ResourceTask task);
     virtual ~WMRequest();
     WMRequest(const WMRequest &obj);
 
-    std::string appid;
-    std::string role;
-    std::string area;
-    Task task;
     unsigned seq_num;
-    bool allocating;
-    bool end_draw_finished;
+    struct WMTrigger trigger;
+    std::vector<struct WMAction> sync_draw_req;
 };
 
 class  AppList {
@@ -58,6 +71,7 @@ public:
     void addClient(const std::string &appid, const std::string &role);
     void removeClient(const std::string &appid);
     bool contains(const std::string &appid);
+    int  countClient();
     std::shared_ptr<WMClient> lookUpClient(const std::string &appid);
 
     // Request Interface
@@ -67,29 +81,24 @@ public:
     /* TODO: consider, which is better WMClient or std::string appid?
     if appid is key to manage resources, it is better to select std::string
     otherwise WMClient is better, IMO */
-    bool requestFinished();
-    unsigned lookUpAllocatingApp(const std::string &appid);
-    void setEndDrawFinished(unsigned request_seq, const std::string &role);
-    bool endDrawFullfilled(unsigned request_seq);
-    void removeRequest(unsigned request_seq);
-    void setCurrentSequence(unsigned request_seq);
-    bool haveRequest();
-    /* void revertRequestingState();
-    void removeAllRequesting(); */
+    bool     requestFinished();
+    bool     setAction(unsigned request_seq, const std::string &appid, const std::string &role, const std::string &area);
+    bool     setEndDrawFinished(unsigned request_seq, const std::string &appid, const std::string &role);
+    bool     endDrawFullfilled(unsigned request_seq);
+    void     removeRequest(unsigned request_seq);
+    void     next();
+    bool     haveRequest();
 
-    //void revertRequestingState();//???
+    struct WMTrigger getRequest(unsigned request_seq);
+    const std::vector<struct WMAction>& getActions(unsigned request_seq);
 
-    /* bool queue(int request_num);
-    bool pushTop(int request_num);
-    bool dequeue();
-    void deleteAllElement();
-    void removeElement(int request_num);
-    bool hasElement(int request_num); */
+    void    client_dump();
+    void    req_dump();
 
 private:
-    std::vector<WMRequest> req_list;
-    std::unordered_map<std::string, std::shared_ptr<WMClient>> client_list;
-    unsigned current_seq;
+  std::vector<WMRequest> req_list;
+  std::unordered_map<std::string, std::shared_ptr<WMClient>> client_list;
+  unsigned current_seq;
 };
 
 }