app: scene setup according to ids.json
[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 #include "controller_hooks.hpp"
16 #include "layers.hpp"
17
18 namespace wl {
19 struct display;
20 }
21
22 namespace genivi {
23 struct controller;
24 }
25
26 namespace wm {
27
28 struct App {
29    struct binding_api api;
30    struct controller_hooks chooks;
31
32    // This is the one thing, we do not own.
33    struct wl::display *display;
34
35    std::unique_ptr<struct genivi::controller> controller;
36    std::vector<std::unique_ptr<struct wl::output>> outputs;
37
38    layouts_type layouts;
39    surface_id_to_layer_map surface2layer;
40
41    App(wl::display *d);
42    ~App();
43
44    App(App const &) = delete;
45    App &operator=(App const &) = delete;
46
47    int init();
48    int dispatch_events();
49    int init_layout();
50
51    void surface_created(uint32_t surface_id);
52    void surface_removed(uint32_t surface_id);
53 };
54
55 }  // namespace wm
56
57 #endif  // TMCAGLWM_APP_HPP