X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapp.hpp;h=172e688ae421e17536a44be88ac220601662ce62;hb=b3e6d76a1729ead40eb1fa5af98d8d734dfdd09b;hp=a3108b37ef316a15fe0d6549763bba738c42fb8b;hpb=628df48e0238391658dab54f81dfa1c62dbfb3ec;p=staging%2Fwindowmanager.git diff --git a/src/app.hpp b/src/app.hpp index a3108b3..172e688 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -5,48 +5,43 @@ #ifndef TMCAGLWM_APP_HPP #define TMCAGLWM_APP_HPP -#include -#include +#include +#include -namespace wm { - - using std::experimental::optional; - using std::experimental::nullopt; +#include "afb_binding_api.hpp" +#include "result.hpp" +#include "wayland.hpp" - template - struct result { - optional e; - optional t; +namespace wl { +struct display; +} - bool is_ok() const { return this->t != nullopt; } - bool is_err() const { return this->e != nullopt; } - T unwrap() { return this->t.value(); } - }; +namespace genivi { +struct controller; +} - template - struct result Err(E e) { return result{e, nullopt}; } - - template - struct result Ok(T t) { return result{nullopt, t}; } +namespace wm { - using json = nlohmann::json; +struct App { + struct binding_api api; - struct App { - struct API { - struct App *app; + // This is the one thing, we do not own. + struct wl::display *display; - result debug_status() const; - result debug_layers() const; - result debug_surfaces() const; + std::unique_ptr controller; + std::vector> outputs; - result register_surface(uint32_t appid, uint32_t surfid); - }; + App(wl::display *d); + ~App(); - struct API api; + App(App const &) = delete; + App &operator=(App const &) = delete; - App(); - }; + int init(); + int dispatch_events(); + int init_layout(); +}; -} // namespace wm +} // namespace wm -#endif //TMCAGLWM_APP_HPP +#endif // TMCAGLWM_APP_HPP