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