#pragma once #include #include #include "lumacs/window.hpp" // For Window class #include "lumacs/buffer.hpp" // For shared_ptr (indirectly via Window) namespace lumacs { // Forward declaration class Window; /// @brief Represents a node in the window layout tree. /// Can be a leaf node (holding a Window) or an internal node (representing a split). struct LayoutNode { enum class Type { Leaf, HorizontalSplit, // Children are top/bottom VerticalSplit // Children are left/right }; Type type; std::shared_ptr window; // Valid if type is Leaf std::shared_ptr child1; // Valid if type is Horizontal/VerticalSplit std::shared_ptr child2; // Valid if type is Horizontal/VerticalSplit double ratio = 0.5; // Ratio for split (e.g., 0.5 for a 50/50 split) // Constructor for leaf nodes (a window) explicit LayoutNode(std::shared_ptr win) : type(Type::Leaf), window(std::move(win)) {} // Constructor for internal nodes (a split) LayoutNode(Type t, std::shared_ptr c1, std::shared_ptr c2) : type(t), child1(std::move(c1)), child2(std::move(c2)) {} }; } // namespace lumacs