X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapplist.hpp;h=6305a4bc96f6398ba1172fc4dcf5c48e3ef7a33a;hb=77b239e85360594820534afe5cb79c7d60721f40;hp=0f2285b5ba6fd6aad7e003b4935000f26ac5719c;hpb=5d5a780a405fdb71a85898d8d988f6ee1bf3b3e0;p=apps%2Fagl-service-windowmanager.git diff --git a/src/applist.hpp b/src/applist.hpp index 0f2285b..6305a4b 100644 --- a/src/applist.hpp +++ b/src/applist.hpp @@ -20,9 +20,10 @@ #include #include #include -#include "wm-client.hpp" +#include +#include "wm_client.hpp" #include "request.hpp" -#include "wm-error.h" +#include "wm_error.hpp" namespace wm { @@ -38,21 +39,21 @@ class AppList AppList(const AppList &obj) = delete; // Client Database Interface - void addClient(const std::string &appid, const std::string &role); + /* TODO: consider, which is better WMClient as parameter or not + 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); 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; // Request Interface unsigned currentRequestNumber() const; unsigned getRequestNumber(const std::string &appid) const; unsigned addAllocateRequest(WMRequest req); - /* 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 */ WMError setAction(unsigned req_num, const struct WMAction &action); WMError setAction(unsigned req_num, const std::string &appid, const std::string &role, const std::string &area, bool visible = true); bool setEndDrawFinished(unsigned req_num, const std::string &appid, const std::string &role); @@ -61,8 +62,8 @@ class AppList void next(); bool haveRequest() const; - struct WMTrigger getRequest(unsigned req_num); - const std::vector &getActions(unsigned req_num); + struct WMTrigger getRequest(unsigned req_num, bool* found); + const std::vector &getActions(unsigned req_num, bool* found); void clientDump(); void reqDump(); @@ -71,6 +72,7 @@ class AppList std::vector req_list; std::unordered_map> app2client; unsigned current_req; + std::mutex mtx; }; } // namespace wm