X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fapp.hpp;h=00a2ba260ba7cdcafffc0c48410043a2999c2154;hb=793166f301c058503c37553204c4d4c2b106ff23;hp=37122ef5158b3b47cc87b3846d8868f7400f6f95;hpb=6b648180458e9625e1f700962537c3d4e501f6cc;p=staging%2Fwindowmanager.git diff --git a/src/app.hpp b/src/app.hpp index 37122ef..00a2ba2 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -18,10 +18,12 @@ #define TMCAGLWM_APP_HPP #include + +#include #include #include #include -#include +#include #include "afb_binding_api.hpp" #include "config.hpp" @@ -41,6 +43,8 @@ struct controller; namespace wm { +using std::experimental::optional; + struct id_allocator { constexpr static const unsigned id_shift = 22; constexpr static const unsigned id_mask = (1 << id_shift) - 1; @@ -100,13 +104,21 @@ struct id_allocator { struct LayoutState { enum States { + LayoutNone, // Not useful... LayoutSingle, LayoutSplit, }; - enum States state; - int main; - int sub; + enum States state{LayoutSingle}; + int main{-1}; + int sub{-1}; + + bool operator==(const LayoutState &b) const { + return state == b.state && main == b.main && sub == b.sub; + } + bool operator!=(const LayoutState &b) const { + return !(*this == b); + } }; struct App { @@ -121,7 +133,8 @@ struct App { struct config config; - layouts_type layouts; + // track current layouts separately + std::map layouts; layer_map layers; // ID allocation and proxy methods for lookup @@ -135,6 +148,8 @@ struct App { struct LayoutState state; + std::atomic pending_events; + explicit App(wl::display *d); ~App(); @@ -148,7 +163,8 @@ struct App { int dispatch_events(); - void surface_init_layout(uint32_t surface_id); + void surface_set_layout_full(uint32_t surface_id); + void surface_set_layout_split(uint32_t surface_id, uint32_t sub_surface_id); // Allocate a surface ID for this role result request_surface(char const *drawing_name);