X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapplist.hpp;h=1bc27c6c4abe200bffa3af121c1929155264b4e5;hb=c4798401800dd1f325aca5333e1d3eebdda0abe3;hp=a794b532c8072cab37f1aedcafd93fa6b9987b5d;hpb=847dde9621cef9b9a44eda95c63c0fe3f528468d;p=apps%2Fagl-service-windowmanager.git diff --git a/src/applist.hpp b/src/applist.hpp index a794b53..1bc27c6 100644 --- a/src/applist.hpp +++ b/src/applist.hpp @@ -31,6 +31,13 @@ namespace wm /* using std::experimental::nullopt; using std::experimental::optional; */ +struct FloatingSurface +{ + std::string appid; + unsigned surface_id; + unsigned pid; +}; + class AppList { public: @@ -43,20 +50,30 @@ class AppList If the WMClient should be more flexible, I think this param should be WMClient class */ void addClient(const std::string &appid, unsigned layer, - unsigned surface,const std::string &role); + unsigned surface, const std::string &role); + void addClient(const std::string &appid, unsigned layer, + const std::string& layer_name, unsigned surface, const std::string &role); void removeClient(const std::string &appid); bool contains(const std::string &appid) const; int countClient() const; std::shared_ptr lookUpClient(const std::string &appid); void removeSurface(unsigned surface); std::string getAppID(unsigned surface, const std::string &role, bool *found) const; + WMError appendRole(const std::string &appid, const std::string &role); + + // Floating surface + void addFloatingClient(const std::string &appid, unsigned layer, const std::string &role); + void addFloatingSurface(const std::string &appid, 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; unsigned getRequestNumber(const std::string &appid) const; unsigned addRequest(WMRequest req); WMError setAction(unsigned req_num, const struct WMAction &action); - WMError setAction(unsigned req_num, const std::string &appid, + WMError setAction(unsigned req_num, std::shared_ptr client, const std::string &role, const std::string &area, TaskVisible visible); bool setEndDrawFinished(unsigned req_num, const std::string &appid, const std::string &role); bool endDrawFullfilled(unsigned req_num); @@ -69,12 +86,14 @@ class AppList void clientDump(); void reqDump(); + void dumpFloatingSurfaces(); private: std::vector req_list; std::unordered_map> app2client; unsigned current_req; std::mutex mtx; + std::vector floating_surfaces; }; } // namespace wm