Facade class that coordinates all layout-related operations. More...
#include <layout_coordinator.h>
Classes | |
| struct | Dependencies |
| All dependencies required by LayoutCoordinator. More... | |
Public Member Functions | |
| LayoutCoordinator ()=default | |
| ~LayoutCoordinator ()=default | |
| void | Initialize (const Dependencies &deps) |
| Initialize with all dependencies. | |
| float | GetLeftLayoutOffset () const |
| Get the left margin needed for sidebar (Activity Bar + Side Panel) | |
| float | GetRightLayoutOffset () const |
| Get the right margin needed for panels. | |
| float | GetBottomLayoutOffset () const |
| Get the bottom margin needed for status bar. | |
| void | ResetWorkspaceLayout () |
| Reset the workspace layout to defaults. | |
| void | ApplyLayoutPreset (const std::string &preset_name, size_t session_id) |
| Apply a named layout preset. | |
| void | ResetCurrentEditorLayout (EditorType editor_type, size_t session_id) |
| Reset current editor layout to its default configuration. | |
| void | ProcessLayoutRebuild (EditorType current_editor_type, bool is_emulator_visible) |
| Process pending layout rebuild requests. | |
| void | InitializeEditorLayout (EditorType type) |
| Initialize layout for an editor type on first activation. | |
| void | QueueDeferredAction (std::function< void()> action) |
| Queue an action to be executed on the next frame. | |
| void | ProcessDeferredActions () |
| Process all queued deferred actions. | |
| LayoutManager * | layout_manager () |
| const LayoutManager * | layout_manager () const |
| bool | IsInitialized () const |
Private Attributes | |
| LayoutManager * | layout_manager_ = nullptr |
| PanelManager * | panel_manager_ = nullptr |
| UICoordinator * | ui_coordinator_ = nullptr |
| ToastManager * | toast_manager_ = nullptr |
| StatusBar * | status_bar_ = nullptr |
| RightPanelManager * | right_panel_manager_ = nullptr |
| std::vector< std::function< void()> > | deferred_actions_ |
Facade class that coordinates all layout-related operations.
This class extracts layout logic from EditorManager to reduce cognitive complexity. It provides a unified interface for:
Dependencies are injected to avoid circular includes.
Definition at line 36 of file layout_coordinator.h.
|
default |
|
default |
| void yaze::editor::LayoutCoordinator::Initialize | ( | const Dependencies & | deps | ) |
Initialize with all dependencies.
| deps | The dependency struct containing all required pointers |
Definition at line 16 of file layout_coordinator.cc.
References yaze::editor::LayoutCoordinator::Dependencies::layout_manager, layout_manager_, yaze::editor::LayoutCoordinator::Dependencies::panel_manager, panel_manager_, yaze::editor::LayoutCoordinator::Dependencies::right_panel_manager, right_panel_manager_, yaze::editor::LayoutCoordinator::Dependencies::status_bar, status_bar_, yaze::editor::LayoutCoordinator::Dependencies::toast_manager, toast_manager_, yaze::editor::LayoutCoordinator::Dependencies::ui_coordinator, and ui_coordinator_.
Referenced by yaze::editor::EditorManager::EditorManager().
| float yaze::editor::LayoutCoordinator::GetLeftLayoutOffset | ( | ) | const |
Get the left margin needed for sidebar (Activity Bar + Side Panel)
Definition at line 29 of file layout_coordinator.cc.
References yaze::editor::PanelManager::GetSidebarWidth(), yaze::editor::PanelManager::GetSidePanelWidth(), yaze::editor::PanelManager::IsPanelExpanded(), yaze::editor::UICoordinator::IsPanelSidebarVisible(), yaze::editor::PanelManager::IsSidebarVisible(), panel_manager_, yaze::editor::UICoordinator::ShouldShowActivityBar(), and ui_coordinator_.
Referenced by yaze::editor::EditorManager::GetLeftLayoutOffset().
| float yaze::editor::LayoutCoordinator::GetRightLayoutOffset | ( | ) | const |
Get the right margin needed for panels.
Definition at line 56 of file layout_coordinator.cc.
References yaze::editor::RightPanelManager::GetPanelWidth(), and right_panel_manager_.
Referenced by yaze::editor::EditorManager::GetRightLayoutOffset().

| float yaze::editor::LayoutCoordinator::GetBottomLayoutOffset | ( | ) | const |
Get the bottom margin needed for status bar.
Definition at line 60 of file layout_coordinator.cc.
References yaze::editor::StatusBar::GetHeight(), and status_bar_.
Referenced by yaze::editor::EditorManager::GetBottomLayoutOffset().

| void yaze::editor::LayoutCoordinator::ResetWorkspaceLayout | ( | ) |
Reset the workspace layout to defaults.
Clears all layout initialization flags and requests rebuild. Uses the current editor context to determine which layout to rebuild.
Definition at line 68 of file layout_coordinator.cc.
References yaze::editor::LayoutManager::ClearInitializationFlags(), yaze::editor::UICoordinator::IsEmulatorVisible(), yaze::editor::kEmulator, layout_manager_, LOG_INFO, yaze::editor::LayoutManager::RebuildLayout(), yaze::editor::LayoutManager::RequestRebuild(), and ui_coordinator_.
Referenced by yaze::editor::EditorManager::ResetWorkspaceLayout().

| void yaze::editor::LayoutCoordinator::ApplyLayoutPreset | ( | const std::string & | preset_name, |
| size_t | session_id ) |
Apply a named layout preset.
| preset_name | Name of the preset (e.g., "Minimal", "Developer") |
| session_id | Current session ID for panel management |
Definition at line 93 of file layout_coordinator.cc.
References yaze::editor::PanelLayoutPreset::default_visible_panels, yaze::editor::LayoutPresets::GetAudioPreset(), yaze::editor::LayoutPresets::GetDesignerPreset(), yaze::editor::LayoutPresets::GetDeveloperPreset(), yaze::editor::LayoutPresets::GetDungeonExpertPreset(), yaze::editor::LayoutPresets::GetMinimalPreset(), yaze::editor::LayoutPresets::GetModderPreset(), yaze::editor::LayoutPresets::GetOverworldExpertPreset(), yaze::editor::LayoutPresets::GetTestingPreset(), yaze::editor::PanelManager::HideAll(), yaze::editor::kSuccess, yaze::editor::kWarning, layout_manager_, LOG_INFO, LOG_WARN, panel_manager_, yaze::editor::LayoutManager::RequestRebuild(), yaze::editor::ToastManager::Show(), yaze::editor::PanelManager::ShowPanel(), and toast_manager_.
Referenced by yaze::editor::EditorManager::ApplyLayoutPreset().
| void yaze::editor::LayoutCoordinator::ResetCurrentEditorLayout | ( | EditorType | editor_type, |
| size_t | session_id ) |
Reset current editor layout to its default configuration.
| editor_type | The current editor type |
| session_id | Current session ID |
Definition at line 149 of file layout_coordinator.cc.
References yaze::editor::LayoutPresets::GetDefaultPreset(), yaze::editor::kSuccess, yaze::editor::kWarning, layout_manager_, LOG_INFO, panel_manager_, yaze::editor::LayoutManager::RequestRebuild(), yaze::editor::LayoutManager::ResetToDefaultLayout(), yaze::editor::PanelManager::ResetToDefaults(), yaze::editor::ToastManager::Show(), and toast_manager_.
Referenced by yaze::editor::EditorManager::ResetCurrentEditorLayout().
| void yaze::editor::LayoutCoordinator::ProcessLayoutRebuild | ( | EditorType | current_editor_type, |
| bool | is_emulator_visible ) |
Process pending layout rebuild requests.
Called from the main update loop. Checks if a rebuild was requested and executes it if we're in a valid ImGui frame scope.
| current_editor_type | The currently active editor type |
| is_emulator_visible | Whether the emulator is currently visible |
Definition at line 181 of file layout_coordinator.cc.
References yaze::editor::LayoutManager::ClearRebuildRequest(), yaze::editor::LayoutManager::IsRebuildRequested(), yaze::editor::kEmulator, yaze::editor::kUnknown, layout_manager_, LOG_INFO, and yaze::editor::LayoutManager::RebuildLayout().
Referenced by yaze::editor::EditorManager::Update().

| void yaze::editor::LayoutCoordinator::InitializeEditorLayout | ( | EditorType | type | ) |
Initialize layout for an editor type on first activation.
| type | The editor type to initialize |
This is called when switching to an editor for the first time. Uses deferred action to ensure ImGui context is valid.
Definition at line 213 of file layout_coordinator.cc.
References yaze::editor::LayoutManager::IsLayoutInitialized(), layout_manager_, and QueueDeferredAction().

| void yaze::editor::LayoutCoordinator::QueueDeferredAction | ( | std::function< void()> | action | ) |
Queue an action to be executed on the next frame.
| action | The action to queue |
Used for operations that must be deferred (e.g., layout changes during menu rendering).
Definition at line 231 of file layout_coordinator.cc.
References deferred_actions_.
Referenced by InitializeEditorLayout().
| void yaze::editor::LayoutCoordinator::ProcessDeferredActions | ( | ) |
Process all queued deferred actions.
Should be called at the start of each frame before other updates.
Definition at line 235 of file layout_coordinator.cc.
References deferred_actions_.
Referenced by yaze::editor::EditorManager::Update().
|
inline |
Definition at line 153 of file layout_coordinator.h.
References layout_manager_.
|
inline |
Definition at line 154 of file layout_coordinator.h.
References layout_manager_.
|
inline |
Definition at line 156 of file layout_coordinator.h.
References layout_manager_.
|
private |
Definition at line 160 of file layout_coordinator.h.
Referenced by ApplyLayoutPreset(), Initialize(), InitializeEditorLayout(), IsInitialized(), layout_manager(), layout_manager(), ProcessLayoutRebuild(), ResetCurrentEditorLayout(), and ResetWorkspaceLayout().
|
private |
Definition at line 161 of file layout_coordinator.h.
Referenced by ApplyLayoutPreset(), GetLeftLayoutOffset(), Initialize(), and ResetCurrentEditorLayout().
|
private |
Definition at line 162 of file layout_coordinator.h.
Referenced by GetLeftLayoutOffset(), Initialize(), and ResetWorkspaceLayout().
|
private |
Definition at line 163 of file layout_coordinator.h.
Referenced by ApplyLayoutPreset(), Initialize(), and ResetCurrentEditorLayout().
|
private |
Definition at line 164 of file layout_coordinator.h.
Referenced by GetBottomLayoutOffset(), and Initialize().
|
private |
Definition at line 165 of file layout_coordinator.h.
Referenced by GetRightLayoutOffset(), and Initialize().
|
private |
Definition at line 168 of file layout_coordinator.h.
Referenced by ProcessDeferredActions(), and QueueDeferredAction().