app: reset g_app on ~App()
[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
15 namespace wl {
16 struct display;
17 }
18
19 namespace genivi {
20 struct controller;
21 }
22
23 namespace wm {
24
25 struct App {
26    struct binding_api api;
27
28    // This is the one thing, we do not own.
29    struct wl::display *display;
30
31    std::unique_ptr<struct genivi::controller> controller;
32    std::vector<std::unique_ptr<struct wl::output>> outputs;
33
34    App(wl::display *d);
35    ~App();
36
37    App(App const &) = delete;
38    App &operator=(App const &) = delete;
39
40    int init();
41    int dispatch_events();
42    int init_layout();
43 };
44
45 }  // namespace wm
46
47 #endif  // TMCAGLWM_APP_HPP