aboutsummaryrefslogtreecommitdiffstats
path: root/src/wm-client.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm-client.hpp')
-rw-r--r--src/wm-client.hpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/wm-client.hpp b/src/wm-client.hpp
new file mode 100644
index 0000000..33024b0
--- /dev/null
+++ b/src/wm-client.hpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WINDOWMANAGER_CLIENT_HPP
+#define WINDOWMANAGER_CLIENT_HPP
+
+#include <vector>
+#include <string>
+#include <unordered_map>
+
+extern "C"
+{
+#define AFB_BINDING_VERSION 2
+#include <afb/afb-binding.h>
+}
+
+namespace wm
+{
+
+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();
+
+ 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::string id;
+ 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;
+#endif
+};
+} // namespace wm
+
+#endif \ No newline at end of file