aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.hpp
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-07-12 15:59:37 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit54c34361d08386c751897ee215554c9ea1efd108 (patch)
tree28ae052b7e819d9f5308b3545beb029c88a476d7 /src/app.hpp
parent628df48e0238391658dab54f81dfa1c62dbfb3ec (diff)
Generating binding API glue code using generate-binding.py
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/app.hpp')
-rw-r--r--src/app.hpp46
1 files changed, 13 insertions, 33 deletions
diff --git a/src/app.hpp b/src/app.hpp
index a3108b3..397548a 100644
--- a/src/app.hpp
+++ b/src/app.hpp
@@ -5,44 +5,24 @@
#ifndef TMCAGLWM_APP_HPP
#define TMCAGLWM_APP_HPP
-#include <json.hpp>
-#include <experimental/optional>
+#include <json-c/json.h>
-namespace wm {
-
- using std::experimental::optional;
- using std::experimental::nullopt;
-
- template <typename E, typename T>
- struct result {
- optional<E> e;
- optional<T> t;
-
- bool is_ok() const { return this->t != nullopt; }
- bool is_err() const { return this->e != nullopt; }
- T unwrap() { return this->t.value(); }
- };
+#include "result.hpp"
+#include "afb_api.hpp"
- template <typename E, typename T>
- struct result<E, T> Err(E e) { return result<E, T>{e, nullopt}; }
+namespace wl {
+ struct display;
+}
+namespace genivi {
+ struct controller;
+}
- template <typename E, typename T>
- struct result<E, T> Ok(T t) { return result<E, T>{nullopt, t}; }
-
- using json = nlohmann::json;
+namespace wm {
struct App {
- struct API {
- struct App *app;
-
- result<char const *, json> debug_status() const;
- result<char const *, json> debug_layers() const;
- result<char const *, json> debug_surfaces() const;
-
- result<char const *, json> register_surface(uint32_t appid, uint32_t surfid);
- };
-
- struct API api;
+ struct binding_api api;
+ struct wl::display *display;
+ struct genivi::controller *controller;
App();
};