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