High-level orchestrator for multi-session UI. More...
#include <session_coordinator.h>
Public Member Functions | |
| SessionCoordinator (WorkspaceWindowManager *window_manager, ToastManager *toast_manager, UserSettings *user_settings) | |
| ~SessionCoordinator () | |
| void | SetEditorManager (ISessionConfigurator *manager) |
| void | SetBeforeSessionTransition (std::function< absl::Status()> callback) |
| void | SetEditorRegistry (EditorRegistry *registry) |
| void | SetEventBus (EventBus *bus) |
| void | CreateNewSession () |
| void | DuplicateCurrentSession () |
| void | RequestCloseCurrentSession () |
| void | CloseCurrentSession () |
| void | CloseSession (size_t index) |
| void | CloseSessionAllowingEmpty (size_t index) |
| void | RemoveSession (size_t index) |
| void | SwitchToSession (size_t index) |
| void | UpdateSessions () |
| void | ActivateSession (size_t index) |
| size_t | GetActiveSessionIndex () const |
| Compact zero-based UI position in sessions_. | |
| size_t | GetActiveSessionId () const |
| Stable workspace identity that is never reused while this coordinator lives. | |
| size_t | GetSessionId (size_t index) const |
| Resolve a compact UI index to its stable workspace identity. | |
| void * | GetActiveSession () const |
| RomSession * | GetActiveRomSession () const |
| Rom * | GetCurrentRom () const |
| zelda3::GameData * | GetCurrentGameData () const |
| EditorSet * | GetCurrentEditorSet () const |
| void * | GetSession (size_t index) const |
| bool | HasMultipleSessions () const |
| size_t | GetActiveSessionCount () const |
| absl::Status | CheckBackingFileAvailable (const std::string &filepath, std::optional< size_t > excluded_session_id=std::nullopt) const |
| bool | HasDuplicateSession (const std::string &filepath) const |
| void | DrawSessionSwitcher () |
| void | DrawSessionManager () |
| void | DrawSessionRenameDialog () |
| void | DrawSessionTabs () |
| void | DrawSessionIndicator () |
| std::string | GetSessionDisplayName (size_t index) const |
| std::string | GetActiveSessionDisplayName () const |
| void | RenameSession (size_t index, const std::string &new_name) |
| std::string | GenerateUniqueEditorTitle (const std::string &editor_name, size_t session_index) const |
| void | SetActiveSessionIndex (size_t index) |
| void | UpdateSessionCount () |
| void | ShowAllPanelsInActiveSession () |
| void | HideAllPanelsInActiveSession () |
| void | ShowPanelsInCategory (const std::string &category) |
| void | HidePanelsInCategory (const std::string &category) |
| bool | IsValidSessionIndex (size_t index) const |
| bool | IsSessionActive (size_t index) const |
| bool | IsSessionLoaded (size_t index) const |
| size_t | GetTotalSessionCount () const |
| size_t | GetLoadedSessionCount () const |
| size_t | GetEmptySessionCount () const |
| absl::Status | LoadRomIntoSession (const std::string &filename, size_t session_index=SIZE_MAX) |
| absl::Status | SaveActiveSession (const std::string &filename="") |
| absl::Status | SaveSessionAs (size_t session_index, const std::string &filename) |
| absl::StatusOr< RomSession * > | CreateSessionFromRom (Rom &&rom, const std::string &filepath) |
| absl::Status | DiscardProvisionalSession (size_t session_id) |
| void | CleanupClosedSessions () |
| void | ClearAllSessions () |
| void | FocusNextSession () |
| void | FocusPreviousSession () |
| void | FocusFirstSession () |
| void | FocusLastSession () |
| void | ShowSessionSwitcher () |
| void | HideSessionSwitcher () |
| void | ToggleSessionSwitcher () |
| bool | IsSessionSwitcherVisible () const |
| void | ShowSessionManager () |
| void | HideSessionManager () |
| void | ToggleSessionManager () |
| bool | IsSessionManagerVisible () const |
| void | UpdateActiveSession () |
| void | ValidateSessionIndex (size_t index) const |
| std::string | GenerateUniqueSessionName (const std::string &base_name) const |
| void | ShowSessionLimitWarning () |
| void | ShowSessionOperationResult (const std::string &operation, bool success) |
| void | DrawSessionTab (size_t index, bool is_active) |
| void | DrawSessionContextMenu (size_t index) |
| void | DrawSessionBadge (size_t index) |
| ImVec4 | GetSessionColor (size_t index) const |
| std::string | GetSessionIcon (size_t index) const |
| bool | IsSessionEmpty (size_t index) const |
| bool | IsSessionClosed (size_t index) const |
| bool | IsSessionModified (size_t index) const |
Static Public Member Functions | |
| static bool | PathsReferToSameBackingFile (const std::string &lhs, const std::string &rhs) |
Private Member Functions | |
| void | ActivateCreatedSession (size_t index) |
| void | SwitchToSessionInternal (size_t index, bool transient) |
| absl::Status | PrepareActiveSessionTransition () |
| void | ApplySessionActivation (size_t index, bool transient) |
| void | CloseSessionInternal (size_t index, bool allow_closing_last) |
| void | NotifySessionSwitched (size_t old_index, size_t new_index, RomSession *session, bool transient) |
| void | NotifySessionCreated (size_t index, RomSession *session) |
| void | NotifySessionClosed (size_t index) |
| void | NotifySessionRomLoaded (size_t index, RomSession *session) |
Private Attributes | |
| ISessionConfigurator * | editor_manager_ = nullptr |
| EditorRegistry * | editor_registry_ = nullptr |
| EventBus * | event_bus_ = nullptr |
| std::vector< std::unique_ptr< RomSession > > | sessions_ |
| WorkspaceWindowManager * | window_manager_ |
| ToastManager * | toast_manager_ |
| UserSettings * | user_settings_ |
| size_t | active_session_index_ = 0 |
| size_t | session_count_ = 0 |
| size_t | next_session_id_ = 0 |
| bool | show_session_switcher_ = false |
| bool | show_session_manager_ = false |
| bool | show_session_rename_dialog_ = false |
| size_t | session_to_rename_ = 0 |
| char | session_rename_buffer_ [256] = {} |
| std::function< absl::Status()> | before_session_transition_ |
Static Private Attributes | |
| static constexpr size_t | kMaxSessions = 8 |
| static constexpr size_t | kMinSessions = 1 |
High-level orchestrator for multi-session UI.
Manages session list UI, coordinates card visibility across sessions, handles session activation/deactivation, and provides session-aware editor queries.
This class lives in the ui/ layer and can depend on both system and gui components.
Definition at line 49 of file session_coordinator.h.
|
explicit |
Definition at line 89 of file session_coordinator.cc.
|
default |
|
inline |
Definition at line 56 of file session_coordinator.h.
References editor_manager_.
|
inline |
Definition at line 59 of file session_coordinator.h.
References before_session_transition_.
|
inline |
Definition at line 62 of file session_coordinator.h.
References editor_registry_.
|
inline |
Set the EventBus for publishing session lifecycle events. When set, session events will be published alongside observer notifications.
Definition at line 68 of file session_coordinator.h.
References event_bus_.
| void yaze::editor::SessionCoordinator::CreateNewSession | ( | ) |
Definition at line 133 of file session_coordinator.cc.
References ActivateCreatedSession(), yaze::editor::ISessionConfigurator::ConfigureSession(), editor_manager_, editor_registry_, kMaxSessions, LOG_INFO, next_session_id_, NotifySessionCreated(), session_count_, sessions_, ShowSessionLimitWarning(), ShowSessionOperationResult(), UpdateSessionCount(), and user_settings_.
Referenced by DrawSessionSwitcher().
| void yaze::editor::SessionCoordinator::DuplicateCurrentSession | ( | ) |
Definition at line 162 of file session_coordinator.cc.
References ActivateCreatedSession(), yaze::editor::ISessionConfigurator::ConfigureSession(), editor_manager_, editor_registry_, kMaxSessions, LOG_INFO, next_session_id_, NotifySessionCreated(), session_count_, sessions_, ShowSessionLimitWarning(), ShowSessionOperationResult(), UpdateSessionCount(), and user_settings_.
Referenced by DrawSessionSwitcher().
| void yaze::editor::SessionCoordinator::RequestCloseCurrentSession | ( | ) |
Definition at line 223 of file session_coordinator.cc.
References active_session_index_, CloseCurrentSession(), editor_manager_, and yaze::editor::ISessionConfigurator::RequestCloseSession().
Referenced by DrawSessionSwitcher().

| void yaze::editor::SessionCoordinator::CloseCurrentSession | ( | ) |
Definition at line 231 of file session_coordinator.cc.
References active_session_index_, and CloseSession().
Referenced by RequestCloseCurrentSession().

| void yaze::editor::SessionCoordinator::CloseSession | ( | size_t | index | ) |
Definition at line 235 of file session_coordinator.cc.
References CloseSessionInternal().
Referenced by CloseCurrentSession(), DrawSessionContextMenu(), DrawSessionManager(), and RemoveSession().

| void yaze::editor::SessionCoordinator::CloseSessionAllowingEmpty | ( | size_t | index | ) |
Definition at line 239 of file session_coordinator.cc.
References CloseSessionInternal().

| void yaze::editor::SessionCoordinator::RemoveSession | ( | size_t | index | ) |
Definition at line 314 of file session_coordinator.cc.
References CloseSession().

| void yaze::editor::SessionCoordinator::SwitchToSession | ( | size_t | index | ) |
Definition at line 318 of file session_coordinator.cc.
References SwitchToSessionInternal().
Referenced by ActivateCreatedSession(), ActivateSession(), DrawSessionContextMenu(), DrawSessionManager(), DrawSessionSwitcher(), DrawSessionTab(), DrawSessionTabs(), FocusFirstSession(), FocusLastSession(), FocusNextSession(), FocusPreviousSession(), and SetActiveSessionIndex().

| void yaze::editor::SessionCoordinator::UpdateSessions | ( | ) |
Definition at line 810 of file session_coordinator.cc.
References active_session_index_, editor_manager_, GenerateUniqueEditorTitle(), yaze::editor::ISessionConfigurator::GetCurrentEditor(), yaze::Rom::is_loaded(), yaze::editor::EditorManager::IsPanelBasedEditor(), yaze::editor::OverworldEditor::jump_to_tab_, yaze::editor::kEditorNames, yaze::editor::kError, yaze::editor::kOverworld, yaze::editor::Editor::rom(), sessions_, yaze::editor::ISessionConfigurator::SetCurrentEditor(), yaze::editor::ToastManager::Show(), SwitchToSessionInternal(), toast_manager_, and yaze::editor::EditorRegistry::UpdateAllowedWithoutLoadedRom().
| void yaze::editor::SessionCoordinator::ActivateSession | ( | size_t | index | ) |
Definition at line 357 of file session_coordinator.cc.
References SwitchToSession().

| size_t yaze::editor::SessionCoordinator::GetActiveSessionIndex | ( | ) | const |
Compact zero-based UI position in sessions_.
Definition at line 361 of file session_coordinator.cc.
References active_session_index_.
Referenced by yaze::editor::UICoordinator::DrawGlobalSearch().
| size_t yaze::editor::SessionCoordinator::GetActiveSessionId | ( | ) | const |
Stable workspace identity that is never reused while this coordinator lives.
Definition at line 365 of file session_coordinator.cc.
References active_session_index_, and GetSessionId().
Referenced by yaze::editor::MenuOrchestrator::AddHackWorkflowMenuItems(), yaze::editor::MenuOrchestrator::AddPanelsMenuItems(), CloseSessionInternal(), yaze::editor::ConfigurePanelShortcuts(), DiscardProvisionalSession(), yaze::editor::UICoordinator::DrawCommandPalette(), HideAllPanelsInActiveSession(), HidePanelsInCategory(), yaze::editor::UICoordinator::IsAsmEditorVisible(), yaze::editor::UICoordinator::IsEmulatorVisible(), yaze::editor::UICoordinator::SetAsmEditorVisible(), yaze::editor::UICoordinator::SetEmulatorVisible(), ShowAllPanelsInActiveSession(), yaze::editor::UICoordinator::ShowCommandPalette(), and ShowPanelsInCategory().

| size_t yaze::editor::SessionCoordinator::GetSessionId | ( | size_t | index | ) | const |
Resolve a compact UI index to its stable workspace identity.
Definition at line 369 of file session_coordinator.cc.
References IsValidSessionIndex(), and sessions_.
Referenced by ActivateCreatedSession(), ApplySessionActivation(), CloseSessionInternal(), CreateSessionFromRom(), and GetActiveSessionId().

| void * yaze::editor::SessionCoordinator::GetActiveSession | ( | ) | const |
Definition at line 376 of file session_coordinator.cc.
References active_session_index_, IsValidSessionIndex(), and sessions_.
Referenced by GetActiveRomSession().

| RomSession * yaze::editor::SessionCoordinator::GetActiveRomSession | ( | ) | const |
Definition at line 383 of file session_coordinator.cc.
References GetActiveSession().
Referenced by GetCurrentEditorSet(), GetCurrentGameData(), and GetCurrentRom().

| Rom * yaze::editor::SessionCoordinator::GetCurrentRom | ( | ) | const |
Definition at line 387 of file session_coordinator.cc.
References GetActiveRomSession().

| zelda3::GameData * yaze::editor::SessionCoordinator::GetCurrentGameData | ( | ) | const |
Definition at line 392 of file session_coordinator.cc.
References GetActiveRomSession().

| EditorSet * yaze::editor::SessionCoordinator::GetCurrentEditorSet | ( | ) | const |
Definition at line 397 of file session_coordinator.cc.
References GetActiveRomSession().

| void * yaze::editor::SessionCoordinator::GetSession | ( | size_t | index | ) | const |
Definition at line 402 of file session_coordinator.cc.
References IsValidSessionIndex(), and sessions_.
Referenced by yaze::editor::UICoordinator::DrawSessionButton().

| bool yaze::editor::SessionCoordinator::HasMultipleSessions | ( | ) | const |
Definition at line 409 of file session_coordinator.cc.
References session_count_.
Referenced by yaze::editor::UICoordinator::DrawMenuBarExtras(), DrawSessionContextMenu(), DrawSessionIndicator(), DrawSessionManager(), and DrawSessionSwitcher().
| size_t yaze::editor::SessionCoordinator::GetActiveSessionCount | ( | ) | const |
Definition at line 413 of file session_coordinator.cc.
References session_count_.
Referenced by yaze::editor::UICoordinator::DrawGlobalSearch(), yaze::editor::UICoordinator::DrawNotificationBell(), and yaze::editor::UICoordinator::DrawSessionButton().
| absl::Status yaze::editor::SessionCoordinator::CheckBackingFileAvailable | ( | const std::string & | filepath, |
| std::optional< size_t > | excluded_session_id = std::nullopt ) const |
Reject a ROM path already owned by another loaded session. The optional exclusion is a stable session ID, used by Save As to allow its owner to retain the same backing file while still rejecting every other session.
Definition at line 417 of file session_coordinator.cc.
References PathsReferToSameBackingFile(), and sessions_.
Referenced by CreateSessionFromRom(), HasDuplicateSession(), and yaze::editor::GraphicsEditor::Initialize().

|
static |
Compare filesystem identities after canonicalization, including hard links on native platforms. This is also used for project-descriptor ownership checks outside the coordinator.
Definition at line 84 of file session_coordinator.cc.
Referenced by yaze::editor::EditorManager::ActivateExistingSessionForOpen(), CheckBackingFileAvailable(), yaze::editor::RomLifecycleManager::CheckRomRebindPolicy(), yaze::editor::EditorManager::CommitRawProjectFileSave(), yaze::editor::EditorManager::CreateNewProjectFromRom(), yaze::editor::EditorManager::ExecuteEditorControl(), yaze::editor::GraphicsEditor::Initialize(), yaze::editor::EditorManager::PrepareRawProjectFileSave(), yaze::editor::EditorManager::ProjectFileDraftTargetsCurrentProject(), yaze::editor::EditorManager::ResolveProjectBuildCommand(), yaze::editor::EditorManager::SaveProjectAs(), and yaze::editor::EditorManager::ShowProjectFileEditor().
| bool yaze::editor::SessionCoordinator::HasDuplicateSession | ( | const std::string & | filepath | ) | const |
Definition at line 444 of file session_coordinator.cc.
References CheckBackingFileAvailable().

| void yaze::editor::SessionCoordinator::DrawSessionSwitcher | ( | ) |
Definition at line 449 of file session_coordinator.cc.
References active_session_index_, CreateNewSession(), DrawSessionContextMenu(), DuplicateCurrentSession(), editor_manager_, GetSessionDisplayName(), HasMultipleSessions(), ICON_MD_ADD, ICON_MD_CLOSE, ICON_MD_CONTENT_COPY, ICON_MD_TAB, RequestCloseCurrentSession(), yaze::editor::ISessionConfigurator::RequestSwitchToSession(), session_count_, sessions_, show_session_switcher_, and SwitchToSession().
| void yaze::editor::SessionCoordinator::DrawSessionManager | ( | ) |
Definition at line 513 of file session_coordinator.cc.
References active_session_index_, CloseSession(), editor_manager_, GetEmptySessionCount(), GetLoadedSessionCount(), GetSessionDisplayName(), yaze::gui::GetSuccessColor(), GetTotalSessionCount(), yaze::gui::GetWarningColor(), HasMultipleSessions(), ICON_MD_ANALYTICS, ICON_MD_RADIO_BUTTON_CHECKED, ICON_MD_RADIO_BUTTON_UNCHECKED, IsSessionModified(), yaze::editor::ISessionConfigurator::RequestCloseSession(), yaze::editor::ISessionConfigurator::RequestSwitchToSession(), sessions_, show_session_manager_, and SwitchToSession().
| void yaze::editor::SessionCoordinator::DrawSessionRenameDialog | ( | ) |
Definition at line 617 of file session_coordinator.cc.
References RenameSession(), session_rename_buffer_, session_to_rename_, and show_session_rename_dialog_.

| void yaze::editor::SessionCoordinator::DrawSessionTabs | ( | ) |
Definition at line 651 of file session_coordinator.cc.
References active_session_index_, yaze::gui::BeginThemedTabBar(), DrawSessionContextMenu(), editor_manager_, yaze::gui::EndThemedTabBar(), GetSessionDisplayName(), ICON_MD_CHECK_CIRCLE, IsSessionModified(), yaze::editor::ISessionConfigurator::RequestSwitchToSession(), sessions_, and SwitchToSession().
| void yaze::editor::SessionCoordinator::DrawSessionIndicator | ( | ) |
Definition at line 691 of file session_coordinator.cc.
References active_session_index_, yaze::gui::ConvertColorToImVec4(), yaze::gui::ThemeManager::Get(), GetActiveSessionDisplayName(), yaze::gui::ThemeManager::GetCurrentTheme(), HasMultipleSessions(), ICON_MD_TAB, and ToggleSessionSwitcher().
| std::string yaze::editor::SessionCoordinator::GetSessionDisplayName | ( | size_t | index | ) | const |
Definition at line 713 of file session_coordinator.cc.
References IsValidSessionIndex(), and sessions_.
Referenced by yaze::editor::UICoordinator::DrawGlobalSearch(), DrawSessionContextMenu(), DrawSessionManager(), DrawSessionSwitcher(), DrawSessionTab(), DrawSessionTabs(), and GetActiveSessionDisplayName().

| std::string yaze::editor::SessionCoordinator::GetActiveSessionDisplayName | ( | ) | const |
Definition at line 733 of file session_coordinator.cc.
References active_session_index_, and GetSessionDisplayName().
Referenced by DrawSessionIndicator().

| void yaze::editor::SessionCoordinator::RenameSession | ( | size_t | index, |
| const std::string & | new_name ) |
Definition at line 737 of file session_coordinator.cc.
References IsValidSessionIndex(), LOG_INFO, and sessions_.
Referenced by DrawSessionRenameDialog().

| std::string yaze::editor::SessionCoordinator::GenerateUniqueEditorTitle | ( | const std::string & | editor_name, |
| size_t | session_index ) const |
Definition at line 747 of file session_coordinator.cc.
References sessions_.
Referenced by UpdateSessions().
| void yaze::editor::SessionCoordinator::SetActiveSessionIndex | ( | size_t | index | ) |
Definition at line 773 of file session_coordinator.cc.
References SwitchToSession().

| void yaze::editor::SessionCoordinator::UpdateSessionCount | ( | ) |
Definition at line 777 of file session_coordinator.cc.
References session_count_, and sessions_.
Referenced by CleanupClosedSessions(), ClearAllSessions(), CloseSessionInternal(), CreateNewSession(), CreateSessionFromRom(), DiscardProvisionalSession(), and DuplicateCurrentSession().
| void yaze::editor::SessionCoordinator::ShowAllPanelsInActiveSession | ( | ) |
Definition at line 782 of file session_coordinator.cc.
References GetActiveSessionId(), yaze::editor::WorkspaceWindowManager::ShowAllWindowsInSession(), and window_manager_.

| void yaze::editor::SessionCoordinator::HideAllPanelsInActiveSession | ( | ) |
Definition at line 788 of file session_coordinator.cc.
References GetActiveSessionId(), yaze::editor::WorkspaceWindowManager::HideAllWindowsInSession(), and window_manager_.

| void yaze::editor::SessionCoordinator::ShowPanelsInCategory | ( | const std::string & | category | ) |
Definition at line 794 of file session_coordinator.cc.
References GetActiveSessionId(), yaze::editor::WorkspaceWindowManager::ShowAllWindowsInCategory(), and window_manager_.

| void yaze::editor::SessionCoordinator::HidePanelsInCategory | ( | const std::string & | category | ) |
Definition at line 800 of file session_coordinator.cc.
References GetActiveSessionId(), yaze::editor::WorkspaceWindowManager::HideAllWindowsInCategory(), and window_manager_.

| bool yaze::editor::SessionCoordinator::IsValidSessionIndex | ( | size_t | index | ) | const |
Definition at line 806 of file session_coordinator.cc.
References sessions_.
Referenced by ActivateCreatedSession(), CloseSessionInternal(), GetActiveSession(), GetSession(), GetSessionDisplayName(), GetSessionId(), IsSessionClosed(), IsSessionEmpty(), IsSessionLoaded(), IsSessionModified(), LoadRomIntoSession(), RenameSession(), SaveActiveSession(), SaveSessionAs(), SwitchToSessionInternal(), and ValidateSessionIndex().
| bool yaze::editor::SessionCoordinator::IsSessionActive | ( | size_t | index | ) | const |
Definition at line 917 of file session_coordinator.cc.
References active_session_index_.
| bool yaze::editor::SessionCoordinator::IsSessionLoaded | ( | size_t | index | ) | const |
Definition at line 921 of file session_coordinator.cc.
References IsValidSessionIndex(), and sessions_.

| size_t yaze::editor::SessionCoordinator::GetTotalSessionCount | ( | ) | const |
Definition at line 925 of file session_coordinator.cc.
References session_count_.
Referenced by yaze::editor::UICoordinator::DrawGlobalSearch(), yaze::editor::UICoordinator::DrawSessionButton(), and DrawSessionManager().
| size_t yaze::editor::SessionCoordinator::GetLoadedSessionCount | ( | ) | const |
Definition at line 929 of file session_coordinator.cc.
References sessions_.
Referenced by DrawSessionManager(), and GetEmptySessionCount().
| size_t yaze::editor::SessionCoordinator::GetEmptySessionCount | ( | ) | const |
Definition at line 939 of file session_coordinator.cc.
References GetLoadedSessionCount(), and session_count_.
Referenced by DrawSessionManager().

| absl::Status yaze::editor::SessionCoordinator::LoadRomIntoSession | ( | const std::string & | filename, |
| size_t | session_index = SIZE_MAX ) |
Definition at line 943 of file session_coordinator.cc.
References active_session_index_, IsValidSessionIndex(), and LOG_INFO.

| absl::Status yaze::editor::SessionCoordinator::SaveActiveSession | ( | const std::string & | filename = "" | ) |
Definition at line 962 of file session_coordinator.cc.
References active_session_index_, IsValidSessionIndex(), and LOG_INFO.

| absl::Status yaze::editor::SessionCoordinator::SaveSessionAs | ( | size_t | session_index, |
| const std::string & | filename ) |
Definition at line 975 of file session_coordinator.cc.
References IsValidSessionIndex(), and LOG_INFO.

| absl::StatusOr< RomSession * > yaze::editor::SessionCoordinator::CreateSessionFromRom | ( | Rom && | rom, |
| const std::string & | filepath ) |
Definition at line 988 of file session_coordinator.cc.
References active_session_index_, ApplySessionActivation(), CheckBackingFileAvailable(), editor_registry_, GetSessionId(), next_session_id_, NotifySessionCreated(), NotifySessionRomLoaded(), NotifySessionSwitched(), PrepareActiveSessionTransition(), sessions_, yaze::editor::WorkspaceWindowManager::SetActiveSession(), UpdateSessionCount(), user_settings_, and window_manager_.
| absl::Status yaze::editor::SessionCoordinator::DiscardProvisionalSession | ( | size_t | session_id | ) |
Definition at line 1027 of file session_coordinator.cc.
References active_session_index_, GetActiveSessionId(), LOG_WARN, NotifySessionClosed(), NotifySessionSwitched(), PrepareActiveSessionTransition(), sessions_, yaze::editor::WorkspaceWindowManager::SetActiveSession(), yaze::editor::WorkspaceWindowManager::UnregisterSession(), UpdateSessionCount(), and window_manager_.
| void yaze::editor::SessionCoordinator::CleanupClosedSessions | ( | ) |
Definition at line 1077 of file session_coordinator.cc.
References LOG_INFO, session_count_, sessions_, and UpdateSessionCount().

| void yaze::editor::SessionCoordinator::ClearAllSessions | ( | ) |
Definition at line 1101 of file session_coordinator.cc.
References active_session_index_, LOG_INFO, PrepareActiveSessionTransition(), sessions_, ShowSessionOperationResult(), yaze::editor::WorkspaceWindowManager::UnregisterSession(), UpdateSessionCount(), and window_manager_.

| void yaze::editor::SessionCoordinator::FocusNextSession | ( | ) |
Definition at line 1130 of file session_coordinator.cc.
References active_session_index_, sessions_, and SwitchToSession().

| void yaze::editor::SessionCoordinator::FocusPreviousSession | ( | ) |
Definition at line 1138 of file session_coordinator.cc.
References active_session_index_, sessions_, and SwitchToSession().

| void yaze::editor::SessionCoordinator::FocusFirstSession | ( | ) |
Definition at line 1147 of file session_coordinator.cc.
References sessions_, and SwitchToSession().

| void yaze::editor::SessionCoordinator::FocusLastSession | ( | ) |
Definition at line 1153 of file session_coordinator.cc.
References sessions_, and SwitchToSession().

|
inline |
Definition at line 169 of file session_coordinator.h.
References show_session_switcher_.
Referenced by yaze::editor::UICoordinator::SetSessionSwitcherVisible(), and yaze::editor::UICoordinator::ShowSessionSwitcher().
|
inline |
Definition at line 170 of file session_coordinator.h.
References show_session_switcher_.
Referenced by yaze::editor::UICoordinator::SetSessionSwitcherVisible().
|
inline |
Definition at line 171 of file session_coordinator.h.
References show_session_switcher_.
Referenced by DrawSessionIndicator().
|
inline |
Definition at line 174 of file session_coordinator.h.
References show_session_switcher_.
Referenced by yaze::editor::UICoordinator::IsSessionSwitcherVisible().
|
inline |
Definition at line 176 of file session_coordinator.h.
References show_session_manager_.
|
inline |
Definition at line 177 of file session_coordinator.h.
References show_session_manager_.
|
inline |
Definition at line 178 of file session_coordinator.h.
References show_session_manager_.
|
inline |
Definition at line 181 of file session_coordinator.h.
References show_session_manager_.
| void yaze::editor::SessionCoordinator::UpdateActiveSession | ( | ) |
Definition at line 1159 of file session_coordinator.cc.
References active_session_index_, and sessions_.
| void yaze::editor::SessionCoordinator::ValidateSessionIndex | ( | size_t | index | ) | const |
Definition at line 1165 of file session_coordinator.cc.
References IsValidSessionIndex().

| std::string yaze::editor::SessionCoordinator::GenerateUniqueSessionName | ( | const std::string & | base_name | ) | const |
Definition at line 1172 of file session_coordinator.cc.
References sessions_.
| void yaze::editor::SessionCoordinator::ShowSessionLimitWarning | ( | ) |
Definition at line 1198 of file session_coordinator.cc.
References kMaxSessions, yaze::editor::kWarning, yaze::editor::ToastManager::Show(), and toast_manager_.
Referenced by CreateNewSession(), and DuplicateCurrentSession().

| void yaze::editor::SessionCoordinator::ShowSessionOperationResult | ( | const std::string & | operation, |
| bool | success ) |
Definition at line 1206 of file session_coordinator.cc.
References yaze::editor::kError, yaze::editor::kSuccess, yaze::editor::ToastManager::Show(), and toast_manager_.
Referenced by ClearAllSessions(), CloseSessionInternal(), CreateNewSession(), DuplicateCurrentSession(), and SwitchToSessionInternal().

| void yaze::editor::SessionCoordinator::DrawSessionTab | ( | size_t | index, |
| bool | is_active ) |
Definition at line 1216 of file session_coordinator.cc.
References editor_manager_, GetSessionColor(), GetSessionDisplayName(), ICON_MD_CHECK_CIRCLE, IsSessionModified(), yaze::editor::ISessionConfigurator::RequestSwitchToSession(), sessions_, and SwitchToSession().
| void yaze::editor::SessionCoordinator::DrawSessionContextMenu | ( | size_t | index | ) |
Definition at line 1246 of file session_coordinator.cc.
References CloseSession(), yaze::gui::CanvasMenuItem::destructive, editor_manager_, GetSessionDisplayName(), HasMultipleSessions(), ICON_MD_CLOSE, ICON_MD_DRIVE_FILE_RENAME_OUTLINE, ICON_MD_TAB, IsSessionModified(), yaze::gui::RenderMenuItems(), yaze::editor::ISessionConfigurator::RequestCloseSession(), yaze::editor::ISessionConfigurator::RequestSwitchToSession(), yaze::gui::CanvasMenuItem::requires_confirmation, session_rename_buffer_, session_to_rename_, show_session_rename_dialog_, and SwitchToSession().
Referenced by DrawSessionSwitcher(), and DrawSessionTabs().
| void yaze::editor::SessionCoordinator::DrawSessionBadge | ( | size_t | index | ) |
Definition at line 1288 of file session_coordinator.cc.
References GetSessionColor(), ICON_MD_CHECK_CIRCLE, ICON_MD_RADIO_BUTTON_UNCHECKED, and sessions_.

| ImVec4 yaze::editor::SessionCoordinator::GetSessionColor | ( | size_t | index | ) | const |
Definition at line 1304 of file session_coordinator.cc.
Referenced by DrawSessionBadge(), and DrawSessionTab().
| std::string yaze::editor::SessionCoordinator::GetSessionIcon | ( | size_t | index | ) | const |
Definition at line 1320 of file session_coordinator.cc.
References ICON_MD_CHECK_CIRCLE, ICON_MD_RADIO_BUTTON_UNCHECKED, and sessions_.
| bool yaze::editor::SessionCoordinator::IsSessionEmpty | ( | size_t | index | ) | const |
Definition at line 1333 of file session_coordinator.cc.
References IsValidSessionIndex(), and sessions_.

| bool yaze::editor::SessionCoordinator::IsSessionClosed | ( | size_t | index | ) | const |
Definition at line 1337 of file session_coordinator.cc.
References IsValidSessionIndex().
Referenced by yaze::editor::UICoordinator::DrawSessionButton().

| bool yaze::editor::SessionCoordinator::IsSessionModified | ( | size_t | index | ) | const |
Definition at line 1341 of file session_coordinator.cc.
References yaze::gfx::PaletteManager::Get(), IsValidSessionIndex(), yaze::editor::kDungeon, and sessions_.
Referenced by DrawSessionContextMenu(), DrawSessionManager(), DrawSessionTab(), and DrawSessionTabs().

|
private |
Definition at line 196 of file session_coordinator.cc.
References active_session_index_, editor_manager_, GetSessionId(), IsValidSessionIndex(), NotifySessionSwitched(), yaze::editor::ISessionConfigurator::RequestSwitchToSession(), sessions_, yaze::editor::WorkspaceWindowManager::SetActiveSession(), SwitchToSession(), and window_manager_.
Referenced by CreateNewSession(), and DuplicateCurrentSession().
|
private |
Definition at line 322 of file session_coordinator.cc.
References active_session_index_, ApplySessionActivation(), IsValidSessionIndex(), PrepareActiveSessionTransition(), and ShowSessionOperationResult().
Referenced by SwitchToSession(), and UpdateSessions().

|
private |
Definition at line 337 of file session_coordinator.cc.
References before_session_transition_, and sessions_.
Referenced by ClearAllSessions(), CloseSessionInternal(), CreateSessionFromRom(), DiscardProvisionalSession(), and SwitchToSessionInternal().
|
private |
Definition at line 343 of file session_coordinator.cc.
References active_session_index_, GetSessionId(), NotifySessionSwitched(), sessions_, yaze::editor::WorkspaceWindowManager::SetActiveSession(), and window_manager_.
Referenced by CreateSessionFromRom(), and SwitchToSessionInternal().

|
private |
Definition at line 243 of file session_coordinator.cc.
References active_session_index_, GetActiveSessionId(), GetSessionId(), IsValidSessionIndex(), kMinSessions, yaze::editor::kWarning, LOG_INFO, NotifySessionClosed(), NotifySessionSwitched(), PrepareActiveSessionTransition(), session_count_, sessions_, yaze::editor::WorkspaceWindowManager::SetActiveSession(), yaze::editor::ToastManager::Show(), ShowSessionOperationResult(), toast_manager_, yaze::editor::WorkspaceWindowManager::UnregisterSession(), UpdateSessionCount(), and window_manager_.
Referenced by CloseSession(), and CloseSessionAllowingEmpty().
|
private |
Definition at line 98 of file session_coordinator.cc.
References yaze::editor::SessionSwitchedEvent::Create(), event_bus_, and yaze::EventBus::Publish().
Referenced by ActivateCreatedSession(), ApplySessionActivation(), CloseSessionInternal(), CreateSessionFromRom(), and DiscardProvisionalSession().

|
private |
Definition at line 109 of file session_coordinator.cc.
References yaze::editor::SessionCreatedEvent::Create(), event_bus_, and yaze::EventBus::Publish().
Referenced by CreateNewSession(), CreateSessionFromRom(), and DuplicateCurrentSession().

|
private |
Definition at line 117 of file session_coordinator.cc.
References yaze::editor::SessionClosedEvent::Create(), event_bus_, and yaze::EventBus::Publish().
Referenced by CloseSessionInternal(), and DiscardProvisionalSession().

|
private |
Definition at line 124 of file session_coordinator.cc.
References yaze::editor::RomLoadedEvent::Create(), event_bus_, yaze::editor::RomSession::filepath, yaze::EventBus::Publish(), and yaze::editor::RomSession::rom.
Referenced by CreateSessionFromRom().

|
private |
Definition at line 215 of file session_coordinator.h.
Referenced by ActivateCreatedSession(), CreateNewSession(), DrawSessionContextMenu(), DrawSessionManager(), DrawSessionSwitcher(), DrawSessionTab(), DrawSessionTabs(), DuplicateCurrentSession(), RequestCloseCurrentSession(), SetEditorManager(), and UpdateSessions().
|
private |
Definition at line 216 of file session_coordinator.h.
Referenced by CreateNewSession(), CreateSessionFromRom(), DuplicateCurrentSession(), and SetEditorRegistry().
|
private |
Definition at line 217 of file session_coordinator.h.
Referenced by NotifySessionClosed(), NotifySessionCreated(), NotifySessionRomLoaded(), NotifySessionSwitched(), and SetEventBus().
|
private |
Definition at line 218 of file session_coordinator.h.
Referenced by ActivateCreatedSession(), ApplySessionActivation(), CheckBackingFileAvailable(), CleanupClosedSessions(), ClearAllSessions(), CloseSessionInternal(), CreateNewSession(), CreateSessionFromRom(), DiscardProvisionalSession(), DrawSessionBadge(), DrawSessionManager(), DrawSessionSwitcher(), DrawSessionTab(), DrawSessionTabs(), DuplicateCurrentSession(), FocusFirstSession(), FocusLastSession(), FocusNextSession(), FocusPreviousSession(), GenerateUniqueEditorTitle(), GenerateUniqueSessionName(), GetActiveSession(), GetLoadedSessionCount(), GetSession(), GetSessionDisplayName(), GetSessionIcon(), GetSessionId(), IsSessionEmpty(), IsSessionLoaded(), IsSessionModified(), IsValidSessionIndex(), PrepareActiveSessionTransition(), RenameSession(), UpdateActiveSession(), UpdateSessionCount(), and UpdateSessions().
|
private |
Definition at line 219 of file session_coordinator.h.
Referenced by ActivateCreatedSession(), ApplySessionActivation(), ClearAllSessions(), CloseSessionInternal(), CreateSessionFromRom(), DiscardProvisionalSession(), HideAllPanelsInActiveSession(), HidePanelsInCategory(), ShowAllPanelsInActiveSession(), and ShowPanelsInCategory().
|
private |
Definition at line 220 of file session_coordinator.h.
Referenced by CloseSessionInternal(), ShowSessionLimitWarning(), ShowSessionOperationResult(), and UpdateSessions().
|
private |
Definition at line 221 of file session_coordinator.h.
Referenced by CreateNewSession(), CreateSessionFromRom(), and DuplicateCurrentSession().
|
private |
Definition at line 224 of file session_coordinator.h.
Referenced by ActivateCreatedSession(), ApplySessionActivation(), ClearAllSessions(), CloseCurrentSession(), CloseSessionInternal(), CreateSessionFromRom(), DiscardProvisionalSession(), DrawSessionIndicator(), DrawSessionManager(), DrawSessionSwitcher(), DrawSessionTabs(), FocusNextSession(), FocusPreviousSession(), GetActiveSession(), GetActiveSessionDisplayName(), GetActiveSessionId(), GetActiveSessionIndex(), IsSessionActive(), LoadRomIntoSession(), RequestCloseCurrentSession(), SaveActiveSession(), SwitchToSessionInternal(), UpdateActiveSession(), and UpdateSessions().
|
private |
Definition at line 225 of file session_coordinator.h.
Referenced by CleanupClosedSessions(), CloseSessionInternal(), CreateNewSession(), DrawSessionSwitcher(), DuplicateCurrentSession(), GetActiveSessionCount(), GetEmptySessionCount(), GetTotalSessionCount(), HasMultipleSessions(), and UpdateSessionCount().
|
private |
Definition at line 226 of file session_coordinator.h.
Referenced by CreateNewSession(), CreateSessionFromRom(), and DuplicateCurrentSession().
|
private |
Definition at line 229 of file session_coordinator.h.
Referenced by DrawSessionSwitcher(), HideSessionSwitcher(), IsSessionSwitcherVisible(), ShowSessionSwitcher(), and ToggleSessionSwitcher().
|
private |
Definition at line 230 of file session_coordinator.h.
Referenced by DrawSessionManager(), HideSessionManager(), IsSessionManagerVisible(), ShowSessionManager(), and ToggleSessionManager().
|
private |
Definition at line 231 of file session_coordinator.h.
Referenced by DrawSessionContextMenu(), and DrawSessionRenameDialog().
|
private |
Definition at line 232 of file session_coordinator.h.
Referenced by DrawSessionContextMenu(), and DrawSessionRenameDialog().
|
private |
Definition at line 233 of file session_coordinator.h.
Referenced by DrawSessionContextMenu(), and DrawSessionRenameDialog().
|
staticconstexprprivate |
Definition at line 236 of file session_coordinator.h.
Referenced by CreateNewSession(), DuplicateCurrentSession(), and ShowSessionLimitWarning().
|
staticconstexprprivate |
Definition at line 237 of file session_coordinator.h.
Referenced by CloseSessionInternal().
|
private |
Definition at line 238 of file session_coordinator.h.
Referenced by PrepareActiveSessionTransition(), and SetBeforeSessionTransition().