main: move most of main to app, separate ownership
[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 "wayland.hpp"
12 #include "result.hpp"
13 #include "afb_api.hpp"
14
15 namespace wl {
16     struct display;
17 }
18 namespace genivi {
19     struct controller;
20 }
21
22 namespace wm {
23
24     struct App {
25         struct binding_api api;
26
27         // This is the one thing, we do not own.
28         struct wl::display *display;
29
30         std::unique_ptr<struct genivi::controller> controller;
31         std::vector<std::unique_ptr<struct wl::output>> outputs;
32
33         App(wl::display *d);
34
35         int init();
36         int dispatch_events();
37         int init_layout();
38     };
39
40 } // namespace wm
41
42 #endif //TMCAGLWM_APP_HPP