From 54c34361d08386c751897ee215554c9ea1efd108 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Wed, 12 Jul 2017 15:59:37 +0200 Subject: Generating binding API glue code using generate-binding.py Signed-off-by: Marcus Fritzsch --- src/app.hpp | 46 +++++++++++++--------------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) (limited to 'src/app.hpp') 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 -#include +#include -namespace wm { - - using std::experimental::optional; - using std::experimental::nullopt; - - template - struct result { - optional e; - optional 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 - struct result Err(E e) { return result{e, nullopt}; } +namespace wl { + struct display; +} +namespace genivi { + struct controller; +} - template - struct result Ok(T t) { return result{nullopt, t}; } - - using json = nlohmann::json; +namespace wm { struct App { - struct API { - struct App *app; - - result debug_status() const; - result debug_layers() const; - result debug_surfaces() const; - - result register_surface(uint32_t appid, uint32_t surfid); - }; - - struct API api; + struct binding_api api; + struct wl::display *display; + struct genivi::controller *controller; App(); }; -- cgit 1.2.3-korg