diff options
author | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-07-12 16:40:29 +0200 |
---|---|---|
committer | Marcus Fritzsch <marcus_fritzsch@mentor.com> | 2017-08-08 17:24:00 +0200 |
commit | 7678bfc942bd501f8e121ff153d1852d73578257 (patch) | |
tree | 81cb2b27743abffe319661c4f513cf9c5eada17f /src/app.hpp | |
parent | 54c34361d08386c751897ee215554c9ea1efd108 (diff) |
main: move most of main to app, separate ownership
* Move everything apart from the display connection itself to App.
* Everything depending on the display however is owned by App.
* Dispatch events for the application in App::dispatch_events()
That is, display_dispatch and local stuff e.g. execute_pending().
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/app.hpp')
-rw-r--r-- | src/app.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/app.hpp b/src/app.hpp index 397548a..f6238af 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -6,7 +6,9 @@ #define TMCAGLWM_APP_HPP #include <json-c/json.h> +#include <memory> +#include "wayland.hpp" #include "result.hpp" #include "afb_api.hpp" @@ -21,10 +23,18 @@ namespace wm { struct App { struct binding_api api; + + // This is the one thing, we do not own. struct wl::display *display; - struct genivi::controller *controller; - App(); + std::unique_ptr<struct genivi::controller> controller; + std::vector<std::unique_ptr<struct wl::output>> outputs; + + App(wl::display *d); + + int init(); + int dispatch_events(); + int init_layout(); }; } // namespace wm |