app: add very c++-y layout parsing
[staging/windowmanager.git] / src / app.hpp
1 //
2 // Created by mfritzsc on 7/11/17.
3 //
4
5 #ifndef TMCAGLWM_APP_HPP
6 #define TMCAGLWM_APP_HPP
7
8 #include <json-c/json.h>
9 #include <memory>
10
11 #include "afb_binding_api.hpp"
12 #include "result.hpp"
13 #include "wayland.hpp"
14 #include "layout.hpp"
15
16 namespace wl {
17 struct display;
18 }
19
20 namespace genivi {
21 struct controller;
22 }
23
24 namespace wm {
25
26 struct App {
27    struct binding_api api;
28
29    // This is the one thing, we do not own.
30    struct wl::display *display;
31
32    std::unique_ptr<struct genivi::controller> controller;
33    std::vector<std::unique_ptr<struct wl::output>> outputs;
34
35    layouts_type layouts;
36
37    App(wl::display *d);
38    ~App();
39
40    App(App const &) = delete;
41    App &operator=(App const &) = delete;
42
43    int init();
44    int dispatch_events();
45    int init_layout();
46 };
47
48 }  // namespace wm
49
50 #endif  // TMCAGLWM_APP_HPP