Coordinates between LayoutManager, PanelManager, and LayoutPresets. More...
#include <layout_orchestrator.h>

Public Member Functions | |
| LayoutOrchestrator ()=default | |
| LayoutOrchestrator (LayoutManager *layout_manager, PanelManager *panel_manager) | |
| void | Initialize (LayoutManager *layout_manager, PanelManager *panel_manager) |
| Initialize with dependencies. | |
| void | ApplyPreset (EditorType type, size_t session_id=0) |
| Apply the default layout preset for an editor type. | |
| void | ApplyNamedPreset (const std::string &preset_name, size_t session_id=0) |
| Apply a named workspace preset (Developer, Designer, Modder) | |
| void | ResetToDefault (EditorType type, size_t session_id=0) |
| Reset to default layout for an editor type. | |
| std::string | GetWindowTitle (const std::string &card_id, size_t session_id=0) const |
| Get window title for a card from the registry. | |
| std::vector< std::string > | GetVisiblePanels (size_t session_id) const |
| Get all visible panels for a session. | |
| void | ShowPresetPanels (const PanelLayoutPreset &preset, size_t session_id, EditorType editor_type) |
| Show panels specified in a preset. | |
| void | HideOptionalPanels (EditorType type, size_t session_id=0) |
| Hide all optional panels for an editor type. | |
| void | RequestLayoutRebuild () |
| Request layout rebuild on next frame. | |
| LayoutManager * | layout_manager () |
| Get the layout manager. | |
| PanelManager * | panel_manager () |
| Get the card registry. | |
| bool | IsInitialized () const |
| Check if orchestrator is properly initialized. | |
Private Member Functions | |
| void | ApplyDockLayout (EditorType type) |
| Apply DockBuilder layout for an editor type. | |
| std::string | GetPrefixedPanelId (const std::string &card_id, size_t session_id) const |
| Get prefixed card ID for a session. | |
Private Attributes | |
| LayoutManager * | layout_manager_ = nullptr |
| PanelManager * | panel_manager_ = nullptr |
| bool | rebuild_requested_ = false |
Coordinates between LayoutManager, PanelManager, and LayoutPresets.
This class unifies the card and layout systems by:
Usage: LayoutOrchestrator orchestrator(&layout_manager, &card_registry); orchestrator.ApplyPreset(EditorType::kDungeon, session_id);
Definition at line 28 of file layout_orchestrator.h.
|
default |
| yaze::editor::LayoutOrchestrator::LayoutOrchestrator | ( | LayoutManager * | layout_manager, |
| PanelManager * | panel_manager ) |
Definition at line 8 of file layout_orchestrator.cc.
| void yaze::editor::LayoutOrchestrator::Initialize | ( | LayoutManager * | layout_manager, |
| PanelManager * | panel_manager ) |
Initialize with dependencies.
Definition at line 12 of file layout_orchestrator.cc.
References layout_manager(), layout_manager_, panel_manager(), and panel_manager_.

| void yaze::editor::LayoutOrchestrator::ApplyPreset | ( | EditorType | type, |
| size_t | session_id = 0 ) |
Apply the default layout preset for an editor type.
| type | The editor type to apply preset for |
| session_id | Session ID for multi-session support (default = 0) |
This method:
Definition at line 18 of file layout_orchestrator.cc.
References ApplyDockLayout(), yaze::editor::LayoutPresets::GetDefaultPreset(), HideOptionalPanels(), IsInitialized(), and ShowPresetPanels().
Referenced by ResetToDefault().
| void yaze::editor::LayoutOrchestrator::ApplyNamedPreset | ( | const std::string & | preset_name, |
| size_t | session_id = 0 ) |
Apply a named workspace preset (Developer, Designer, Modder)
| preset_name | Name of the preset to apply |
| session_id | Session ID (default = 0) |
Definition at line 36 of file layout_orchestrator.cc.
References yaze::editor::LayoutPresets::GetDesignerPreset(), yaze::editor::LayoutPresets::GetDeveloperPreset(), yaze::editor::LayoutPresets::GetMinimalPreset(), yaze::editor::LayoutPresets::GetModderPreset(), IsInitialized(), yaze::editor::kUnknown, RequestLayoutRebuild(), and ShowPresetPanels().
| void yaze::editor::LayoutOrchestrator::ResetToDefault | ( | EditorType | type, |
| size_t | session_id = 0 ) |
Reset to default layout for an editor type.
| type | The editor type |
| session_id | Session ID (default = 0) |
Definition at line 60 of file layout_orchestrator.cc.
References ApplyPreset(), and RequestLayoutRebuild().

| std::string yaze::editor::LayoutOrchestrator::GetWindowTitle | ( | const std::string & | card_id, |
| size_t | session_id = 0 ) const |
Get window title for a card from the registry.
| card_id | The card ID |
| session_id | Session ID (default = 0) |
Definition at line 65 of file layout_orchestrator.cc.
References yaze::editor::PanelManager::GetPanelDescriptor(), yaze::editor::PanelDescriptor::GetWindowTitle(), and panel_manager_.

| std::vector< std::string > yaze::editor::LayoutOrchestrator::GetVisiblePanels | ( | size_t | session_id | ) | const |
Get all visible panels for a session.
| session_id | The session ID |
Definition at line 79 of file layout_orchestrator.cc.
| void yaze::editor::LayoutOrchestrator::ShowPresetPanels | ( | const PanelLayoutPreset & | preset, |
| size_t | session_id, | ||
| EditorType | editor_type ) |
Show panels specified in a preset.
| preset | The preset containing panels to show |
| session_id | Optional session ID |
Definition at line 86 of file layout_orchestrator.cc.
References yaze::editor::PanelLayoutPreset::default_visible_panels, panel_manager_, and yaze::editor::PanelManager::ShowPanel().
Referenced by ApplyNamedPreset(), and ApplyPreset().

| void yaze::editor::LayoutOrchestrator::HideOptionalPanels | ( | EditorType | type, |
| size_t | session_id = 0 ) |
Hide all optional panels for an editor type.
| type | The editor type |
| session_id | Optional session ID |
Definition at line 98 of file layout_orchestrator.cc.
References yaze::editor::LayoutPresets::GetDefaultPreset(), yaze::editor::PanelManager::HidePanel(), and panel_manager_.
Referenced by ApplyPreset().

| void yaze::editor::LayoutOrchestrator::RequestLayoutRebuild | ( | ) |
Request layout rebuild on next frame.
Definition at line 110 of file layout_orchestrator.cc.
References layout_manager_, rebuild_requested_, and yaze::editor::LayoutManager::RequestRebuild().
Referenced by ApplyNamedPreset(), and ResetToDefault().

|
inline |
Get the layout manager.
Definition at line 107 of file layout_orchestrator.h.
References layout_manager_.
Referenced by Initialize().
|
inline |
Get the card registry.
Definition at line 112 of file layout_orchestrator.h.
References panel_manager_.
Referenced by Initialize().
|
inline |
Check if orchestrator is properly initialized.
Definition at line 117 of file layout_orchestrator.h.
References layout_manager_, and panel_manager_.
Referenced by ApplyNamedPreset(), and ApplyPreset().
|
private |
Apply DockBuilder layout for an editor type.
Definition at line 117 of file layout_orchestrator.cc.
References yaze::editor::kAssembly, yaze::editor::kDefault, yaze::editor::kDungeon, yaze::editor::kEmulator, yaze::editor::kGraphics, yaze::editor::kMessage, yaze::editor::kMusic, yaze::editor::kOverworld, yaze::editor::kPalette, yaze::editor::kScreen, yaze::editor::kSettings, yaze::editor::kSprite, layout_manager_, yaze::editor::LayoutManager::RequestRebuild(), and yaze::editor::LayoutManager::SetLayoutType().
Referenced by ApplyPreset().

|
private |
Get prefixed card ID for a session.
Definition at line 167 of file layout_orchestrator.cc.
References yaze::editor::PanelManager::MakePanelId(), and panel_manager_.

|
private |
Definition at line 133 of file layout_orchestrator.h.
Referenced by ApplyDockLayout(), Initialize(), IsInitialized(), layout_manager(), and RequestLayoutRebuild().
|
private |
Definition at line 134 of file layout_orchestrator.h.
Referenced by GetPrefixedPanelId(), GetWindowTitle(), HideOptionalPanels(), Initialize(), IsInitialized(), panel_manager(), and ShowPresetPanels().
|
private |
Definition at line 135 of file layout_orchestrator.h.
Referenced by RequestLayoutRebuild().