#include <string>
#include <unordered_map>
-extern "C" {
+extern "C"
+{
#define AFB_BINDING_VERSION 2
#include <afb/afb-binding.h>
}
-namespace wm {
+namespace wm
+{
-class WMClient {
-public:
+class WMClient
+{
+ public:
WMClient();
WMClient(const std::string &appid, unsigned layerID, unsigned surfaceID, const std::string &role);
WMClient(const std::string &appid, const std::string &role);
virtual ~WMClient();
- //WMClient::WMClient(const WMClient &obj);
- /* const std::vector<optional<unsigned>> surfaceIDList();
- optional<unsigned> surfaceID(role); */
+
+ std::string appID();
+ void registerLayer(unsigned layerID);
+ bool addSurface(const std::string& role, unsigned surface);
+ bool removeSurfaceIfExist(unsigned surfaceID);
+ bool removeRole(const std::string& role);
+
+ void dumpInfo();
private:
unsigned layer;
- std::vector<unsigned> surfaces;
std::string id;
- std::vector<std::string> roles;
+ std::unordered_map<std::string, unsigned> role2surface;
+#if GTEST_ENABLED
+ // This is for unit test. afb_make_event occurs sig11 if call not in afb-binding
+ std::unordered_map<std::string, std::string> event_list;
+#else
std::unordered_map<std::string, struct afb_event> event_list;
- //std::vector<Task *> requestingTask;
+#endif
};
-}
+} // namespace wm
#endif
\ No newline at end of file