1#ifndef YAZE_APP_EDITOR_LAYOUT_DESIGNER_LAYOUT_DEFINITION_H_
2#define YAZE_APP_EDITOR_LAYOUT_DESIGNER_LAYOUT_DEFINITION_H_
9#include "imgui/imgui.h"
14namespace layout_designer {
39 ImVec2
size = ImVec2(-1, -1);
52 ImGuiWindowFlags
flags = ImGuiWindowFlags_None;
84 ImGuiDockNodeFlags
flags = ImGuiDockNodeFlags_None;
95 void Split(ImGuiDir direction,
float ratio);
104 std::unique_ptr<DockNode>
Clone()
const;
121 std::unique_ptr<DockNode>
root;
140 std::unique_ptr<LayoutDefinition>
Clone()
const;
156 bool Validate(std::string* error_message =
nullptr)
const;
DockNodeType
Type of dock node in the layout tree.
Represents a dock node in the layout tree.
void AddPanel(const LayoutPanel &panel)
std::vector< LayoutPanel > panels
LayoutPanel * FindPanel(const std::string &panel_id)
std::unique_ptr< DockNode > Clone() const
size_t CountPanels() const
std::unique_ptr< DockNode > child_left
std::unique_ptr< DockNode > child_right
Complete layout definition with metadata.
std::unique_ptr< LayoutDefinition > Clone() const
Clone the layout definition.
int64_t created_timestamp
std::vector< LayoutPanel * > GetAllPanels() const
Get all panels in the layout.
std::unique_ptr< DockNode > root
bool Validate(std::string *error_message=nullptr) const
Validate the layout structure.
static LayoutDefinition CreateEmpty(const std::string &name)
Create a default empty layout.
int64_t modified_timestamp
void Touch()
Update the modified timestamp to current time.
LayoutPanel * FindPanel(const std::string &panel_id) const
Find a panel by ID anywhere in the layout.
Represents a single panel in a layout.