Manages ImGui DockBuilder layouts for each editor type. More...
#include <layout_manager.h>
Public Member Functions | |
LayoutManager ()=default | |
~LayoutManager ()=default | |
void | InitializeEditorLayout (EditorType type, ImGuiID dockspace_id) |
Initialize the default layout for a specific editor type. | |
void | SaveCurrentLayout (const std::string &name) |
Save the current layout with a custom name. | |
void | LoadLayout (const std::string &name) |
Load a saved layout by name. | |
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) | |
Private Member Functions | |
void | BuildOverworldLayout (ImGuiID dockspace_id) |
void | BuildDungeonLayout (ImGuiID dockspace_id) |
void | BuildGraphicsLayout (ImGuiID dockspace_id) |
void | BuildPaletteLayout (ImGuiID dockspace_id) |
void | BuildScreenLayout (ImGuiID dockspace_id) |
void | BuildMusicLayout (ImGuiID dockspace_id) |
void | BuildSpriteLayout (ImGuiID dockspace_id) |
void | BuildMessageLayout (ImGuiID dockspace_id) |
void | BuildAssemblyLayout (ImGuiID dockspace_id) |
void | BuildSettingsLayout (ImGuiID dockspace_id) |
Private Attributes | |
std::unordered_map< EditorType, bool > | layouts_initialized_ |
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 27 of file layout_manager.h.
|
default |
|
default |
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 10 of file layout_manager.cc.
References BuildAssemblyLayout(), BuildDungeonLayout(), BuildGraphicsLayout(), BuildMessageLayout(), BuildMusicLayout(), BuildOverworldLayout(), BuildPaletteLayout(), BuildScreenLayout(), BuildSettingsLayout(), BuildSpriteLayout(), IsLayoutInitialized(), yaze::editor::kAssembly, yaze::editor::kDungeon, yaze::editor::kGraphics, yaze::editor::kMessage, yaze::editor::kMusic, yaze::editor::kOverworld, yaze::editor::kPalette, yaze::editor::kScreen, yaze::editor::kSettings, yaze::editor::kSprite, LOG_INFO, LOG_WARN, and MarkLayoutInitialized().
void yaze::editor::LayoutManager::SaveCurrentLayout | ( | const std::string & | name | ) |
Save the current layout with a custom name.
name | The name to save the layout under |
Definition at line 377 of file layout_manager.cc.
References LOG_INFO.
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 383 of file layout_manager.cc.
References LOG_INFO.
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 389 of file layout_manager.cc.
References layouts_initialized_, and LOG_INFO.
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 395 of file layout_manager.cc.
References layouts_initialized_.
Referenced by InitializeEditorLayout().
void yaze::editor::LayoutManager::MarkLayoutInitialized | ( | EditorType | type | ) |
Mark a layout as initialized.
type | The editor type to mark |
Definition at line 400 of file layout_manager.cc.
References layouts_initialized_, and LOG_INFO.
Referenced by InitializeEditorLayout().
void yaze::editor::LayoutManager::ClearInitializationFlags | ( | ) |
Clear all initialization flags (for testing)
Definition at line 406 of file layout_manager.cc.
References layouts_initialized_, and LOG_INFO.
|
private |
Definition at line 74 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 121 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 162 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 194 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 232 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 263 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 288 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 305 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 337 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 360 of file layout_manager.cc.
Referenced by InitializeEditorLayout().
|
private |
Definition at line 89 of file layout_manager.h.
Referenced by ClearInitializationFlags(), IsLayoutInitialized(), MarkLayoutInitialized(), and ResetToDefaultLayout().