Handles all UI drawing operations and state management. More...
#include <ui_coordinator.h>
Private Member Functions | |
void | DrawSessionIndicator () |
void | DrawSessionTabs () |
void | DrawSessionBadges () |
void | DrawMaterialButton (const std::string &text, const std::string &icon, const ImVec4 &color, std::function< void()> callback, bool enabled=true) |
void | CenterWindow (const std::string &window_name) |
void | PositionWindow (const std::string &window_name, float x, float y) |
void | SetWindowSize (const std::string &window_name, float width, float height) |
std::string | GetIconForEditor (EditorType type) const |
std::string | GetColorForEditor (EditorType type) const |
void | ApplyEditorTheme (EditorType type) |
Handles all UI drawing operations and state management.
Extracted from EditorManager to provide focused UI coordination:
This class follows the Single Responsibility Principle by focusing solely on UI presentation and user interaction, delegating business logic to specialized managers.
Definition at line 41 of file ui_coordinator.h.
yaze::editor::UICoordinator::UICoordinator | ( | EditorManager * | editor_manager, |
RomFileManager & | rom_manager, | ||
ProjectManager & | project_manager, | ||
EditorRegistry & | editor_registry, | ||
EditorCardRegistry & | card_registry, | ||
SessionCoordinator & | session_coordinator, | ||
WindowDelegate & | window_delegate, | ||
ToastManager & | toast_manager, | ||
PopupManager & | popup_manager, | ||
ShortcutManager & | shortcut_manager | ||
) |
Definition at line 31 of file ui_coordinator.cc.
References yaze::editor::EditorManager::CreateNewProject(), editor_manager_, yaze::editor::EditorManager::LoadRom(), yaze::editor::EditorManager::OpenRomOrProject(), and welcome_screen_.
|
default |
|
delete |
|
delete |
void yaze::editor::UICoordinator::DrawAllUI | ( | ) |
Definition at line 103 of file ui_coordinator.cc.
References DrawCommandPalette(), DrawGlobalSearch(), DrawLayoutPresets(), DrawProjectHelp(), DrawWelcomeScreen(), DrawWindowManagementUI(), and DrawWorkspacePresetDialogs().
void yaze::editor::UICoordinator::DrawMenuBarExtras | ( | ) |
Definition at line 152 of file ui_coordinator.cc.
References editor_manager_, yaze::editor::SessionCoordinator::GetActiveSessionCount(), yaze::editor::EditorManager::GetCurrentRom(), yaze::gui::GetPrimaryActiveVec4(), yaze::gui::GetPrimaryHoverVec4(), yaze::gui::GetPrimaryVec4(), yaze::gui::GetTextDisabledVec4(), yaze::gui::GetTextSecondaryVec4(), yaze::editor::SessionCoordinator::HasMultipleSessions(), ICON_MD_CIRCLE, ICON_MD_INSERT_DRIVE_FILE, ICON_MD_TAB, ICON_MD_WARNING, session_coordinator_, yaze::editor::SessionCoordinator::ToggleSessionSwitcher(), and yaze::editor::EditorManager::version().
void yaze::editor::UICoordinator::DrawContextSensitiveCardControl | ( | ) |
Definition at line 209 of file ui_coordinator.cc.
References card_registry_, editor_manager_, editor_registry_, yaze::editor::EditorCardRegistry::GetCardsInCategory(), yaze::editor::EditorManager::GetCurrentEditor(), yaze::editor::EditorManager::GetCurrentSessionId(), yaze::editor::EditorRegistry::GetEditorCategory(), yaze::gui::GetSurfaceContainerHighestVec4(), yaze::gui::GetSurfaceContainerHighVec4(), yaze::editor::EditorCardRegistry::HideCard(), ICON_MD_LAYERS, yaze::editor::EditorRegistry::IsCardBasedEditor(), and yaze::editor::EditorCardRegistry::ShowCard().
Referenced by DrawRomSelector().
void yaze::editor::UICoordinator::DrawCommandPalette | ( | ) |
Definition at line 515 of file ui_coordinator.cc.
References yaze::gui::LayoutHelpers::BeginTableWithTheming(), command_palette_query_, command_palette_selected_idx_, yaze::gui::ConvertColorToImVec4(), yaze::gui::LayoutHelpers::EndTableWithTheming(), yaze::gui::ThemeManager::Get(), yaze::gui::ThemeManager::GetCurrentTheme(), yaze::editor::ShortcutManager::GetShortcuts(), ICON_MD_CLEAR, ICON_MD_HISTORY, ICON_MD_INFO, ICON_MD_LIST, ICON_MD_SEARCH, ICON_MD_STAR, yaze::editor::PrintShortcut(), shortcut_manager_, and show_command_palette_.
Referenced by DrawAllUI().
void yaze::editor::UICoordinator::DrawGlobalSearch | ( | ) |
Definition at line 672 of file ui_coordinator.cc.
References editor_manager_, yaze::editor::SessionCoordinator::GetActiveSessionCount(), yaze::editor::SessionCoordinator::GetActiveSessionIndex(), yaze::editor::EditorManager::GetCurrentRom(), yaze::util::GetFileExtension(), yaze::util::GetFileName(), yaze::project::RecentFilesManager::GetInstance(), yaze::editor::SessionCoordinator::GetSessionDisplayName(), yaze::editor::SessionCoordinator::GetTotalSessionCount(), global_search_query_, ICON_MD_CLEAR, ICON_MD_DESCRIPTION, ICON_MD_FOLDER, ICON_MD_HISTORY, ICON_MD_INFO, ICON_MD_LABEL, ICON_MD_MANAGE_SEARCH, ICON_MD_SEARCH, ICON_MD_TAB, ICON_MD_VIDEOGAME_ASSET, yaze::editor::kError, yaze::editor::EditorManager::OpenRomOrProject(), session_coordinator_, SetGlobalSearchVisible(), yaze::editor::ToastManager::Show(), show_global_search_, yaze::editor::EditorManager::SwitchToSession(), and toast_manager_.
Referenced by DrawAllUI().
void yaze::editor::UICoordinator::DrawWorkspacePresetDialogs | ( | ) |
Definition at line 350 of file ui_coordinator.cc.
References editor_manager_, yaze::gui::kDefaultModalSize, yaze::editor::kSuccess, yaze::editor::EditorManager::LoadWorkspacePreset(), yaze::editor::EditorManager::RefreshWorkspacePresets(), yaze::editor::EditorManager::SaveWorkspacePreset(), yaze::editor::ToastManager::Show(), show_load_workspace_preset_, show_save_workspace_preset_, toast_manager_, and yaze::editor::EditorManager::workspace_manager().
Referenced by DrawAllUI().
void yaze::editor::UICoordinator::DrawSessionSwitcher | ( | ) |
void yaze::editor::UICoordinator::DrawSessionManager | ( | ) |
void yaze::editor::UICoordinator::DrawSessionRenameDialog | ( | ) |
void yaze::editor::UICoordinator::DrawLayoutPresets | ( | ) |
Definition at line 283 of file ui_coordinator.cc.
Referenced by DrawAllUI().
void yaze::editor::UICoordinator::DrawWelcomeScreen | ( | ) |
Definition at line 288 of file ui_coordinator.cc.
References editor_manager_, yaze::editor::EditorManager::GetCurrentRom(), LOG_ERROR, show_welcome_screen_, welcome_screen_, and welcome_screen_manually_closed_.
Referenced by DrawAllUI().
void yaze::editor::UICoordinator::DrawProjectHelp | ( | ) |
Definition at line 345 of file ui_coordinator.cc.
Referenced by DrawAllUI().
void yaze::editor::UICoordinator::DrawWindowManagementUI | ( | ) |
Definition at line 394 of file ui_coordinator.cc.
Referenced by DrawAllUI().
void yaze::editor::UICoordinator::DrawRomSelector | ( | ) |
Definition at line 118 of file ui_coordinator.cc.
References DrawContextSensitiveCardControl(), editor_manager_, yaze::editor::EditorManager::GetCurrentRom(), yaze::editor::SessionCoordinator::GetSession(), yaze::editor::SessionCoordinator::GetTotalSessionCount(), yaze::editor::SessionCoordinator::IsSessionClosed(), session_coordinator_, yaze::Rom::short_name(), and yaze::editor::EditorManager::SwitchToSession().
void yaze::editor::UICoordinator::DrawAllPopups | ( | ) |
Definition at line 399 of file ui_coordinator.cc.
References yaze::editor::PopupManager::DrawPopups(), and popup_manager_.
void yaze::editor::UICoordinator::ShowPopup | ( | const std::string & | popup_name | ) |
Definition at line 404 of file ui_coordinator.cc.
References popup_manager_, and yaze::editor::PopupManager::Show().
void yaze::editor::UICoordinator::HidePopup | ( | const std::string & | popup_name | ) |
Definition at line 408 of file ui_coordinator.cc.
References yaze::editor::PopupManager::Hide(), and popup_manager_.
|
inline |
Definition at line 90 of file ui_coordinator.h.
References show_editor_selection_.
void yaze::editor::UICoordinator::ShowDisplaySettings | ( | ) |
Definition at line 412 of file ui_coordinator.cc.
References yaze::editor::PopupID::kDisplaySettings, popup_manager_, and yaze::editor::PopupManager::Show().
|
inline |
Definition at line 92 of file ui_coordinator.h.
References show_save_workspace_preset_.
|
inline |
Definition at line 93 of file ui_coordinator.h.
References show_load_workspace_preset_.
void yaze::editor::UICoordinator::ShowSessionSwitcher | ( | ) |
Definition at line 263 of file ui_coordinator.cc.
References session_coordinator_, and yaze::editor::SessionCoordinator::ShowSessionSwitcher().
void yaze::editor::UICoordinator::HideCurrentEditorCards | ( | ) |
Definition at line 418 of file ui_coordinator.cc.
References card_registry_, editor_manager_, editor_registry_, yaze::editor::EditorManager::GetCurrentEditor(), yaze::editor::EditorRegistry::GetEditorCategory(), yaze::editor::EditorCardRegistry::HideAllCardsInCategory(), and LOG_INFO.
|
inline |
Definition at line 97 of file ui_coordinator.h.
References show_card_sidebar_.
|
inline |
Definition at line 98 of file ui_coordinator.h.
References show_global_search_.
|
inline |
Definition at line 99 of file ui_coordinator.h.
References show_command_palette_.
|
inline |
Definition at line 100 of file ui_coordinator.h.
References show_card_browser_.
void yaze::editor::UICoordinator::ShowAllWindows | ( | ) |
Definition at line 430 of file ui_coordinator.cc.
References yaze::editor::WindowDelegate::ShowAllWindows(), and window_delegate_.
void yaze::editor::UICoordinator::HideAllWindows | ( | ) |
Definition at line 434 of file ui_coordinator.cc.
References yaze::editor::WindowDelegate::HideAllWindows(), and window_delegate_.
|
inline |
Definition at line 107 of file ui_coordinator.h.
References show_editor_selection_.
|
inline |
Definition at line 108 of file ui_coordinator.h.
References show_display_settings_.
bool yaze::editor::UICoordinator::IsSessionSwitcherVisible | ( | ) | const |
Definition at line 267 of file ui_coordinator.cc.
References yaze::editor::SessionCoordinator::IsSessionSwitcherVisible(), and session_coordinator_.
|
inline |
Definition at line 111 of file ui_coordinator.h.
References show_welcome_screen_.
|
inline |
Definition at line 112 of file ui_coordinator.h.
References welcome_screen_manually_closed_.
|
inline |
Definition at line 113 of file ui_coordinator.h.
References show_global_search_.
|
inline |
Definition at line 114 of file ui_coordinator.h.
References show_performance_dashboard_.
|
inline |
Definition at line 115 of file ui_coordinator.h.
References show_card_browser_.
|
inline |
Definition at line 116 of file ui_coordinator.h.
References show_command_palette_.
|
inline |
Definition at line 117 of file ui_coordinator.h.
References show_card_sidebar_.
|
inline |
Definition at line 118 of file ui_coordinator.h.
References show_imgui_demo_.
|
inline |
Definition at line 119 of file ui_coordinator.h.
References show_imgui_metrics_.
|
inline |
Definition at line 120 of file ui_coordinator.h.
References show_emulator_.
|
inline |
Definition at line 121 of file ui_coordinator.h.
References show_memory_editor_.
|
inline |
Definition at line 122 of file ui_coordinator.h.
References show_asm_editor_.
|
inline |
Definition at line 123 of file ui_coordinator.h.
References show_palette_editor_.
|
inline |
Definition at line 124 of file ui_coordinator.h.
References show_resource_label_manager_.
|
inline |
Definition at line 127 of file ui_coordinator.h.
References show_editor_selection_.
|
inline |
Definition at line 128 of file ui_coordinator.h.
References show_display_settings_.
void yaze::editor::UICoordinator::SetSessionSwitcherVisible | ( | bool | visible | ) |
Definition at line 271 of file ui_coordinator.cc.
References yaze::editor::SessionCoordinator::HideSessionSwitcher(), session_coordinator_, and yaze::editor::SessionCoordinator::ShowSessionSwitcher().
|
inline |
Definition at line 131 of file ui_coordinator.h.
References show_welcome_screen_.
|
inline |
Definition at line 132 of file ui_coordinator.h.
References welcome_screen_manually_closed_.
|
inline |
Definition at line 133 of file ui_coordinator.h.
References show_global_search_.
Referenced by DrawGlobalSearch().
|
inline |
Definition at line 134 of file ui_coordinator.h.
References show_performance_dashboard_.
|
inline |
Definition at line 135 of file ui_coordinator.h.
References show_card_browser_.
|
inline |
Definition at line 136 of file ui_coordinator.h.
References show_command_palette_.
|
inline |
Definition at line 137 of file ui_coordinator.h.
References show_card_sidebar_.
|
inline |
Definition at line 138 of file ui_coordinator.h.
References show_imgui_demo_.
|
inline |
Definition at line 139 of file ui_coordinator.h.
References show_imgui_metrics_.
|
inline |
Definition at line 140 of file ui_coordinator.h.
References show_emulator_.
|
inline |
Definition at line 141 of file ui_coordinator.h.
References show_memory_editor_.
|
inline |
Definition at line 142 of file ui_coordinator.h.
References show_asm_editor_.
|
inline |
Definition at line 143 of file ui_coordinator.h.
References show_palette_editor_.
|
inline |
Definition at line 144 of file ui_coordinator.h.
References show_resource_label_manager_.
|
private |
Definition at line 439 of file ui_coordinator.cc.
|
private |
Definition at line 443 of file ui_coordinator.cc.
|
private |
Definition at line 447 of file ui_coordinator.cc.
|
private |
Definition at line 452 of file ui_coordinator.cc.
References yaze::gui::GetOnSurfaceVariantVec4(), and yaze::gui::GetSurfaceContainerHighestVec4().
|
private |
Definition at line 473 of file ui_coordinator.cc.
|
private |
Definition at line 477 of file ui_coordinator.cc.
|
private |
Definition at line 481 of file ui_coordinator.cc.
|
private |
Definition at line 486 of file ui_coordinator.cc.
References ICON_MD_CASTLE, ICON_MD_CHAT_BUBBLE, ICON_MD_CODE, ICON_MD_DATA_ARRAY, ICON_MD_HELP, ICON_MD_IMAGE, ICON_MD_MAP, ICON_MD_MUSIC_NOTE, ICON_MD_PALETTE, ICON_MD_PLAY_ARROW, ICON_MD_SETTINGS, ICON_MD_TOYS, ICON_MD_TV, yaze::editor::kAssembly, yaze::editor::kDungeon, yaze::editor::kEmulator, yaze::editor::kGraphics, yaze::editor::kHex, yaze::editor::kMessage, yaze::editor::kMusic, yaze::editor::kOverworld, yaze::editor::kPalette, yaze::editor::kScreen, yaze::editor::kSettings, and yaze::editor::kSprite.
|
private |
Definition at line 504 of file ui_coordinator.cc.
|
private |
Definition at line 510 of file ui_coordinator.cc.
|
private |
Definition at line 150 of file ui_coordinator.h.
Referenced by DrawContextSensitiveCardControl(), DrawGlobalSearch(), DrawMenuBarExtras(), DrawRomSelector(), DrawWelcomeScreen(), DrawWorkspacePresetDialogs(), HideCurrentEditorCards(), and UICoordinator().
|
private |
Definition at line 151 of file ui_coordinator.h.
|
private |
Definition at line 152 of file ui_coordinator.h.
|
private |
Definition at line 153 of file ui_coordinator.h.
Referenced by DrawContextSensitiveCardControl(), and HideCurrentEditorCards().
|
private |
Definition at line 154 of file ui_coordinator.h.
Referenced by DrawContextSensitiveCardControl(), and HideCurrentEditorCards().
|
private |
Definition at line 155 of file ui_coordinator.h.
Referenced by DrawGlobalSearch(), DrawMenuBarExtras(), DrawRomSelector(), IsSessionSwitcherVisible(), SetSessionSwitcherVisible(), and ShowSessionSwitcher().
|
private |
Definition at line 156 of file ui_coordinator.h.
Referenced by HideAllWindows(), and ShowAllWindows().
|
private |
Definition at line 157 of file ui_coordinator.h.
Referenced by DrawGlobalSearch(), and DrawWorkspacePresetDialogs().
|
private |
Definition at line 158 of file ui_coordinator.h.
Referenced by DrawAllPopups(), HidePopup(), ShowDisplaySettings(), and ShowPopup().
|
private |
Definition at line 159 of file ui_coordinator.h.
Referenced by DrawCommandPalette().
|
private |
Definition at line 162 of file ui_coordinator.h.
Referenced by IsEditorSelectionVisible(), SetEditorSelectionVisible(), and ShowEditorSelection().
|
private |
Definition at line 163 of file ui_coordinator.h.
Referenced by IsDisplaySettingsVisible(), and SetDisplaySettingsVisible().
|
private |
Definition at line 165 of file ui_coordinator.h.
Referenced by DrawWelcomeScreen(), IsWelcomeScreenVisible(), and SetWelcomeScreenVisible().
|
private |
Definition at line 166 of file ui_coordinator.h.
Referenced by DrawWelcomeScreen(), IsWelcomeScreenManuallyClosed(), and SetWelcomeScreenManuallyClosed().
|
private |
Definition at line 167 of file ui_coordinator.h.
Referenced by DrawGlobalSearch(), IsGlobalSearchVisible(), SetGlobalSearchVisible(), and ShowGlobalSearch().
|
private |
Definition at line 168 of file ui_coordinator.h.
Referenced by IsPerformanceDashboardVisible(), and SetPerformanceDashboardVisible().
|
private |
Definition at line 169 of file ui_coordinator.h.
Referenced by IsImGuiDemoVisible(), and SetImGuiDemoVisible().
|
private |
Definition at line 170 of file ui_coordinator.h.
Referenced by IsImGuiMetricsVisible(), and SetImGuiMetricsVisible().
|
private |
Definition at line 171 of file ui_coordinator.h.
|
private |
Definition at line 172 of file ui_coordinator.h.
Referenced by IsCardBrowserVisible(), SetCardBrowserVisible(), and ShowCardBrowser().
|
private |
Definition at line 173 of file ui_coordinator.h.
Referenced by DrawCommandPalette(), IsCommandPaletteVisible(), SetCommandPaletteVisible(), and ShowCommandPalette().
|
private |
Definition at line 174 of file ui_coordinator.h.
Referenced by IsEmulatorVisible(), and SetEmulatorVisible().
|
private |
Definition at line 175 of file ui_coordinator.h.
Referenced by IsMemoryEditorVisible(), and SetMemoryEditorVisible().
|
private |
Definition at line 176 of file ui_coordinator.h.
Referenced by IsAsmEditorVisible(), and SetAsmEditorVisible().
|
private |
Definition at line 177 of file ui_coordinator.h.
Referenced by IsPaletteEditorVisible(), and SetPaletteEditorVisible().
|
private |
Definition at line 178 of file ui_coordinator.h.
Referenced by IsResourceLabelManagerVisible(), and SetResourceLabelManagerVisible().
|
private |
Definition at line 179 of file ui_coordinator.h.
Referenced by DrawWorkspacePresetDialogs(), and ShowSaveWorkspacePresetDialog().
|
private |
Definition at line 180 of file ui_coordinator.h.
Referenced by DrawWorkspacePresetDialogs(), and ShowLoadWorkspacePresetDialog().
|
private |
Definition at line 181 of file ui_coordinator.h.
Referenced by IsCardSidebarVisible(), SetCardSidebarVisible(), and ToggleCardSidebar().
|
private |
Definition at line 184 of file ui_coordinator.h.
Referenced by DrawCommandPalette().
|
private |
Definition at line 185 of file ui_coordinator.h.
Referenced by DrawCommandPalette().
|
private |
Definition at line 188 of file ui_coordinator.h.
Referenced by DrawGlobalSearch().
|
private |
Definition at line 191 of file ui_coordinator.h.
Referenced by DrawWelcomeScreen(), and UICoordinator().