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

Central registry for all editor cards with session awareness and dependency injection. More...

#include <panel_manager.h>

Classes

struct  CategoryTheme
 Get the expressive theme color for a category. More...
 
struct  PanelValidationResult
 
struct  WorkspacePreset
 

Public Member Functions

 PanelManager ()=default
 
 ~PanelManager ()=default
 
 PanelManager (const PanelManager &)=delete
 
PanelManageroperator= (const PanelManager &)=delete
 
 PanelManager (PanelManager &&)=delete
 
PanelManageroperator= (PanelManager &&)=delete
 
void RegisterSession (size_t session_id)
 
void UnregisterSession (size_t session_id)
 
void SetActiveSession (size_t session_id)
 
void RegisterPanel (size_t session_id, const PanelDescriptor &base_info)
 
void RegisterPanel (size_t session_id, const std::string &card_id, const std::string &display_name, const std::string &icon, const std::string &category, const std::string &shortcut_hint="", int priority=50, std::function< void()> on_show=nullptr, std::function< void()> on_hide=nullptr, bool visible_by_default=false)
 
void UnregisterPanel (size_t session_id, const std::string &base_card_id)
 
void UnregisterPanelsWithPrefix (const std::string &prefix)
 
void ClearAllPanels ()
 
void RegisterEditorPanel (std::unique_ptr< EditorPanel > panel)
 Register an EditorPanel instance for central drawing.
 
void UnregisterEditorPanel (const std::string &panel_id)
 Unregister and destroy an EditorPanel instance.
 
EditorPanelGetEditorPanel (const std::string &panel_id)
 Get an EditorPanel instance by ID.
 
void DrawAllVisiblePanels ()
 Draw all visible EditorPanel instances (central drawing)
 
void OnEditorSwitch (const std::string &from_category, const std::string &to_category)
 Handle editor/category switching for panel visibility.
 
bool ShowPanel (size_t session_id, const std::string &base_card_id)
 
bool HidePanel (size_t session_id, const std::string &base_card_id)
 
bool TogglePanel (size_t session_id, const std::string &base_card_id)
 
bool IsPanelVisible (size_t session_id, const std::string &base_card_id) const
 
bool * GetVisibilityFlag (size_t session_id, const std::string &base_card_id)
 
void ShowAllPanelsInSession (size_t session_id)
 
void HideAllPanelsInSession (size_t session_id)
 
void ShowAllPanelsInCategory (size_t session_id, const std::string &category)
 
void HideAllPanelsInCategory (size_t session_id, const std::string &category)
 
void ShowOnlyPanel (size_t session_id, const std::string &base_card_id)
 
std::vector< std::string > GetPanelsInSession (size_t session_id) const
 
std::vector< PanelDescriptorGetPanelsInCategory (size_t session_id, const std::string &category) const
 
std::vector< std::string > GetAllCategories (size_t session_id) const
 
const PanelDescriptorGetPanelDescriptor (size_t session_id, const std::string &base_card_id) const
 
const std::unordered_map< std::string, PanelDescriptor > & GetAllPanelDescriptors () const
 Get all panel descriptors (for layout designer, panel browser, etc.)
 
std::vector< std::string > GetAllCategories () const
 
void HandleSidebarKeyboardNav (size_t session_id, const std::vector< PanelDescriptor > &cards)
 Handle keyboard navigation in sidebar (click-to-focus modal)
 
bool SidebarHasFocus () const
 
int GetFocusedPanelIndex () const
 
void ToggleSidebarVisibility ()
 
void SetSidebarVisible (bool visible)
 
bool IsSidebarVisible () const
 
void TogglePanelExpanded ()
 
void SetPanelExpanded (bool expanded)
 
bool IsPanelExpanded () const
 
void TriggerShowEmulator ()
 
void TriggerShowSettings ()
 
void TriggerShowPanelBrowser ()
 
void TriggerSaveRom ()
 
void TriggerUndo ()
 
void TriggerRedo ()
 
void TriggerShowSearch ()
 
void TriggerShowShortcuts ()
 
void TriggerShowCommandPalette ()
 
void TriggerShowHelp ()
 
void TriggerOpenRom ()
 
void TriggerPanelClicked (const std::string &category)
 
void TriggerCategorySelected (const std::string &category)
 
void SetShowEmulatorCallback (std::function< void()> cb)
 
void SetShowSettingsCallback (std::function< void()> cb)
 
void SetShowPanelBrowserCallback (std::function< void()> cb)
 
void SetSaveRomCallback (std::function< void()> cb)
 
void SetUndoCallback (std::function< void()> cb)
 
void SetRedoCallback (std::function< void()> cb)
 
void SetShowSearchCallback (std::function< void()> cb)
 
void SetShowShortcutsCallback (std::function< void()> cb)
 
void SetShowCommandPaletteCallback (std::function< void()> cb)
 
void SetShowHelpCallback (std::function< void()> cb)
 
void SetOpenRomCallback (std::function< void()> cb)
 
void SetSidebarStateChangedCallback (std::function< void(bool, bool)> cb)
 
bool IsEmulatorVisible () const
 
void SetEmulatorVisible (bool visible)
 
void ToggleEmulatorVisible ()
 
void SetEmulatorVisibilityChangedCallback (std::function< void(bool)> cb)
 
void SetCategoryChangedCallback (std::function< void(const std::string &)> cb)
 
void SavePreset (const std::string &name, const std::string &description="")
 
bool LoadPreset (const std::string &name)
 
void DeletePreset (const std::string &name)
 
std::vector< WorkspacePresetGetPresets () const
 
std::vector< PanelValidationResultValidatePanels () const
 
PanelValidationResult ValidatePanel (const std::string &card_id) const
 
void ShowAll (size_t session_id)
 
void HideAll (size_t session_id)
 
void ResetToDefaults (size_t session_id)
 
void ResetToDefaults (size_t session_id, EditorType editor_type)
 
size_t GetPanelCount () const
 
size_t GetVisiblePanelCount (size_t session_id) const
 
size_t GetSessionCount () const
 
std::string MakePanelId (size_t session_id, const std::string &base_id) const
 
bool ShouldPrefixPanels () const
 
void RegisterPanel (const PanelDescriptor &base_info)
 
void UnregisterPanel (const std::string &base_card_id)
 
bool ShowPanel (const std::string &base_card_id)
 
bool HidePanel (const std::string &base_card_id)
 
bool IsPanelVisible (const std::string &base_card_id) const
 
void HideAllPanelsInCategory (const std::string &category)
 
std::string GetActiveCategory () const
 
void SetActiveCategory (const std::string &category)
 
void ShowAllPanelsInCategory (const std::string &category)
 
bool * GetVisibilityFlag (const std::string &base_card_id)
 
void ShowAll ()
 
void HideAll ()
 
void SetOnPanelClickedCallback (std::function< void(const std::string &)> callback)
 
void SetOnCategorySelectedCallback (std::function< void(const std::string &)> callback)
 
size_t GetActiveSessionId () const
 
FileBrowserGetFileBrowser (const std::string &category)
 
void EnableFileBrowser (const std::string &category, const std::string &root_path="")
 
void DisableFileBrowser (const std::string &category)
 
bool HasFileBrowser (const std::string &category) const
 
void SetFileBrowserPath (const std::string &category, const std::string &path)
 
void SetFileClickedCallback (std::function< void(const std::string &category, const std::string &path)> callback)
 
void ToggleFavorite (const std::string &card_id)
 
bool IsFavorite (const std::string &card_id) const
 
void AddToRecent (const std::string &card_id)
 
const std::vector< std::string > & GetRecentPanels () const
 
const std::unordered_set< std::string > & GetFavoritePanels () const
 
void SetPanelPinned (size_t session_id, const std::string &base_card_id, bool pinned)
 
bool IsPanelPinned (size_t session_id, const std::string &base_card_id) const
 
std::vector< std::string > GetPinnedPanels (size_t session_id) const
 
void SetPanelPinned (const std::string &base_card_id, bool pinned)
 
bool IsPanelPinned (const std::string &base_card_id) const
 
std::vector< std::string > GetPinnedPanels () const
 
void EnforceResourceLimits (const std::string &resource_type)
 Enforce limits on resource panels (LRU eviction)
 
void MarkPanelUsed (const std::string &panel_id)
 Mark a panel as recently used (for LRU)
 

Static Public Member Functions

static constexpr float GetSidebarWidth ()
 
static constexpr float GetSidePanelWidth ()
 
static constexpr float GetCollapsedSidebarWidth ()
 
static std::string GetCategoryIcon (const std::string &category)
 
static CategoryTheme GetCategoryTheme (const std::string &category)
 

Static Public Attributes

static constexpr const char * kDashboardCategory = "Dashboard"
 

Private Member Functions

void UpdateSessionCount ()
 
std::string GetPrefixedPanelId (size_t session_id, const std::string &base_id) const
 
void UnregisterSessionPanels (size_t session_id)
 
void SavePresetsToFile ()
 
void LoadPresetsFromFile ()
 

Private Attributes

std::unordered_map< std::string, std::list< std::string > > resource_panels_
 
std::unordered_map< std::string, std::string > panel_resource_types_
 
std::unordered_map< std::string, PanelDescriptorcards_
 
std::unordered_map< std::string, std::unique_ptr< EditorPanel > > panel_instances_
 
std::unordered_set< std::string > favorite_cards_
 
std::vector< std::string > recent_cards_
 
std::unordered_map< std::string, bool > centralized_visibility_
 
std::unordered_map< std::string, bool > pinned_panels_
 
size_t session_count_ = 0
 
size_t active_session_ = 0
 
std::unordered_map< size_t, std::vector< std::string > > session_cards_
 
std::unordered_map< size_t, std::unordered_map< std::string, std::string > > session_card_mapping_
 
std::unordered_map< std::string, WorkspacePresetpresets_
 
std::string active_category_
 
std::vector< std::string > recent_categories_
 
bool sidebar_visible_ = false
 
bool panel_expanded_ = false
 
int focused_card_index_ = -1
 
bool sidebar_has_focus_ = false
 
bool emulator_visible_ = false
 
std::function< void()> on_show_emulator_
 
std::function< void()> on_show_settings_
 
std::function< void()> on_show_panel_browser_
 
std::function< void()> on_save_rom_
 
std::function< void()> on_undo_
 
std::function< void()> on_redo_
 
std::function< void()> on_show_search_
 
std::function< void()> on_show_shortcuts_
 
std::function< void()> on_show_command_palette_
 
std::function< void()> on_show_help_
 
std::function< void()> on_open_rom_
 
std::function< void(bool visible, bool expanded)> on_sidebar_state_changed_
 
std::function< void(const std::string &) on_category_changed_ )
 
std::function< void(const std::string &) on_card_clicked_ )
 
std::function< void(const std::string &) on_category_selected_ )
 
std::function< void(bool)> on_emulator_visibility_changed_
 
std::function< void(const std::string &, const std::string &) on_file_clicked_ )
 
std::unordered_map< std::string, std::unique_ptr< FileBrowser > > category_file_browsers_
 
std::unordered_set< std::string > active_editor_categories_
 

Static Private Attributes

static constexpr size_t kMaxRecentPanels = 10
 
static constexpr size_t kMaxRecentCategories = 5
 

Detailed Description

Central registry for all editor cards with session awareness and dependency injection.

Definition at line 84 of file panel_manager.h.

Constructor & Destructor Documentation

◆ PanelManager() [1/3]

yaze::editor::PanelManager::PanelManager ( )
default

◆ ~PanelManager()

yaze::editor::PanelManager::~PanelManager ( )
default

◆ PanelManager() [2/3]

yaze::editor::PanelManager::PanelManager ( const PanelManager & )
delete

◆ PanelManager() [3/3]

yaze::editor::PanelManager::PanelManager ( PanelManager && )
delete

Member Function Documentation

◆ operator=() [1/2]

PanelManager & yaze::editor::PanelManager::operator= ( const PanelManager & )
delete

◆ operator=() [2/2]

PanelManager & yaze::editor::PanelManager::operator= ( PanelManager && )
delete

◆ RegisterSession()

void yaze::editor::PanelManager::RegisterSession ( size_t session_id)

Definition at line 115 of file panel_manager.cc.

References LOG_INFO, session_card_mapping_, session_cards_, session_count_, and UpdateSessionCount().

Referenced by RegisterPanel().

Here is the call graph for this function:

◆ UnregisterSession()

void yaze::editor::PanelManager::UnregisterSession ( size_t session_id)

◆ SetActiveSession()

void yaze::editor::PanelManager::SetActiveSession ( size_t session_id)

Definition at line 147 of file panel_manager.cc.

References active_session_, and session_cards_.

Referenced by yaze::editor::SessionCoordinator::SwitchToSession().

◆ RegisterPanel() [1/3]

◆ RegisterPanel() [2/3]

void yaze::editor::PanelManager::RegisterPanel ( size_t session_id,
const std::string & card_id,
const std::string & display_name,
const std::string & icon,
const std::string & category,
const std::string & shortcut_hint = "",
int priority = 50,
std::function< void()> on_show = nullptr,
std::function< void()> on_hide = nullptr,
bool visible_by_default = false )

◆ UnregisterPanel() [1/2]

void yaze::editor::PanelManager::UnregisterPanel ( size_t session_id,
const std::string & base_card_id )

◆ UnregisterPanelsWithPrefix()

void yaze::editor::PanelManager::UnregisterPanelsWithPrefix ( const std::string & prefix)

Definition at line 242 of file panel_manager.cc.

References cards_, centralized_visibility_, LOG_INFO, pinned_panels_, and session_cards_.

◆ ClearAllPanels()

void yaze::editor::PanelManager::ClearAllPanels ( )

◆ RegisterEditorPanel()

◆ UnregisterEditorPanel()

void yaze::editor::PanelManager::UnregisterEditorPanel ( const std::string & panel_id)

Unregister and destroy an EditorPanel instance.

Parameters
panel_idThe panel ID to unregister

Definition at line 402 of file panel_manager.cc.

References active_session_, LOG_INFO, panel_instances_, and UnregisterPanel().

Referenced by EnforceResourceLimits().

Here is the call graph for this function:

◆ GetEditorPanel()

EditorPanel * yaze::editor::PanelManager::GetEditorPanel ( const std::string & panel_id)

Get an EditorPanel instance by ID.

Parameters
panel_idThe panel ID
Returns
Pointer to panel, or nullptr if not found

Definition at line 415 of file panel_manager.cc.

References panel_instances_.

◆ DrawAllVisiblePanels()

void yaze::editor::PanelManager::DrawAllVisiblePanels ( )

◆ OnEditorSwitch()

void yaze::editor::PanelManager::OnEditorSwitch ( const std::string & from_category,
const std::string & to_category )

Handle editor/category switching for panel visibility.

Parameters
from_categoryThe category being switched away from
to_categoryThe category being switched to

This method:

  1. Hides non-pinned, non-persistent panels from the previous category
  2. Shows default panels for the new category
  3. Updates the active category

Definition at line 488 of file panel_manager.cc.

References yaze::editor::LayoutPresets::GetDefaultPanels(), yaze::editor::EditorRegistry::GetEditorTypeFromCategory(), HidePanel(), IsPanelPinned(), LOG_INFO, panel_instances_, yaze::editor::Persistent, SetActiveCategory(), and ShowPanel().

Referenced by yaze::editor::EditorActivator::ActivatePanelBasedEditor(), and yaze::editor::EditorActivator::DeactivatePanelBasedEditor().

◆ ShowPanel() [1/2]

◆ HidePanel() [1/2]

bool yaze::editor::PanelManager::HidePanel ( size_t session_id,
const std::string & base_card_id )

Definition at line 541 of file panel_manager.cc.

References cards_, and GetPrefixedPanelId().

Referenced by yaze::editor::LayoutOrchestrator::HideOptionalPanels(), HidePanel(), OnEditorSwitch(), and yaze::editor::UICoordinator::SetEmulatorVisible().

Here is the call graph for this function:

◆ TogglePanel()

bool yaze::editor::PanelManager::TogglePanel ( size_t session_id,
const std::string & base_card_id )

◆ IsPanelVisible() [1/2]

bool yaze::editor::PanelManager::IsPanelVisible ( size_t session_id,
const std::string & base_card_id ) const

◆ GetVisibilityFlag() [1/2]

bool * yaze::editor::PanelManager::GetVisibilityFlag ( size_t session_id,
const std::string & base_card_id )

◆ ShowAllPanelsInSession()

void yaze::editor::PanelManager::ShowAllPanelsInSession ( size_t session_id)

◆ HideAllPanelsInSession()

void yaze::editor::PanelManager::HideAllPanelsInSession ( size_t session_id)

◆ ShowAllPanelsInCategory() [1/2]

void yaze::editor::PanelManager::ShowAllPanelsInCategory ( size_t session_id,
const std::string & category )

◆ HideAllPanelsInCategory() [1/2]

◆ ShowOnlyPanel()

void yaze::editor::PanelManager::ShowOnlyPanel ( size_t session_id,
const std::string & base_card_id )

Definition at line 681 of file panel_manager.cc.

References cards_, GetPrefixedPanelId(), HideAllPanelsInCategory(), and ShowPanel().

Here is the call graph for this function:

◆ GetPanelsInSession()

std::vector< std::string > yaze::editor::PanelManager::GetPanelsInSession ( size_t session_id) const

Definition at line 707 of file panel_manager.cc.

References session_cards_.

Referenced by yaze::editor::ActivityBar::DrawPanelBrowser().

◆ GetPanelsInCategory()

std::vector< PanelDescriptor > yaze::editor::PanelManager::GetPanelsInCategory ( size_t session_id,
const std::string & category ) const

◆ GetAllCategories() [1/2]

std::vector< std::string > yaze::editor::PanelManager::GetAllCategories ( size_t session_id) const

◆ GetPanelDescriptor()

◆ GetAllPanelDescriptors()

const std::unordered_map< std::string, PanelDescriptor > & yaze::editor::PanelManager::GetAllPanelDescriptors ( ) const
inline

Get all panel descriptors (for layout designer, panel browser, etc.)

Returns
Map of panel_id -> PanelDescriptor

Definition at line 209 of file panel_manager.h.

References cards_.

Referenced by yaze::editor::layout_designer::LayoutDesignerWindow::DrawMenuBar(), yaze::editor::layout_designer::LayoutDesignerWindow::GetAvailablePanels(), and yaze::editor::EditorManager::OpenEditorAndPanelsFromFlags().

◆ GetAllCategories() [2/2]

std::vector< std::string > yaze::editor::PanelManager::GetAllCategories ( ) const

Definition at line 772 of file panel_manager.cc.

References cards_.

◆ GetSidebarWidth()

static constexpr float yaze::editor::PanelManager::GetSidebarWidth ( )
inlinestaticconstexpr

◆ GetSidePanelWidth()

static constexpr float yaze::editor::PanelManager::GetSidePanelWidth ( )
inlinestaticconstexpr

◆ GetCollapsedSidebarWidth()

static constexpr float yaze::editor::PanelManager::GetCollapsedSidebarWidth ( )
inlinestaticconstexpr

Definition at line 217 of file panel_manager.h.

◆ GetCategoryIcon()

std::string yaze::editor::PanelManager::GetCategoryIcon ( const std::string & category)
static

◆ GetCategoryTheme()

PanelManager::CategoryTheme yaze::editor::PanelManager::GetCategoryTheme ( const std::string & category)
static

Definition at line 49 of file panel_manager.cc.

Referenced by yaze::editor::ActivityBar::DrawActivityBarStrip().

◆ HandleSidebarKeyboardNav()

void yaze::editor::PanelManager::HandleSidebarKeyboardNav ( size_t session_id,
const std::vector< PanelDescriptor > & cards )

Handle keyboard navigation in sidebar (click-to-focus modal)

Definition at line 787 of file panel_manager.cc.

References focused_card_index_, sidebar_has_focus_, and TogglePanel().

Here is the call graph for this function:

◆ SidebarHasFocus()

bool yaze::editor::PanelManager::SidebarHasFocus ( ) const
inline

Definition at line 238 of file panel_manager.h.

References sidebar_has_focus_.

◆ GetFocusedPanelIndex()

int yaze::editor::PanelManager::GetFocusedPanelIndex ( ) const
inline

Definition at line 239 of file panel_manager.h.

References focused_card_index_.

◆ ToggleSidebarVisibility()

void yaze::editor::PanelManager::ToggleSidebarVisibility ( )
inline

◆ SetSidebarVisible()

◆ IsSidebarVisible()

◆ TogglePanelExpanded()

void yaze::editor::PanelManager::TogglePanelExpanded ( )
inline

◆ SetPanelExpanded()

◆ IsPanelExpanded()

bool yaze::editor::PanelManager::IsPanelExpanded ( ) const
inline

◆ TriggerShowEmulator()

void yaze::editor::PanelManager::TriggerShowEmulator ( )
inline

Definition at line 281 of file panel_manager.h.

References on_show_emulator_.

◆ TriggerShowSettings()

void yaze::editor::PanelManager::TriggerShowSettings ( )
inline

Definition at line 282 of file panel_manager.h.

References on_show_settings_.

Referenced by yaze::editor::ActivityBar::DrawActivityBarStrip().

◆ TriggerShowPanelBrowser()

void yaze::editor::PanelManager::TriggerShowPanelBrowser ( )
inline

Definition at line 283 of file panel_manager.h.

References on_show_panel_browser_.

◆ TriggerSaveRom()

void yaze::editor::PanelManager::TriggerSaveRom ( )
inline

Definition at line 284 of file panel_manager.h.

References on_save_rom_.

◆ TriggerUndo()

void yaze::editor::PanelManager::TriggerUndo ( )
inline

Definition at line 285 of file panel_manager.h.

References on_undo_.

◆ TriggerRedo()

void yaze::editor::PanelManager::TriggerRedo ( )
inline

Definition at line 286 of file panel_manager.h.

References on_redo_.

◆ TriggerShowSearch()

void yaze::editor::PanelManager::TriggerShowSearch ( )
inline

Definition at line 287 of file panel_manager.h.

References on_show_search_.

Referenced by yaze::editor::ActivityBar::DrawActivityBarStrip().

◆ TriggerShowShortcuts()

void yaze::editor::PanelManager::TriggerShowShortcuts ( )
inline

Definition at line 288 of file panel_manager.h.

References on_show_shortcuts_.

Referenced by yaze::editor::ActivityBar::DrawActivityBarStrip().

◆ TriggerShowCommandPalette()

void yaze::editor::PanelManager::TriggerShowCommandPalette ( )
inline

◆ TriggerShowHelp()

void yaze::editor::PanelManager::TriggerShowHelp ( )
inline

Definition at line 290 of file panel_manager.h.

References on_show_help_.

◆ TriggerOpenRom()

void yaze::editor::PanelManager::TriggerOpenRom ( )
inline

Definition at line 291 of file panel_manager.h.

References on_open_rom_.

Referenced by yaze::editor::ActivityBar::DrawActivityBarStrip().

◆ TriggerPanelClicked()

void yaze::editor::PanelManager::TriggerPanelClicked ( const std::string & category)
inline

Definition at line 292 of file panel_manager.h.

References on_card_clicked_.

Referenced by yaze::editor::ActivityBar::DrawSidePanel().

◆ TriggerCategorySelected()

void yaze::editor::PanelManager::TriggerCategorySelected ( const std::string & category)
inline

Definition at line 293 of file panel_manager.h.

References on_category_selected_.

Referenced by yaze::editor::ActivityBar::DrawActivityBarStrip().

◆ SetShowEmulatorCallback()

void yaze::editor::PanelManager::SetShowEmulatorCallback ( std::function< void()> cb)
inline

Definition at line 299 of file panel_manager.h.

References on_show_emulator_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetShowSettingsCallback()

void yaze::editor::PanelManager::SetShowSettingsCallback ( std::function< void()> cb)
inline

◆ SetShowPanelBrowserCallback()

void yaze::editor::PanelManager::SetShowPanelBrowserCallback ( std::function< void()> cb)
inline

Definition at line 305 of file panel_manager.h.

References on_show_panel_browser_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetSaveRomCallback()

void yaze::editor::PanelManager::SetSaveRomCallback ( std::function< void()> cb)
inline

Definition at line 308 of file panel_manager.h.

References on_save_rom_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetUndoCallback()

void yaze::editor::PanelManager::SetUndoCallback ( std::function< void()> cb)
inline

Definition at line 311 of file panel_manager.h.

References on_undo_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetRedoCallback()

void yaze::editor::PanelManager::SetRedoCallback ( std::function< void()> cb)
inline

Definition at line 314 of file panel_manager.h.

References on_redo_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetShowSearchCallback()

void yaze::editor::PanelManager::SetShowSearchCallback ( std::function< void()> cb)
inline

Definition at line 317 of file panel_manager.h.

References on_show_search_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetShowShortcutsCallback()

void yaze::editor::PanelManager::SetShowShortcutsCallback ( std::function< void()> cb)
inline

Definition at line 320 of file panel_manager.h.

References on_show_shortcuts_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetShowCommandPaletteCallback()

void yaze::editor::PanelManager::SetShowCommandPaletteCallback ( std::function< void()> cb)
inline

Definition at line 323 of file panel_manager.h.

References on_show_command_palette_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetShowHelpCallback()

void yaze::editor::PanelManager::SetShowHelpCallback ( std::function< void()> cb)
inline

◆ SetOpenRomCallback()

void yaze::editor::PanelManager::SetOpenRomCallback ( std::function< void()> cb)
inline

Definition at line 329 of file panel_manager.h.

References on_open_rom_.

◆ SetSidebarStateChangedCallback()

void yaze::editor::PanelManager::SetSidebarStateChangedCallback ( std::function< void(bool, bool)> cb)
inline

Definition at line 332 of file panel_manager.h.

References on_sidebar_state_changed_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ IsEmulatorVisible()

bool yaze::editor::PanelManager::IsEmulatorVisible ( ) const
inline

Definition at line 341 of file panel_manager.h.

References emulator_visible_.

◆ SetEmulatorVisible()

void yaze::editor::PanelManager::SetEmulatorVisible ( bool visible)
inline

Definition at line 342 of file panel_manager.h.

References emulator_visible_, and on_emulator_visibility_changed_.

Referenced by ToggleEmulatorVisible().

◆ ToggleEmulatorVisible()

void yaze::editor::PanelManager::ToggleEmulatorVisible ( )
inline

Definition at line 350 of file panel_manager.h.

References emulator_visible_, and SetEmulatorVisible().

Here is the call graph for this function:

◆ SetEmulatorVisibilityChangedCallback()

void yaze::editor::PanelManager::SetEmulatorVisibilityChangedCallback ( std::function< void(bool)> cb)
inline

Definition at line 351 of file panel_manager.h.

References on_emulator_visibility_changed_.

◆ SetCategoryChangedCallback()

void yaze::editor::PanelManager::SetCategoryChangedCallback ( std::function< void(const std::string &)> cb)
inline

Definition at line 354 of file panel_manager.h.

References on_category_changed_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SavePreset()

void yaze::editor::PanelManager::SavePreset ( const std::string & name,
const std::string & description = "" )

◆ LoadPreset()

bool yaze::editor::PanelManager::LoadPreset ( const std::string & name)

Definition at line 894 of file panel_manager.cc.

References cards_, LOG_INFO, and presets_.

◆ DeletePreset()

void yaze::editor::PanelManager::DeletePreset ( const std::string & name)

Definition at line 922 of file panel_manager.cc.

References presets_, and SavePresetsToFile().

Here is the call graph for this function:

◆ GetPresets()

std::vector< PanelManager::WorkspacePreset > yaze::editor::PanelManager::GetPresets ( ) const

Definition at line 928 of file panel_manager.cc.

References presets_.

◆ ValidatePanels()

std::vector< PanelManager::PanelValidationResult > yaze::editor::PanelManager::ValidatePanels ( ) const

Definition at line 1319 of file panel_manager.cc.

References cards_, and ValidatePanel().

Here is the call graph for this function:

◆ ValidatePanel()

◆ ShowAll() [1/2]

void yaze::editor::PanelManager::ShowAll ( size_t session_id)

Definition at line 940 of file panel_manager.cc.

References ShowAllPanelsInSession().

Referenced by yaze::editor::WorkspaceManager::ShowAllWindows().

Here is the call graph for this function:

◆ HideAll() [1/2]

void yaze::editor::PanelManager::HideAll ( size_t session_id)

◆ ResetToDefaults() [1/2]

void yaze::editor::PanelManager::ResetToDefaults ( size_t session_id)
Todo
Load default visibility from config file or hardcoded defaults

Definition at line 948 of file panel_manager.cc.

References HideAllPanelsInSession(), and LOG_INFO.

Referenced by yaze::editor::LayoutCoordinator::ResetCurrentEditorLayout().

Here is the call graph for this function:

◆ ResetToDefaults() [2/2]

void yaze::editor::PanelManager::ResetToDefaults ( size_t session_id,
EditorType editor_type )

◆ GetPanelCount()

size_t yaze::editor::PanelManager::GetPanelCount ( ) const
inline

Definition at line 400 of file panel_manager.h.

References cards_.

◆ GetVisiblePanelCount()

size_t yaze::editor::PanelManager::GetVisiblePanelCount ( size_t session_id) const

Definition at line 991 of file panel_manager.cc.

References cards_, and session_cards_.

◆ GetSessionCount()

size_t yaze::editor::PanelManager::GetSessionCount ( ) const
inline

Definition at line 402 of file panel_manager.h.

References session_count_.

◆ MakePanelId()

std::string yaze::editor::PanelManager::MakePanelId ( size_t session_id,
const std::string & base_id ) const

Definition at line 1011 of file panel_manager.cc.

References ShouldPrefixPanels().

Referenced by yaze::editor::LayoutOrchestrator::GetPrefixedPanelId(), IsPanelPinned(), RegisterPanel(), and SetPanelPinned().

Here is the call graph for this function:

◆ ShouldPrefixPanels()

bool yaze::editor::PanelManager::ShouldPrefixPanels ( ) const
inline

Definition at line 409 of file panel_manager.h.

References session_count_.

Referenced by GetPinnedPanels(), and MakePanelId().

◆ RegisterPanel() [3/3]

void yaze::editor::PanelManager::RegisterPanel ( const PanelDescriptor & base_info)
inline

Definition at line 415 of file panel_manager.h.

References active_session_, and RegisterPanel().

Here is the call graph for this function:

◆ UnregisterPanel() [2/2]

void yaze::editor::PanelManager::UnregisterPanel ( const std::string & base_card_id)
inline

Definition at line 418 of file panel_manager.h.

References active_session_, and UnregisterPanel().

Here is the call graph for this function:

◆ ShowPanel() [2/2]

bool yaze::editor::PanelManager::ShowPanel ( const std::string & base_card_id)
inline

Definition at line 421 of file panel_manager.h.

References active_session_, and ShowPanel().

Here is the call graph for this function:

◆ HidePanel() [2/2]

bool yaze::editor::PanelManager::HidePanel ( const std::string & base_card_id)
inline

Definition at line 424 of file panel_manager.h.

References active_session_, and HidePanel().

Here is the call graph for this function:

◆ IsPanelVisible() [2/2]

bool yaze::editor::PanelManager::IsPanelVisible ( const std::string & base_card_id) const
inline

Definition at line 427 of file panel_manager.h.

References active_session_, and IsPanelVisible().

Here is the call graph for this function:

◆ HideAllPanelsInCategory() [2/2]

void yaze::editor::PanelManager::HideAllPanelsInCategory ( const std::string & category)
inline

Definition at line 430 of file panel_manager.h.

References active_session_, and HideAllPanelsInCategory().

Here is the call graph for this function:

◆ GetActiveCategory()

◆ SetActiveCategory()

◆ ShowAllPanelsInCategory() [2/2]

void yaze::editor::PanelManager::ShowAllPanelsInCategory ( const std::string & category)
inline

Definition at line 442 of file panel_manager.h.

References active_session_, and ShowAllPanelsInCategory().

Here is the call graph for this function:

◆ GetVisibilityFlag() [2/2]

bool * yaze::editor::PanelManager::GetVisibilityFlag ( const std::string & base_card_id)
inline

Definition at line 445 of file panel_manager.h.

References active_session_, and GetVisibilityFlag().

Here is the call graph for this function:

◆ ShowAll() [2/2]

void yaze::editor::PanelManager::ShowAll ( )
inline

Definition at line 448 of file panel_manager.h.

References active_session_, and ShowAll().

Referenced by ShowAll().

Here is the call graph for this function:

◆ HideAll() [2/2]

void yaze::editor::PanelManager::HideAll ( )
inline

Definition at line 449 of file panel_manager.h.

References active_session_, and HideAll().

Referenced by HideAll().

Here is the call graph for this function:

◆ SetOnPanelClickedCallback()

void yaze::editor::PanelManager::SetOnPanelClickedCallback ( std::function< void(const std::string &)> callback)
inline

Definition at line 450 of file panel_manager.h.

References on_card_clicked_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ SetOnCategorySelectedCallback()

void yaze::editor::PanelManager::SetOnCategorySelectedCallback ( std::function< void(const std::string &)> callback)
inline

Definition at line 453 of file panel_manager.h.

References on_category_selected_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ GetActiveSessionId()

size_t yaze::editor::PanelManager::GetActiveSessionId ( ) const
inline

◆ GetFileBrowser()

FileBrowser * yaze::editor::PanelManager::GetFileBrowser ( const std::string & category)

Definition at line 1167 of file panel_manager.cc.

References category_file_browsers_.

Referenced by yaze::editor::ActivityBar::DrawSidePanel().

◆ EnableFileBrowser()

void yaze::editor::PanelManager::EnableFileBrowser ( const std::string & category,
const std::string & root_path = "" )

◆ DisableFileBrowser()

void yaze::editor::PanelManager::DisableFileBrowser ( const std::string & category)

Definition at line 1207 of file panel_manager.cc.

References category_file_browsers_.

◆ HasFileBrowser()

bool yaze::editor::PanelManager::HasFileBrowser ( const std::string & category) const

Definition at line 1211 of file panel_manager.cc.

References category_file_browsers_.

Referenced by yaze::editor::ActivityBar::DrawSidePanel().

◆ SetFileBrowserPath()

void yaze::editor::PanelManager::SetFileBrowserPath ( const std::string & category,
const std::string & path )

◆ SetFileClickedCallback()

void yaze::editor::PanelManager::SetFileClickedCallback ( std::function< void(const std::string &category, const std::string &path)> callback)
inline

Definition at line 469 of file panel_manager.h.

References on_file_clicked_.

Referenced by yaze::editor::EditorManager::Initialize().

◆ ToggleFavorite()

void yaze::editor::PanelManager::ToggleFavorite ( const std::string & card_id)
Todo
Persist favorites to user settings

Definition at line 842 of file panel_manager.cc.

References favorite_cards_.

◆ IsFavorite()

bool yaze::editor::PanelManager::IsFavorite ( const std::string & card_id) const

Definition at line 851 of file panel_manager.cc.

References favorite_cards_.

◆ AddToRecent()

void yaze::editor::PanelManager::AddToRecent ( const std::string & card_id)

Definition at line 855 of file panel_manager.cc.

References kMaxRecentPanels, and recent_cards_.

Referenced by yaze::editor::ActivityBar::DrawSidePanel().

◆ GetRecentPanels()

const std::vector< std::string > & yaze::editor::PanelManager::GetRecentPanels ( ) const
inline

Definition at line 482 of file panel_manager.h.

References recent_cards_.

Referenced by yaze::editor::ActivityBar::DrawSidePanel().

◆ GetFavoritePanels()

const std::unordered_set< std::string > & yaze::editor::PanelManager::GetFavoritePanels ( ) const
inline

Definition at line 483 of file panel_manager.h.

References favorite_cards_.

◆ SetPanelPinned() [1/2]

void yaze::editor::PanelManager::SetPanelPinned ( size_t session_id,
const std::string & base_card_id,
bool pinned )

Definition at line 1228 of file panel_manager.cc.

References GetPrefixedPanelId(), MakePanelId(), and pinned_panels_.

Referenced by DrawAllVisiblePanels(), yaze::editor::ActivityBar::DrawSidePanel(), and SetPanelPinned().

Here is the call graph for this function:

◆ IsPanelPinned() [1/2]

bool yaze::editor::PanelManager::IsPanelPinned ( size_t session_id,
const std::string & base_card_id ) const

◆ GetPinnedPanels() [1/2]

std::vector< std::string > yaze::editor::PanelManager::GetPinnedPanels ( size_t session_id) const

Definition at line 1248 of file panel_manager.cc.

References pinned_panels_, and ShouldPrefixPanels().

Referenced by yaze::editor::ActivityBar::DrawSidePanel().

Here is the call graph for this function:

◆ SetPanelPinned() [2/2]

void yaze::editor::PanelManager::SetPanelPinned ( const std::string & base_card_id,
bool pinned )

Definition at line 1263 of file panel_manager.cc.

References active_session_, and SetPanelPinned().

Here is the call graph for this function:

◆ IsPanelPinned() [2/2]

bool yaze::editor::PanelManager::IsPanelPinned ( const std::string & base_card_id) const

Definition at line 1268 of file panel_manager.cc.

References active_session_, and IsPanelPinned().

Here is the call graph for this function:

◆ GetPinnedPanels() [2/2]

std::vector< std::string > yaze::editor::PanelManager::GetPinnedPanels ( ) const

Definition at line 1272 of file panel_manager.cc.

References active_session_, and GetPinnedPanels().

Referenced by GetPinnedPanels().

Here is the call graph for this function:

◆ EnforceResourceLimits()

void yaze::editor::PanelManager::EnforceResourceLimits ( const std::string & resource_type)

Enforce limits on resource panels (LRU eviction)

Parameters
resource_typeThe type of resource (e.g., "room", "song")

Checks if the number of open panels of this type exceeds the limit. If so, closes and unregisters the least recently used panel.

Definition at line 347 of file panel_manager.cc.

References IsPanelPinned(), yaze::editor::ResourcePanelLimits::kMaxMapPanels, yaze::editor::ResourcePanelLimits::kMaxRoomPanels, yaze::editor::ResourcePanelLimits::kMaxSheetPanels, yaze::editor::ResourcePanelLimits::kMaxSongPanels, yaze::editor::ResourcePanelLimits::kMaxTotalResourcePanels, LOG_INFO, resource_panels_, and UnregisterEditorPanel().

Referenced by RegisterEditorPanel().

Here is the call graph for this function:

◆ MarkPanelUsed()

void yaze::editor::PanelManager::MarkPanelUsed ( const std::string & panel_id)

Mark a panel as recently used (for LRU)

Parameters
panel_idThe panel ID

Definition at line 389 of file panel_manager.cc.

References panel_resource_types_, and resource_panels_.

◆ UpdateSessionCount()

void yaze::editor::PanelManager::UpdateSessionCount ( )
private

Definition at line 1023 of file panel_manager.cc.

References session_cards_, and session_count_.

Referenced by RegisterSession(), and UnregisterSession().

◆ GetPrefixedPanelId()

std::string yaze::editor::PanelManager::GetPrefixedPanelId ( size_t session_id,
const std::string & base_id ) const
private

◆ UnregisterSessionPanels()

void yaze::editor::PanelManager::UnregisterSessionPanels ( size_t session_id)
private

Definition at line 1045 of file panel_manager.cc.

References cards_, centralized_visibility_, pinned_panels_, and session_cards_.

Referenced by UnregisterSession().

◆ SavePresetsToFile()

void yaze::editor::PanelManager::SavePresetsToFile ( )
private

Definition at line 1056 of file panel_manager.cc.

References yaze::Json::dump(), yaze::util::PlatformPaths::GetConfigDirectory(), LOG_ERROR, LOG_INFO, yaze::Json::object(), and presets_.

Referenced by DeletePreset(), and SavePreset().

Here is the call graph for this function:

◆ LoadPresetsFromFile()

Member Data Documentation

◆ kDashboardCategory

constexpr const char* yaze::editor::PanelManager::kDashboardCategory = "Dashboard"
staticconstexpr

◆ resource_panels_

std::unordered_map<std::string, std::list<std::string> > yaze::editor::PanelManager::resource_panels_
private

Definition at line 520 of file panel_manager.h.

Referenced by EnforceResourceLimits(), MarkPanelUsed(), and RegisterEditorPanel().

◆ panel_resource_types_

std::unordered_map<std::string, std::string> yaze::editor::PanelManager::panel_resource_types_
private

Definition at line 523 of file panel_manager.h.

Referenced by MarkPanelUsed(), and RegisterEditorPanel().

◆ cards_

◆ panel_instances_

std::unordered_map<std::string, std::unique_ptr<EditorPanel> > yaze::editor::PanelManager::panel_instances_
private

◆ favorite_cards_

std::unordered_set<std::string> yaze::editor::PanelManager::favorite_cards_
private

Definition at line 534 of file panel_manager.h.

Referenced by GetFavoritePanels(), IsFavorite(), and ToggleFavorite().

◆ recent_cards_

std::vector<std::string> yaze::editor::PanelManager::recent_cards_
private

Definition at line 535 of file panel_manager.h.

Referenced by AddToRecent(), and GetRecentPanels().

◆ kMaxRecentPanels

constexpr size_t yaze::editor::PanelManager::kMaxRecentPanels = 10
staticconstexprprivate

Definition at line 536 of file panel_manager.h.

Referenced by AddToRecent().

◆ centralized_visibility_

std::unordered_map<std::string, bool> yaze::editor::PanelManager::centralized_visibility_
private

◆ pinned_panels_

std::unordered_map<std::string, bool> yaze::editor::PanelManager::pinned_panels_
private

◆ session_count_

size_t yaze::editor::PanelManager::session_count_ = 0
private

◆ active_session_

◆ session_cards_

◆ session_card_mapping_

std::unordered_map<size_t, std::unordered_map<std::string, std::string> > yaze::editor::PanelManager::session_card_mapping_
private

◆ presets_

std::unordered_map<std::string, WorkspacePreset> yaze::editor::PanelManager::presets_
private

◆ active_category_

std::string yaze::editor::PanelManager::active_category_
private

Definition at line 558 of file panel_manager.h.

Referenced by DrawAllVisiblePanels(), GetActiveCategory(), and SetActiveCategory().

◆ recent_categories_

std::vector<std::string> yaze::editor::PanelManager::recent_categories_
private

Definition at line 559 of file panel_manager.h.

◆ kMaxRecentCategories

constexpr size_t yaze::editor::PanelManager::kMaxRecentCategories = 5
staticconstexprprivate

Definition at line 560 of file panel_manager.h.

◆ sidebar_visible_

bool yaze::editor::PanelManager::sidebar_visible_ = false
private

◆ panel_expanded_

bool yaze::editor::PanelManager::panel_expanded_ = false
private

◆ focused_card_index_

int yaze::editor::PanelManager::focused_card_index_ = -1
private

Definition at line 567 of file panel_manager.h.

Referenced by GetFocusedPanelIndex(), and HandleSidebarKeyboardNav().

◆ sidebar_has_focus_

bool yaze::editor::PanelManager::sidebar_has_focus_ = false
private

Definition at line 568 of file panel_manager.h.

Referenced by HandleSidebarKeyboardNav(), and SidebarHasFocus().

◆ emulator_visible_

bool yaze::editor::PanelManager::emulator_visible_ = false
private

Definition at line 571 of file panel_manager.h.

Referenced by IsEmulatorVisible(), SetEmulatorVisible(), and ToggleEmulatorVisible().

◆ on_show_emulator_

std::function<void()> yaze::editor::PanelManager::on_show_emulator_
private

Definition at line 574 of file panel_manager.h.

Referenced by SetShowEmulatorCallback(), and TriggerShowEmulator().

◆ on_show_settings_

std::function<void()> yaze::editor::PanelManager::on_show_settings_
private

Definition at line 575 of file panel_manager.h.

Referenced by SetShowSettingsCallback(), and TriggerShowSettings().

◆ on_show_panel_browser_

std::function<void()> yaze::editor::PanelManager::on_show_panel_browser_
private

Definition at line 576 of file panel_manager.h.

Referenced by SetShowPanelBrowserCallback(), and TriggerShowPanelBrowser().

◆ on_save_rom_

std::function<void()> yaze::editor::PanelManager::on_save_rom_
private

Definition at line 577 of file panel_manager.h.

Referenced by SetSaveRomCallback(), and TriggerSaveRom().

◆ on_undo_

std::function<void()> yaze::editor::PanelManager::on_undo_
private

Definition at line 578 of file panel_manager.h.

Referenced by SetUndoCallback(), and TriggerUndo().

◆ on_redo_

std::function<void()> yaze::editor::PanelManager::on_redo_
private

Definition at line 579 of file panel_manager.h.

Referenced by SetRedoCallback(), and TriggerRedo().

◆ on_show_search_

std::function<void()> yaze::editor::PanelManager::on_show_search_
private

Definition at line 580 of file panel_manager.h.

Referenced by SetShowSearchCallback(), and TriggerShowSearch().

◆ on_show_shortcuts_

std::function<void()> yaze::editor::PanelManager::on_show_shortcuts_
private

Definition at line 581 of file panel_manager.h.

Referenced by SetShowShortcutsCallback(), and TriggerShowShortcuts().

◆ on_show_command_palette_

std::function<void()> yaze::editor::PanelManager::on_show_command_palette_
private

Definition at line 582 of file panel_manager.h.

Referenced by SetShowCommandPaletteCallback(), and TriggerShowCommandPalette().

◆ on_show_help_

std::function<void()> yaze::editor::PanelManager::on_show_help_
private

Definition at line 583 of file panel_manager.h.

Referenced by SetShowHelpCallback(), and TriggerShowHelp().

◆ on_open_rom_

std::function<void()> yaze::editor::PanelManager::on_open_rom_
private

Definition at line 584 of file panel_manager.h.

Referenced by SetOpenRomCallback(), and TriggerOpenRom().

◆ on_sidebar_state_changed_

std::function<void(bool visible, bool expanded)> yaze::editor::PanelManager::on_sidebar_state_changed_
private

◆ on_category_changed_

std::function<void(const std::string&) yaze::editor::PanelManager::on_category_changed_)
private

Definition at line 588 of file panel_manager.h.

Referenced by SetActiveCategory(), and SetCategoryChangedCallback().

◆ on_card_clicked_

std::function<void(const std::string&) yaze::editor::PanelManager::on_card_clicked_)
private

◆ on_category_selected_

std::function<void(const std::string&) yaze::editor::PanelManager::on_category_selected_)
private

Definition at line 590 of file panel_manager.h.

Referenced by SetOnCategorySelectedCallback(), and TriggerCategorySelected().

◆ on_emulator_visibility_changed_

std::function<void(bool)> yaze::editor::PanelManager::on_emulator_visibility_changed_
private

Definition at line 591 of file panel_manager.h.

Referenced by SetEmulatorVisibilityChangedCallback(), and SetEmulatorVisible().

◆ on_file_clicked_

std::function<void(const std::string&, const std::string&) yaze::editor::PanelManager::on_file_clicked_)
private

Definition at line 592 of file panel_manager.h.

Referenced by EnableFileBrowser(), and SetFileClickedCallback().

◆ category_file_browsers_

std::unordered_map<std::string, std::unique_ptr<FileBrowser> > yaze::editor::PanelManager::category_file_browsers_
private

◆ active_editor_categories_

std::unordered_set<std::string> yaze::editor::PanelManager::active_editor_categories_
private

Definition at line 599 of file panel_manager.h.


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