yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::LayoutOrchestrator Class Reference

Coordinates between LayoutManager, PanelManager, and LayoutPresets. More...

#include <layout_orchestrator.h>

Collaboration diagram for yaze::editor::LayoutOrchestrator:

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.
 
LayoutManagerlayout_manager ()
 Get the layout manager.
 
PanelManagerpanel_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

LayoutManagerlayout_manager_ = nullptr
 
PanelManagerpanel_manager_ = nullptr
 
bool rebuild_requested_ = false
 

Detailed Description

Coordinates between LayoutManager, PanelManager, and LayoutPresets.

This class unifies the card and layout systems by:

  1. Using PanelInfo.window_title for DockBuilder operations
  2. Applying layout presets that show/hide cards appropriately
  3. Managing the relationship between card IDs and their window titles

Usage: LayoutOrchestrator orchestrator(&layout_manager, &card_registry); orchestrator.ApplyPreset(EditorType::kDungeon, session_id);

Definition at line 28 of file layout_orchestrator.h.

Constructor & Destructor Documentation

◆ LayoutOrchestrator() [1/2]

yaze::editor::LayoutOrchestrator::LayoutOrchestrator ( )
default

◆ LayoutOrchestrator() [2/2]

yaze::editor::LayoutOrchestrator::LayoutOrchestrator ( LayoutManager * layout_manager,
PanelManager * panel_manager )

Definition at line 8 of file layout_orchestrator.cc.

Member Function Documentation

◆ Initialize()

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_.

Here is the call graph for this function:

◆ ApplyPreset()

void yaze::editor::LayoutOrchestrator::ApplyPreset ( EditorType type,
size_t session_id = 0 )

Apply the default layout preset for an editor type.

Parameters
typeThe editor type to apply preset for
session_idSession ID for multi-session support (default = 0)

This method:

  1. Shows default cards for the editor type
  2. Hides optional cards (they can be shown manually)
  3. Applies the DockBuilder layout

Definition at line 18 of file layout_orchestrator.cc.

References ApplyDockLayout(), yaze::editor::LayoutPresets::GetDefaultPreset(), HideOptionalPanels(), IsInitialized(), and ShowPresetPanels().

Referenced by ResetToDefault().

◆ ApplyNamedPreset()

void yaze::editor::LayoutOrchestrator::ApplyNamedPreset ( const std::string & preset_name,
size_t session_id = 0 )

Apply a named workspace preset (Developer, Designer, Modder)

Parameters
preset_nameName of the preset to apply
session_idSession 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().

◆ ResetToDefault()

void yaze::editor::LayoutOrchestrator::ResetToDefault ( EditorType type,
size_t session_id = 0 )

Reset to default layout for an editor type.

Parameters
typeThe editor type
session_idSession ID (default = 0)

Definition at line 60 of file layout_orchestrator.cc.

References ApplyPreset(), and RequestLayoutRebuild().

Here is the call graph for this function:

◆ GetWindowTitle()

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.

Parameters
card_idThe card ID
session_idSession ID (default = 0)
Returns
Window title string, or empty if not found

Definition at line 65 of file layout_orchestrator.cc.

References yaze::editor::PanelManager::GetPanelDescriptor(), yaze::editor::PanelDescriptor::GetWindowTitle(), and panel_manager_.

Here is the call graph for this function:

◆ GetVisiblePanels()

std::vector< std::string > yaze::editor::LayoutOrchestrator::GetVisiblePanels ( size_t session_id) const

Get all visible panels for a session.

Parameters
session_idThe session ID
Returns
Vector of visible panel IDs

Definition at line 79 of file layout_orchestrator.cc.

◆ ShowPresetPanels()

void yaze::editor::LayoutOrchestrator::ShowPresetPanels ( const PanelLayoutPreset & preset,
size_t session_id,
EditorType editor_type )

Show panels specified in a preset.

Parameters
presetThe preset containing panels to show
session_idOptional 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().

Here is the call graph for this function:

◆ HideOptionalPanels()

void yaze::editor::LayoutOrchestrator::HideOptionalPanels ( EditorType type,
size_t session_id = 0 )

Hide all optional panels for an editor type.

Parameters
typeThe editor type
session_idOptional 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().

Here is the call graph for this function:

◆ RequestLayoutRebuild()

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().

Here is the call graph for this function:

◆ layout_manager()

LayoutManager * yaze::editor::LayoutOrchestrator::layout_manager ( )
inline

Get the layout manager.

Definition at line 107 of file layout_orchestrator.h.

References layout_manager_.

Referenced by Initialize().

◆ panel_manager()

PanelManager * yaze::editor::LayoutOrchestrator::panel_manager ( )
inline

Get the card registry.

Definition at line 112 of file layout_orchestrator.h.

References panel_manager_.

Referenced by Initialize().

◆ IsInitialized()

bool yaze::editor::LayoutOrchestrator::IsInitialized ( ) const
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().

◆ ApplyDockLayout()

◆ GetPrefixedPanelId()

std::string yaze::editor::LayoutOrchestrator::GetPrefixedPanelId ( const std::string & card_id,
size_t session_id ) const
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_.

Here is the call graph for this function:

Member Data Documentation

◆ layout_manager_

LayoutManager* yaze::editor::LayoutOrchestrator::layout_manager_ = nullptr
private

◆ panel_manager_

PanelManager* yaze::editor::LayoutOrchestrator::panel_manager_ = nullptr
private

◆ rebuild_requested_

bool yaze::editor::LayoutOrchestrator::rebuild_requested_ = false
private

Definition at line 135 of file layout_orchestrator.h.

Referenced by RequestLayoutRebuild().


The documentation for this class was generated from the following files: