#include "Platform/Win32/WindowManager/Internal.h" #include "State/EditorContext.h" #include "Platform/Win32/EditorWindow.h" #include #include namespace XCEngine::UI::Editor::App::Internal { UIEditorWindowWorkspaceSet EditorWindowWorkspaceCoordinator::BuildWindowWorkspaceSet( std::string_view activeWindowId) const { UIEditorWindowWorkspaceSet windowSet = {}; if (const EditorWindow* primaryWindow = m_hostRuntime.FindPrimaryWindow(); primaryWindow != nullptr) { windowSet.primaryWindowId = std::string(primaryWindow->GetWindowId()); } for (const std::unique_ptr& window : m_hostRuntime.GetWindows()) { if (window == nullptr || window->GetHwnd() == nullptr) { continue; } UIEditorWindowWorkspaceState entry = {}; entry.windowId = std::string(window->GetWindowId()); entry.workspace = window->GetWorkspaceController().GetWorkspace(); entry.session = window->GetWorkspaceController().GetSession(); windowSet.windows.push_back(std::move(entry)); } windowSet.activeWindowId = !activeWindowId.empty() && m_hostRuntime.FindWindow(activeWindowId) != nullptr ? std::string(activeWindowId) : windowSet.primaryWindowId; return windowSet; } UIEditorWindowWorkspaceController EditorWindowWorkspaceCoordinator::BuildLiveWindowWorkspaceController( std::string_view activeWindowId) const { return UIEditorWindowWorkspaceController( m_hostRuntime.GetEditorContext().GetShellAsset().panelRegistry, BuildWindowWorkspaceSet(activeWindowId)); } UIEditorWorkspaceController EditorWindowWorkspaceCoordinator::BuildWorkspaceControllerForWindow( const UIEditorWindowWorkspaceState& windowState) const { return UIEditorWorkspaceController( m_hostRuntime.GetEditorContext().GetShellAsset().panelRegistry, windowState.workspace, windowState.session); } } // namespace XCEngine::UI::Editor::App::Internal