Generating binding API glue code using generate-binding.py
[staging/windowmanager.git] / src / app.hpp
index a3108b3..397548a 100644 (file)
@@ -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();
     };