Manages ImGui DockBuilder layouts for each editor type. More...
#include <layout_manager.h>

Classes | |
| struct | LayoutIniState |
| struct | LazyDefaultDockState |
| struct | PendingDockTabSelection |
| struct | SessionSnapshot |
Public Member Functions | |
| LayoutManager ()=default | |
| ~LayoutManager () | |
| void | SetWindowManager (WorkspaceWindowManager *manager) |
| Set the window manager for window title lookups. | |
| WorkspaceWindowManager * | window_manager () const |
| Get the window manager. | |
| void | InitializeEditorLayout (EditorType type, ImGuiID dockspace_id) |
| Initialize the default layout for a specific editor type. | |
| void | RebuildLayout (EditorType type, ImGuiID dockspace_id) |
| Force rebuild of layout for a specific editor type. | |
| bool | DockDefaultPositionOnFirstOpen (size_t session_id, const std::string &panel_id) |
| Dock a hidden-by-default panel at its preset position on first open. | |
| bool | DockPresetPositionOnPanelOpen (size_t session_id, const std::string &panel_id) |
| Rebind any preset panel when a visibility event opens it. | |
| void | SaveCurrentLayout (const std::string &name, bool persist=true) |
| Save the current layout with a custom name. | |
| void | LoadLayout (const std::string &name) |
| Load a saved layout by name. | |
| void | CaptureTemporarySessionLayout (size_t session_id) |
| Capture the current workspace as a temporary session layout. | |
| bool | RestoreTemporarySessionLayout (size_t session_id, bool clear_after_restore=false) |
| Restore the temporary session layout if one has been captured. | |
| bool | HasTemporarySessionLayout () const |
| Whether a temporary session layout is available. | |
| void | ClearTemporarySessionLayout () |
| Clear temporary session layout snapshot state. | |
| bool | SaveNamedSnapshot (const std::string &name, size_t session_id) |
| Capture the current workspace under a named, session-scoped slot. | |
| bool | RestoreNamedSnapshot (const std::string &name, size_t session_id, bool remove_after_restore=false) |
| Restore a named snapshot by name. | |
| bool | DeleteNamedSnapshot (const std::string &name) |
| Delete a named snapshot. Returns true if an entry was removed. | |
| std::vector< std::string > | ListNamedSnapshots (size_t session_id) const |
| List all named snapshots for the given session. | |
| bool | HasNamedSnapshot (const std::string &name) const |
| Whether a named snapshot with the given name exists. | |
| bool | DeleteLayout (const std::string &name) |
| Delete a saved layout by name. | |
| bool | ApplyBuiltInProfile (const std::string &profile_id, size_t session_id, EditorType editor_type, LayoutProfile *out_profile=nullptr) |
| Apply a built-in layout profile by profile ID. | |
| std::vector< std::string > | GetSavedLayoutNames () const |
| Get list of all saved layout names. | |
| bool | HasLayout (const std::string &name) const |
| Check if a layout exists. | |
| void | LoadLayoutsFromDisk () |
| Load layouts for the active scope (global + optional project) | |
| void | SetProjectLayoutKey (const std::string &key) |
| Set the active project layout key (enables project scope) | |
| void | UseGlobalLayouts () |
| Clear project scope and return to global layouts only. | |
| LayoutScope | GetActiveScope () const |
| Get the active layout scope. | |
| void | ResetToDefaultLayout (EditorType type) |
| Reset the layout for an editor to its default. | |
| bool | IsLayoutInitialized (EditorType type) const |
| Check if a layout has been initialized for an editor. | |
| void | MarkLayoutInitialized (EditorType type) |
| Mark a layout as initialized. | |
| void | ClearInitializationFlags () |
| Clear all initialization flags (for testing) | |
| void | RequestRebuild () |
| Request a layout rebuild on next frame. | |
| bool | IsRebuildRequested () const |
| Check if rebuild was requested. | |
| void | ClearRebuildRequest () |
| Clear rebuild request flag. | |
| std::string | GetWindowTitle (const std::string &card_id) const |
| Get window title for a card ID from registry. | |
| absl::Status | ApplyDockTree (const layout_designer::DockTree &tree, ImGuiID dockspace_id) |
| Apply a DockTree to the given dockspace. | |
| void | ProcessPendingDockTabSelections () |
| void | SetMainDockspaceId (ImGuiID id) |
| Record the outer dockspace ID (OuterDockspaceId() in the app). | |
| ImGuiID | GetMainDockspaceId () const |
| Get the cached main dockspace ID. | |
| ImGuiID | ActiveEditorDockspaceId () const |
| Dockspace of the editor shown in the editor host, or 0 for kUnknown. | |
| void | SetActiveEditorType (EditorType type) |
| EditorType | active_editor_type () const |
| void | DrawEditorHost () |
| Draw the editor host window and enforce the pin node. | |
| ImGuiID | FindPinNode () const |
| Pin node under the outer root, or 0 before the first split. | |
| ImGuiDir | pin_dir () const |
| float | pin_size () const |
| void | RegisterLayoutIniHandler () |
| Register the "YazeLayout" ImGui settings handler on the current context. | |
| void | ResetLayoutIniSettings () |
| void | ReadLayoutIniLine (const char *line) |
| void | ApplyLayoutIniSettings () |
| void | WriteLayoutIniSettings (ImGuiTextBuffer *buf) const |
| void | reset_startup_layout_consumed_for_test () |
Test-only: reset the one-shot startup-reapply guard so a single test fixture can drive MaybeReapplyStartupLayout through multiple scenarios without standing up a fresh manager each time. | |
| bool | startup_layout_consumed_for_test () const |
| bool | startup_reapply_pending_protection_for_test () const |
| void | set_current_editor_type_for_test (EditorType type) |
| void | set_editor_host_size_for_test (ImVec2 size) |
| absl::Status | MaybeReapplyStartupLayout (UserSettings *settings) |
| One-shot startup hook that re-applies the user's last applied named layout, if any. | |
| absl::StatusOr< layout_designer::DockTree > | CaptureDockTree (ImGuiID dockspace_id) const |
| Capture the current docking state into a DockTree. | |
Static Public Member Functions | |
| static std::vector< LayoutProfile > | GetBuiltInProfiles () |
| Get built-in layout profiles. | |
| static ImGuiID | OuterDockspaceId () |
| Outer dockspace hosted by DockSpaceWindow. | |
| static ImGuiID | EditorDockspaceId (EditorType type) |
| Dockspace that holds one editor's panels. | |
Static Public Attributes | |
| static constexpr int | kLayoutIniRevision = 1 |
| Layout revision written to imgui.ini. A mismatch resets dock trees. | |
Private Member Functions | |
| void | BuildLayoutFromPreset (EditorType type, ImGuiID dockspace_id) |
| void | DisableLazyDefaultDocking () |
| void | RefreshLazyDefaultDockingContext (EditorType type, ImGuiID dockspace_id) |
| void | DockOpenPresetPanels (EditorType type) |
| bool | DockPresetPositionOnFirstOpen (size_t session_id, const std::string &panel_id, bool include_default_visible, bool allow_redock=false) |
| void | MarkLazyDefaultDockAttempted (const std::string &panel_id) |
| void | StashLazyDefaultDockState () |
| bool | RestoreLazyDefaultDockState (EditorType type, ImGuiID dockspace_id) |
| ImGuiID | EnsurePinNode () |
| void | RecordPinSpot () |
| ImGuiID | MovePinSpot (ImGuiDir dir, float size) |
| ImVec2 | EditorDockspaceSize () const |
| void | EnforcePinnedPanels (ImGuiID pin_node) |
| void | ProtectRestoredLayoutFromDefaultInitialization () |
| void | LoadLayoutsFromDiskInternal (LayoutScope scope, bool merge) |
| void | SaveLayoutsToDisk (LayoutScope scope) const |
Manages ImGui DockBuilder layouts for each editor type.
Provides professional default layouts using ImGui's DockBuilder API, similar to VSCode's workspace layouts. Each editor type has a custom layout optimized for its workflow.
Features:
Definition at line 54 of file layout_manager.h.
|
default |
| yaze::editor::LayoutManager::~LayoutManager | ( | ) |
Definition at line 772 of file layout_manager.cc.
|
inline |
Set the window manager for window title lookups.
| manager | Pointer to the WorkspaceWindowManager |
Definition at line 63 of file layout_manager.h.
References window_manager_.
|
inline |
Get the window manager.
Definition at line 71 of file layout_manager.h.
References window_manager_.
| void yaze::editor::LayoutManager::InitializeEditorLayout | ( | EditorType | type, |
| ImGuiID | dockspace_id ) |
Initialize the default layout for a specific editor type.
| type | The editor type to initialize |
| dockspace_id | The ImGui dockspace ID to build the layout in |
Definition at line 194 of file layout_manager.cc.
References active_editor_type_, BuildLayoutFromPreset(), current_editor_type_, DisableLazyDefaultDocking(), DockOpenPresetPanels(), EditorDockspaceSize(), IsLayoutInitialized(), last_dockspace_id_, LOG_INFO, MarkLayoutInitialized(), pending_dock_tab_selections_, RefreshLazyDefaultDockingContext(), startup_reapply_pending_protection_, and window_manager_.
Referenced by yaze::editor::EditorActivator::HandleNonEditorClassSwitch(), and yaze::editor::EditorActivator::InitializeEditorLayout().
| void yaze::editor::LayoutManager::RebuildLayout | ( | EditorType | type, |
| ImGuiID | dockspace_id ) |
Force rebuild of layout for a specific editor type.
| type | The editor type to rebuild |
| dockspace_id | The ImGui dockspace ID to build the layout in |
This method rebuilds the layout even if it was already initialized. Useful for resetting layouts to their default state.
Definition at line 262 of file layout_manager.cc.
References active_editor_type_, BuildLayoutFromPreset(), current_editor_type_, DockOpenPresetPanels(), EditorDockspaceSize(), last_dockspace_id_, layouts_initialized_, LOG_ERROR, LOG_INFO, MarkLayoutInitialized(), pending_dock_tab_selections_, and window_manager_.
Referenced by yaze::editor::LayoutCoordinator::ProcessLayoutRebuild(), and yaze::editor::LayoutCoordinator::ResetWorkspaceLayout().

| bool yaze::editor::LayoutManager::DockDefaultPositionOnFirstOpen | ( | size_t | session_id, |
| const std::string & | panel_id ) |
Dock a hidden-by-default panel at its preset position on first open.
This is active only for default presets that intentionally build the startup dock tree from visible panels alone. Each panel is considered at most once per default-layout build, so closing and reopening a panel never overrides a position the user chose after its first open.
Definition at line 1396 of file layout_manager.cc.
| bool yaze::editor::LayoutManager::DockPresetPositionOnPanelOpen | ( | size_t | session_id, |
| const std::string & | panel_id ) |
Rebind any preset panel when a visibility event opens it.
Unlike DockDefaultPositionOnFirstOpen(), this accepts both default-visible and optional panels. This matters after another editor replaces the shared dock tree while a default panel is hidden: its next open event must attach it to the new live tree instead of leaving it floating.
Definition at line 1402 of file layout_manager.cc.
| void yaze::editor::LayoutManager::SaveCurrentLayout | ( | const std::string & | name, |
| bool | persist = true ) |
Save the current layout with a custom name.
| name | The name to save the layout under |
| persist | Whether to write the layout to disk |
Definition at line 1568 of file layout_manager.cc.
References LOG_INFO, and LOG_WARN.
Referenced by yaze::editor::LayoutCoordinator::ResetCurrentEditorLayout(), yaze::editor::WorkspaceManager::SaveWorkspaceLayout(), and yaze::editor::WorkspaceManager::SaveWorkspacePreset().
| void yaze::editor::LayoutManager::LoadLayout | ( | const std::string & | name | ) |
Load a saved layout by name.
| name | The name of the layout to load |
Definition at line 1603 of file layout_manager.cc.
References LOG_INFO, and LOG_WARN.
Referenced by yaze::editor::WorkspaceManager::LoadWorkspaceLayout(), yaze::editor::WorkspaceManager::LoadWorkspacePreset(), and yaze::editor::LayoutCoordinator::RestorePreviousEditorLayout().
| void yaze::editor::LayoutManager::CaptureTemporarySessionLayout | ( | size_t | session_id | ) |
Capture the current workspace as a temporary session layout.
Temporary layouts are held in memory only and are never persisted to disk.
Definition at line 1647 of file layout_manager.cc.
References LOG_INFO.
| bool yaze::editor::LayoutManager::RestoreTemporarySessionLayout | ( | size_t | session_id, |
| bool | clear_after_restore = false ) |
Restore the temporary session layout if one has been captured.
Definition at line 1672 of file layout_manager.cc.
|
inline |
Whether a temporary session layout is available.
Definition at line 146 of file layout_manager.h.
References has_temp_session_layout_.
| void yaze::editor::LayoutManager::ClearTemporarySessionLayout | ( | ) |
Clear temporary session layout snapshot state.
Definition at line 1709 of file layout_manager.cc.
| bool yaze::editor::LayoutManager::SaveNamedSnapshot | ( | const std::string & | name, |
| size_t | session_id ) |
Capture the current workspace under a named, session-scoped slot.
Named snapshots are held in memory only (never persisted) and identified by the caller-supplied name. Names are used as the stable lookup key; duplicate saves overwrite the existing entry.
Definition at line 1717 of file layout_manager.cc.
References yaze::editor::LayoutManager::SessionSnapshot::imgui_layout, LOG_INFO, yaze::editor::LayoutManager::SessionSnapshot::pinned, yaze::editor::LayoutManager::SessionSnapshot::session_id, and yaze::editor::LayoutManager::SessionSnapshot::visibility.
| bool yaze::editor::LayoutManager::RestoreNamedSnapshot | ( | const std::string & | name, |
| size_t | session_id, | ||
| bool | remove_after_restore = false ) |
Restore a named snapshot by name.
Definition at line 1737 of file layout_manager.cc.
References yaze::editor::LayoutManager::SessionSnapshot::imgui_layout, yaze::editor::LayoutManager::SessionSnapshot::pinned, yaze::editor::LayoutManager::SessionSnapshot::session_id, and yaze::editor::LayoutManager::SessionSnapshot::visibility.
| bool yaze::editor::LayoutManager::DeleteNamedSnapshot | ( | const std::string & | name | ) |
Delete a named snapshot. Returns true if an entry was removed.
Definition at line 1769 of file layout_manager.cc.
| std::vector< std::string > yaze::editor::LayoutManager::ListNamedSnapshots | ( | size_t | session_id | ) | const |
List all named snapshots for the given session.
Definition at line 1778 of file layout_manager.cc.
| bool yaze::editor::LayoutManager::HasNamedSnapshot | ( | const std::string & | name | ) | const |
Whether a named snapshot with the given name exists.
Definition at line 1791 of file layout_manager.cc.
| bool yaze::editor::LayoutManager::DeleteLayout | ( | const std::string & | name | ) |
Delete a saved layout by name.
| name | The name of the layout to delete |
Definition at line 1795 of file layout_manager.cc.
References LOG_INFO, and LOG_WARN.
Referenced by yaze::editor::LayoutCoordinator::RestorePreviousEditorLayout().
|
static |
Get built-in layout profiles.
Definition at line 1820 of file layout_manager.cc.
| bool yaze::editor::LayoutManager::ApplyBuiltInProfile | ( | const std::string & | profile_id, |
| size_t | session_id, | ||
| EditorType | editor_type, | ||
| LayoutProfile * | out_profile = nullptr ) |
Apply a built-in layout profile by profile ID.
| profile_id | Stable profile id from GetBuiltInProfiles() |
| session_id | Active session id |
| editor_type | Current editor type (for context-sensitive profiles) |
| out_profile | Optional resolved profile metadata |
Definition at line 1845 of file layout_manager.cc.
References yaze::editor::PanelLayoutPreset::default_visible_panels, LOG_INFO, LOG_WARN, and yaze::editor::LayoutProfile::preset_name.
| std::vector< std::string > yaze::editor::LayoutManager::GetSavedLayoutNames | ( | ) | const |
Get list of all saved layout names.
Definition at line 1905 of file layout_manager.cc.
| bool yaze::editor::LayoutManager::HasLayout | ( | const std::string & | name | ) | const |
Check if a layout exists.
| name | The layout name to check |
Definition at line 1914 of file layout_manager.cc.
Referenced by yaze::editor::LayoutCoordinator::HasPreviousEditorLayout(), yaze::editor::WorkspaceManager::LoadWorkspaceLayout(), yaze::editor::WorkspaceManager::LoadWorkspacePreset(), and yaze::editor::LayoutCoordinator::ResetCurrentEditorLayout().
| void yaze::editor::LayoutManager::LoadLayoutsFromDisk | ( | ) |
Load layouts for the active scope (global + optional project)
Definition at line 1918 of file layout_manager.cc.
| void yaze::editor::LayoutManager::SetProjectLayoutKey | ( | const std::string & | key | ) |
Set the active project layout key (enables project scope)
| key | Stable project storage key (sanitized) |
Definition at line 1930 of file layout_manager.cc.
| void yaze::editor::LayoutManager::UseGlobalLayouts | ( | ) |
Clear project scope and return to global layouts only.
Definition at line 1939 of file layout_manager.cc.
| LayoutScope yaze::editor::LayoutManager::GetActiveScope | ( | ) | const |
Get the active layout scope.
Definition at line 1944 of file layout_manager.cc.
| void yaze::editor::LayoutManager::ResetToDefaultLayout | ( | EditorType | type | ) |
Reset the layout for an editor to its default.
| type | The editor type to reset |
Definition at line 2068 of file layout_manager.cc.
References LOG_INFO.
Referenced by yaze::editor::LayoutCoordinator::ResetCurrentEditorLayout().
| bool yaze::editor::LayoutManager::IsLayoutInitialized | ( | EditorType | type | ) | const |
Check if a layout has been initialized for an editor.
| type | The editor type to check |
Definition at line 2075 of file layout_manager.cc.
Referenced by yaze::editor::EditorActivator::HandleNonEditorClassSwitch(), yaze::editor::LayoutCoordinator::InitializeEditorLayout(), yaze::editor::EditorActivator::InitializeEditorLayout(), and InitializeEditorLayout().
| void yaze::editor::LayoutManager::MarkLayoutInitialized | ( | EditorType | type | ) |
Mark a layout as initialized.
| type | The editor type to mark |
Definition at line 2080 of file layout_manager.cc.
References LOG_INFO.
Referenced by InitializeEditorLayout(), ProtectRestoredLayoutFromDefaultInitialization(), and RebuildLayout().
| void yaze::editor::LayoutManager::ClearInitializationFlags | ( | ) |
Clear all initialization flags (for testing)
Definition at line 2086 of file layout_manager.cc.
References LOG_INFO.
Referenced by yaze::editor::LayoutCoordinator::ResetWorkspaceLayout().
|
inline |
Request a layout rebuild on next frame.
Definition at line 268 of file layout_manager.h.
References rebuild_requested_.
Referenced by yaze::editor::LayoutCoordinator::ApplyLayoutPreset(), yaze::editor::LayoutCoordinator::ResetCurrentEditorLayout(), and yaze::editor::LayoutCoordinator::ResetWorkspaceLayout().
|
inline |
Check if rebuild was requested.
Definition at line 273 of file layout_manager.h.
References rebuild_requested_.
Referenced by yaze::editor::LayoutCoordinator::ProcessLayoutRebuild().
|
inline |
Clear rebuild request flag.
Definition at line 278 of file layout_manager.h.
References rebuild_requested_.
Referenced by yaze::editor::LayoutCoordinator::ProcessLayoutRebuild(), and yaze::editor::LayoutCoordinator::RestorePreviousEditorLayout().
| std::string yaze::editor::LayoutManager::GetWindowTitle | ( | const std::string & | card_id | ) | const |
Get window title for a card ID from registry.
| card_id | The card ID to look up |
Definition at line 2093 of file layout_manager.cc.
| absl::Status yaze::editor::LayoutManager::ApplyDockTree | ( | const layout_designer::DockTree & | tree, |
| ImGuiID | dockspace_id ) |
Apply a DockTree to the given dockspace.
Removes and rebuilds dockspace_id from scratch, walking the tree and calling DockBuilder{SplitNode,DockWindow,Finish}.
Side effects beyond DockBuilder, added in Phase 8 review (2026-04-24):
WorkspaceWindowManager::OpenWindow(panel_id) for every panel referenced in the tree, so the user actually sees the panels they docked rather than empty slots.Panels in the tree whose panel_id is not registered against the bound WorkspaceWindowManager are skipped with a best-effort fallback that reconstructs the window title from the PanelEntry's cached icon + display_name + id.
| tree | Tree to apply. Must pass Validate(). |
| dockspace_id | ImGui dockspace to rebuild. |
Definition at line 2273 of file layout_manager.cc.
References yaze::editor::layout_designer::DockTree::root, and yaze::editor::layout_designer::DockTree::Validate().
Referenced by yaze::editor::layout_designer::LayoutDesignerPanel::ApplyCurrentTreeToLiveDockspace(), and yaze::editor::SettingsPanel::ApplyNamedLayoutToDockspace().

| void yaze::editor::LayoutManager::ProcessPendingDockTabSelections | ( | ) |
Definition at line 2368 of file layout_manager.cc.
Referenced by yaze::editor::LayoutCoordinator::ProcessLayoutRebuild().
|
inline |
Record the outer dockspace ID (OuterDockspaceId() in the app).
GetMainDockspaceId() returns the active editor's dockspace when one is set and falls back to this ID. Tests that drive a single dockspace set it directly.
Definition at line 328 of file layout_manager.h.
References main_dockspace_id_.
| ImGuiID yaze::editor::LayoutManager::GetMainDockspaceId | ( | ) | const |
Get the cached main dockspace ID.
SetMainDockspaceId, or 0 before the first frame of the DockSpaceWindow has rendered. Definition at line 800 of file layout_manager.cc.
Referenced by yaze::editor::layout_designer::LayoutDesignerPanel::ApplyCurrentTreeToLiveDockspace(), yaze::editor::SettingsPanel::ApplyNamedLayoutToDockspace(), and yaze::editor::WorkspaceManager::MaximizeCurrentWindow().
|
static |
Outer dockspace hosted by DockSpaceWindow.
Hashed with a fixed seed, so the value does not depend on the calling window's ID stack. The outer root holds the shared pin node and the central node that hosts the editor host window.
Definition at line 783 of file layout_manager.cc.
Referenced by yaze::Controller::OnLoad().
|
static |
Dockspace that holds one editor's panels.
Each editor keeps its own dock tree. Switching editors submits a different dockspace instead of rebuilding a shared one, so closed and moved panels survive a round trip.
Definition at line 787 of file layout_manager.cc.
References yaze::editor::EditorTypeIndex(), and yaze::editor::kEditorNames.
Referenced by yaze::editor::EditorActivator::HandleNonEditorClassSwitch(), yaze::editor::EditorActivator::InitializeEditorLayout(), yaze::editor::LayoutCoordinator::ProcessLayoutRebuild(), and yaze::editor::LayoutCoordinator::ResetWorkspaceLayout().

| ImGuiID yaze::editor::LayoutManager::ActiveEditorDockspaceId | ( | ) | const |
Dockspace of the editor shown in the editor host, or 0 for kUnknown.
Definition at line 793 of file layout_manager.cc.
|
inline |
Definition at line 362 of file layout_manager.h.
References active_editor_type_.
Referenced by yaze::editor::EditorActivator::HandleNonEditorClassSwitch(), and yaze::editor::LayoutCoordinator::ProcessLayoutRebuild().
|
inline |
Definition at line 363 of file layout_manager.h.
References active_editor_type_.
| void yaze::editor::LayoutManager::DrawEditorHost | ( | ) |
Draw the editor host window and enforce the pin node.
Call once per frame after the DockSpaceWindow ends and before editor panels are drawn. Splits the outer root into the pin node and central node on first use, docks the host into the central node, submits the active editor dockspace and keeps every other editor dockspace alive.
Definition at line 960 of file layout_manager.cc.
References yaze::editor::kEditorTypeCount.
Referenced by yaze::Controller::OnLoad().
| ImGuiID yaze::editor::LayoutManager::FindPinNode | ( | ) | const |
Pin node under the outer root, or 0 before the first split.
Definition at line 807 of file layout_manager.cc.
|
inline |
Side and size (pixels along the split axis) the pin node is rebuilt with. Follows the last pin node drawn; size 0 means the default share.
Definition at line 380 of file layout_manager.h.
References pin_dir_.
|
inline |
Definition at line 381 of file layout_manager.h.
References pin_size_.
| void yaze::editor::LayoutManager::RegisterLayoutIniHandler | ( | ) |
Register the "YazeLayout" ImGui settings handler on the current context.
Definition at line 1091 of file layout_manager.cc.
| void yaze::editor::LayoutManager::ResetLayoutIniSettings | ( | ) |
Definition at line 1113 of file layout_manager.cc.
| void yaze::editor::LayoutManager::ReadLayoutIniLine | ( | const char * | line | ) |
Definition at line 1117 of file layout_manager.cc.
References yaze::editor::kEditorNames, and yaze::editor::LayoutManager::LayoutIniState::section_seen.
| void yaze::editor::LayoutManager::ApplyLayoutIniSettings | ( | ) |
Definition at line 1155 of file layout_manager.cc.
References LOG_INFO.
| void yaze::editor::LayoutManager::WriteLayoutIniSettings | ( | ImGuiTextBuffer * | buf | ) | const |
Definition at line 1198 of file layout_manager.cc.
References yaze::editor::kEditorNames, and yaze::editor::kEditorTypeCount.
|
inline |
Test-only: reset the one-shot startup-reapply guard so a single test fixture can drive MaybeReapplyStartupLayout through multiple scenarios without standing up a fresh manager each time.
Definition at line 404 of file layout_manager.h.
References startup_layout_consumed_.
|
inline |
Definition at line 407 of file layout_manager.h.
References startup_layout_consumed_.
|
inline |
Definition at line 410 of file layout_manager.h.
References startup_reapply_pending_protection_.
|
inline |
Definition at line 413 of file layout_manager.h.
References current_editor_type_.
|
inline |
Definition at line 416 of file layout_manager.h.
References editor_host_size_.
| absl::Status yaze::editor::LayoutManager::MaybeReapplyStartupLayout | ( | UserSettings * | settings | ) |
One-shot startup hook that re-applies the user's last applied named layout, if any.
Drives idempotently from UserSettings::last_applied_layout_name
named_layouts. The first frame this is called with a valid main_dockspace_id_ (i.e. after the controller has rendered at least one DockSpaceWindow), the matching layout is parsed, validated, and applied to the live dockspace; subsequent calls are no-ops.Failure modes are absorbed (logged, internally consumed) rather than propagated, because there is no useful caller-side recovery for "the layout the user picked yesterday no longer parses": the editor falls through to whatever default layout the workspace shell already built. The Status return is for observability and tests.
Skipped paths (return OK, leave the consumed flag clear so the caller can retry next frame):
main_dockspace_id_ == 0 (dockspace not bound yet).Skipped paths (return OK, set consumed):
settings == nullptr.last_applied_layout_name is empty.Failure paths (return error status, set consumed):
named_layouts.ApplyDockTree returns non-OK.| settings | UserSettings to read named_layouts and last_applied_layout_name from. May be null. |
Definition at line 2420 of file layout_manager.cc.
References yaze::editor::UserSettings::Preferences::last_applied_layout_name, yaze::editor::UserSettings::Preferences::named_layouts, and yaze::editor::UserSettings::prefs().

| absl::StatusOr< layout_designer::DockTree > yaze::editor::LayoutManager::CaptureDockTree | ( | ImGuiID | dockspace_id | ) | const |
Capture the current docking state into a DockTree.
Walks ImGui's internal dock node tree rooted at dockspace_id and samples splits + leaf windows. Unknown windows (those not registered against the bound WorkspaceWindowManager) are dropped. Split ratios are recovered from measured node sizes; X-axis splits always emit SplitDirection::kLeft and Y-axis splits emit kUp (direction is lossy, since a 0.4 right-placed split is visually identical to a 0.4 left-placed split).
| dockspace_id | ImGui dockspace to sample. |
dockspace_id; the captured tree otherwise. Definition at line 2496 of file layout_manager.cc.
References yaze::editor::layout_designer::DockTree::root.
|
private |
Definition at line 1221 of file layout_manager.cc.
References LOG_WARN.
Referenced by InitializeEditorLayout(), and RebuildLayout().
|
private |
Definition at line 132 of file layout_manager.cc.
References lazy_default_dock_state_.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 136 of file layout_manager.cc.
References yaze::editor::PanelLayoutPreset::dock_only_default_visible_panels, yaze::editor::LayoutManager::LazyDefaultDockState::enabled, yaze::editor::WorkspaceWindowManager::GetActiveSessionId(), yaze::editor::LayoutPresets::GetDefaultPreset(), lazy_default_dock_attempts_, lazy_default_dock_state_, RestoreLazyDefaultDockState(), and window_manager_.
Referenced by InitializeEditorLayout().

|
private |
Definition at line 165 of file layout_manager.cc.
References yaze::editor::PanelLayoutPreset::default_visible_panels, DockPresetPositionOnFirstOpen(), yaze::editor::WorkspaceWindowManager::GetActiveSessionId(), yaze::editor::LayoutPresets::GetDefaultPreset(), yaze::editor::WorkspaceWindowManager::IsWindowOpen(), yaze::editor::PanelLayoutPreset::optional_panels, and window_manager_.
Referenced by InitializeEditorLayout(), and RebuildLayout().

|
private |
Definition at line 1408 of file layout_manager.cc.
References yaze::editor::PanelLayoutPreset::default_visible_panels, yaze::editor::PanelLayoutPreset::dock_only_default_visible_panels, and yaze::editor::PanelLayoutPreset::panel_positions.
Referenced by DockOpenPresetPanels().
|
private |
Definition at line 158 of file layout_manager.cc.
References yaze::editor::LayoutManager::LazyDefaultDockState::attempted_panels, lazy_default_dock_attempts_, and lazy_default_dock_state_.
|
private |
Definition at line 910 of file layout_manager.cc.
|
private |
Definition at line 918 of file layout_manager.cc.
References yaze::editor::LayoutManager::LazyDefaultDockState::enabled.
Referenced by RefreshLazyDefaultDockingContext().
|
private |
Definition at line 820 of file layout_manager.cc.
|
private |
Definition at line 855 of file layout_manager.cc.
|
private |
Definition at line 869 of file layout_manager.cc.
|
private |
Definition at line 895 of file layout_manager.cc.
References yaze::gui::DockSpaceRenderer::GetLastDockspaceSize().
Referenced by InitializeEditorLayout(), and RebuildLayout().

|
private |
Definition at line 1014 of file layout_manager.cc.
|
private |
Definition at line 186 of file layout_manager.cc.
References current_editor_type_, yaze::editor::kUnknown, MarkLayoutInitialized(), and startup_reapply_pending_protection_.

|
private |
Definition at line 1949 of file layout_manager.cc.
References yaze::Json::contains(), yaze::Json::is_object(), yaze::Json::items(), LOG_INFO, and LOG_WARN.

|
private |
Definition at line 2012 of file layout_manager.cc.
References yaze::Json::dump(), yaze::util::PlatformPaths::EnsureDirectoryExists(), LOG_WARN, and yaze::Json::object().

|
staticconstexpr |
Layout revision written to imgui.ini. A mismatch resets dock trees.
Definition at line 388 of file layout_manager.h.
|
private |
Definition at line 501 of file layout_manager.h.
Referenced by RebuildLayout().
|
private |
Definition at line 511 of file layout_manager.h.
Referenced by InitializeEditorLayout(), and RebuildLayout().
|
private |
Definition at line 514 of file layout_manager.h.
Referenced by DockOpenPresetPanels(), InitializeEditorLayout(), RebuildLayout(), RefreshLazyDefaultDockingContext(), SetWindowManager(), and window_manager().
|
private |
Definition at line 517 of file layout_manager.h.
Referenced by ClearRebuildRequest(), IsRebuildRequested(), and RequestRebuild().
|
private |
Definition at line 520 of file layout_manager.h.
Referenced by InitializeEditorLayout(), and RebuildLayout().
|
private |
Definition at line 525 of file layout_manager.h.
Referenced by SetMainDockspaceId().
|
private |
Definition at line 530 of file layout_manager.h.
Referenced by reset_startup_layout_consumed_for_test(), and startup_layout_consumed_for_test().
|
private |
Definition at line 540 of file layout_manager.h.
Referenced by InitializeEditorLayout(), ProtectRestoredLayoutFromDefaultInitialization(), and startup_reapply_pending_protection_for_test().
|
private |
Definition at line 543 of file layout_manager.h.
Referenced by InitializeEditorLayout(), ProtectRestoredLayoutFromDefaultInitialization(), RebuildLayout(), and set_current_editor_type_for_test().
|
private |
Definition at line 547 of file layout_manager.h.
Referenced by active_editor_type(), InitializeEditorLayout(), RebuildLayout(), and SetActiveEditorType().
|
private |
Definition at line 550 of file layout_manager.h.
Referenced by set_editor_host_size_for_test().
|
private |
Definition at line 560 of file layout_manager.h.
|
private |
Definition at line 561 of file layout_manager.h.
|
private |
Definition at line 565 of file layout_manager.h.
Referenced by pin_dir().
|
private |
Definition at line 566 of file layout_manager.h.
Referenced by pin_size().
|
private |
Definition at line 570 of file layout_manager.h.
|
private |
Definition at line 596 of file layout_manager.h.
Referenced by DisableLazyDefaultDocking(), MarkLazyDefaultDockAttempted(), and RefreshLazyDefaultDockingContext().
|
private |
Definition at line 598 of file layout_manager.h.
|
private |
Definition at line 601 of file layout_manager.h.
Referenced by MarkLazyDefaultDockAttempted(), and RefreshLazyDefaultDockingContext().
|
private |
Definition at line 605 of file layout_manager.h.
|
private |
Definition at line 608 of file layout_manager.h.
Referenced by HasTemporarySessionLayout().
|
private |
Definition at line 609 of file layout_manager.h.
|
private |
Definition at line 610 of file layout_manager.h.
|
private |
Definition at line 611 of file layout_manager.h.
|
private |
Definition at line 612 of file layout_manager.h.
|
private |
Definition at line 622 of file layout_manager.h.
|
private |
Definition at line 625 of file layout_manager.h.
|
private |
Definition at line 629 of file layout_manager.h.
|
private |
Definition at line 632 of file layout_manager.h.
|
private |
Definition at line 635 of file layout_manager.h.