1#ifndef YAZE_APP_EDITOR_LAYOUT_DESIGNER_LAYOUT_DESIGNER_WINDOW_H_
2#define YAZE_APP_EDITOR_LAYOUT_DESIGNER_LAYOUT_DESIGNER_WINDOW_H_
14#define IMGUI_DEFINE_MATH_OPERATORS
15#include "imgui/imgui.h"
17namespace yaze {
namespace editor {
class LayoutManager;
class EditorManager; } }
21namespace layout_designer {
149 bool IsMouseOverRect(
const ImVec2& rect_min,
const ImVec2& rect_max)
const;
150 ImGuiDir
GetDropZone(
const ImVec2& mouse_pos,
const ImVec2& rect_min,
151 const ImVec2& rect_max)
const;
153 std::optional<PalettePanel>
ResolvePanelById(
const std::string& panel_id)
const;
The EditorManager controls the main editor window and manages the various editor classes.
Manages ImGui DockBuilder layouts for each editor type.
Central registry for all editor cards with session awareness and dependency injection.
Main window for the WYSIWYG layout designer.
std::vector< std::unique_ptr< LayoutDefinition > > redo_stack_
std::string selected_category_filter_
void PreviewLayout()
Apply current layout to the application (live preview)
void Close()
Close the designer window.
PanelManager * panel_manager_
yaze::editor::EditorManager * editor_manager_
std::unique_ptr< LayoutDefinition > current_layout_
void AddPanelToTarget(const PalettePanel &panel)
LayoutDesignerWindow(yaze::editor::LayoutManager *layout_manager, PanelManager *panel_manager, yaze::editor::EditorManager *editor_manager)
void DeletePanel(LayoutPanel *panel)
void DrawDockNodeTree(DockNode *node, int &node_index)
void DrawThemeProperties()
void DrawDropZones(const ImVec2 &pos, const ImVec2 &size, DockNode *target_node)
WidgetDefinition * selected_widget_
void DrawWidgetCodePreview()
void Draw()
Draw the designer window (call every frame)
void NewLayout()
Create a new empty layout.
void ImportPanelDesign(const std::string &panel_id)
Import a specific panel's design from runtime.
void ExportCode(const std::string &filepath)
Export layout as C++ code.
std::vector< PalettePanel > panel_cache_
LayoutPanel * selected_panel_
DockNode * last_drop_node_for_preview_
bool IsOpen() const
Check if designer window is open.
void DrawWidgetProperties()
void ImportFromRuntime()
Import layout from current runtime state.
PalettePanel dragging_panel_
bool MatchesSearchFilter(const PalettePanel &panel) const
std::string GenerateLayoutPresetCode() const
DockNode * selected_node_
void DrawPanelProperties(LayoutPanel *panel)
void LoadLayout(const std::string &filepath)
Load a layout from JSON file.
void DeleteNode(DockNode *node)
bool IsMouseOverRect(const ImVec2 &rect_min, const ImVec2 &rect_max) const
LayoutDesignerWindow()=default
std::unique_ptr< PanelDesign > current_panel_design_
ImGuiDir GetDropZone(const ImVec2 &mouse_pos, const ImVec2 &rect_min, const ImVec2 &rect_max) const
std::string selected_widget_category_
void Open()
Open the designer window.
DockNode * drop_target_node_
void DrawDockNode(DockNode *node, const ImVec2 &pos, const ImVec2 &size)
std::string selected_panel_for_design_
ThemeProperties theme_properties_
yaze::editor::LayoutManager * layout_manager_
void SaveLayout(const std::string &filepath)
Save current layout to JSON file.
void HandleCanvasDragDrop()
std::vector< std::unique_ptr< LayoutDefinition > > undo_stack_
void Initialize(PanelManager *panel_manager, yaze::editor::LayoutManager *layout_manager=nullptr, yaze::editor::EditorManager *editor_manager=nullptr)
Initialize the designer with manager references.
std::string GenerateDockBuilderCode() const
void DrawNodeProperties(DockNode *node)
ThemePropertiesPanel theme_panel_
char widget_search_filter_[256]
static constexpr size_t kMaxUndoSteps
std::vector< PalettePanel > GetAvailablePanels() const
std::optional< PalettePanel > ResolvePanelById(const std::string &panel_id) const
UI panel for editing theme properties in the layout designer.
DesignMode
Design mode for the layout designer.
Represents a dock node in the layout tree.
Represents a single panel in a layout.
Encapsulates ImGui style properties for visual design.