chore: snapshot editor work and restore tests
Key points:\n- restore the tests tree removed by bc47e6e\n- capture current editor workspace, scene, and docs reshuffle changes\n- keep local cloud.nvdb resources ignored from this commit
This commit is contained in:
78
editor/app/Windowing/System/EditorWindowSystem.cpp
Normal file
78
editor/app/Windowing/System/EditorWindowSystem.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
#include "Windowing/System/EditorWindowSystem.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
EditorWindowSystem::EditorWindowSystem(UIEditorPanelRegistry panelRegistry)
|
||||
: m_workspaceStore(std::move(panelRegistry)) {}
|
||||
|
||||
const UIEditorPanelRegistry& EditorWindowSystem::GetPanelRegistry() const {
|
||||
return m_workspaceStore.GetPanelRegistry();
|
||||
}
|
||||
|
||||
bool EditorWindowSystem::BootstrapPrimaryWindow(
|
||||
std::string_view primaryWindowId,
|
||||
const UIEditorWorkspaceController& workspaceController,
|
||||
std::string& outError) {
|
||||
const std::string resolvedPrimaryWindowId =
|
||||
primaryWindowId.empty() ? std::string("main-window") : std::string(primaryWindowId);
|
||||
|
||||
UIEditorWindowWorkspaceSet windowSet = {};
|
||||
windowSet.primaryWindowId = resolvedPrimaryWindowId;
|
||||
windowSet.activeWindowId = resolvedPrimaryWindowId;
|
||||
|
||||
UIEditorWindowWorkspaceState primaryWindowState = {};
|
||||
primaryWindowState.windowId = resolvedPrimaryWindowId;
|
||||
primaryWindowState.workspace = workspaceController.GetWorkspace();
|
||||
primaryWindowState.session = workspaceController.GetSession();
|
||||
windowSet.windows.push_back(std::move(primaryWindowState));
|
||||
|
||||
return m_workspaceStore.TrySetWindowSet(std::move(windowSet), outError);
|
||||
}
|
||||
|
||||
bool EditorWindowSystem::ValidateWindowSet(
|
||||
const UIEditorWindowWorkspaceSet& windowSet,
|
||||
std::string& outError) const {
|
||||
return m_workspaceStore.ValidateWindowSet(windowSet, outError);
|
||||
}
|
||||
|
||||
bool EditorWindowSystem::TrySetWindowSet(
|
||||
UIEditorWindowWorkspaceSet windowSet,
|
||||
std::string& outError) {
|
||||
return m_workspaceStore.TrySetWindowSet(std::move(windowSet), outError);
|
||||
}
|
||||
|
||||
bool EditorWindowSystem::UpsertWindowState(
|
||||
const UIEditorWindowWorkspaceState& windowState,
|
||||
bool primary,
|
||||
std::string& outError) {
|
||||
return m_workspaceStore.UpsertWindowState(windowState, primary, outError);
|
||||
}
|
||||
|
||||
void EditorWindowSystem::RemoveWindowState(std::string_view windowId, bool primary) {
|
||||
m_workspaceStore.RemoveWindowState(windowId, primary);
|
||||
}
|
||||
|
||||
bool EditorWindowSystem::IsPrimaryWindowId(std::string_view windowId) const {
|
||||
return m_workspaceStore.IsPrimaryWindowId(windowId);
|
||||
}
|
||||
|
||||
const UIEditorWindowWorkspaceSet& EditorWindowSystem::GetWindowSet() const {
|
||||
return m_workspaceStore.GetWindowSet();
|
||||
}
|
||||
|
||||
UIEditorWindowWorkspaceController EditorWindowSystem::BuildWorkspaceMutationController() const {
|
||||
return UIEditorWindowWorkspaceController(GetPanelRegistry(), GetWindowSet());
|
||||
}
|
||||
|
||||
UIEditorWindowWorkspaceOperationResult EditorWindowSystem::EvaluateDetachPanelToNewWindow(
|
||||
std::string_view sourceWindowId,
|
||||
std::string_view sourceNodeId,
|
||||
std::string_view panelId,
|
||||
UIEditorWindowWorkspaceController& outController) const {
|
||||
outController = BuildWorkspaceMutationController();
|
||||
return outController.DetachPanelToNewWindow(sourceWindowId, sourceNodeId, panelId);
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user