app/layout: fix split layout from and to transitions
[staging/windowmanager.git] / src / layout.hpp
index 33a503d..85ac30e 100644 (file)
 
 namespace wm {
 
-// Areas and layouts are defined to have a name, let's just keep it this way,
-// we will not copy them around anyway.
-struct area {
-   std::string name;
-   genivi::rect rect;
-   uint32_t layer;  // i.e. zorder?
+struct LayoutState {
+   enum States {
+      Single,
+      Split,
+   };
+
+   enum States s{Single};
+   int main{-1};
+   int sub{-1};
+
+   bool operator==(const LayoutState &b) const {
+      return s == b.s && main == b.main && sub == b.sub;
+   }
+
+   bool operator!=(const LayoutState &b) const {
+      return !(*this == b);
+   }
 };
 
-struct layout {
-   static constexpr unsigned MAX_N_AREAS = 2;
-
-   std::string name;
-   uint32_t n_areas;
-   struct area areas[MAX_N_AREAS];
-};
-
-typedef std::vector<struct layout> layouts_type;
-
 }  // namespace wm
 
 #endif  // TMCAGLWM_LAYOUT_HPP