Refactor new editor boundaries and test ownership

This commit is contained in:
2026-04-19 15:52:28 +08:00
parent dc13b56cf3
commit 93f06e84ed
279 changed files with 6349 additions and 3238 deletions

View File

@@ -1,8 +1,8 @@
#include "Composition/EditorShellRuntime.h"
#include "Host/TextureHost.h"
#include "Host/ViewportRenderHost.h"
#include "State/EditorContext.h"
#include "Ports/TexturePort.h"
#include "Ports/ViewportRenderPort.h"
#include "Composition/EditorContext.h"
#include "Composition/EditorPanelIds.h"
@@ -12,11 +12,11 @@ namespace XCEngine::UI::Editor::App {
void EditorShellRuntime::Initialize(
const std::filesystem::path& repoRoot,
Host::TextureHost& textureHost,
Ports::TexturePort& textureHost,
UIEditorTextMeasurer& textMeasurer) {
m_textureHost = &textureHost;
m_builtInIcons.Initialize(textureHost);
m_sceneViewportController.Initialize(repoRoot, textureHost);
m_sceneViewportFeature.Initialize(repoRoot, textureHost, m_viewportHostService);
m_hierarchyPanel.SetBuiltInIcons(&m_builtInIcons);
m_projectPanel.SetBuiltInIcons(&m_builtInIcons);
m_projectPanel.SetTextMeasurer(&textMeasurer);
@@ -24,7 +24,7 @@ void EditorShellRuntime::Initialize(
m_projectPanel.Initialize(repoRoot);
}
void EditorShellRuntime::AttachViewportWindowRenderer(Host::ViewportRenderHost& renderer) {
void EditorShellRuntime::AttachViewportWindowRenderer(Ports::ViewportRenderPort& renderer) {
m_viewportHostService.AttachWindowRenderer(renderer);
}
@@ -43,7 +43,7 @@ void EditorShellRuntime::Shutdown() {
m_traceEntries.clear();
m_sceneEditCommandRoute = {};
if (m_textureHost != nullptr) {
m_sceneViewportController.Shutdown(*m_textureHost);
m_sceneViewportFeature.Shutdown(*m_textureHost, m_viewportHostService);
m_builtInIcons.Shutdown();
m_textureHost = nullptr;
} else {
@@ -57,7 +57,7 @@ void EditorShellRuntime::ResetInteractionState() {
m_shellInteractionState = {};
m_splitterDragCorrectionState = {};
m_traceEntries.clear();
m_sceneViewportController.ResetInteractionState();
m_sceneViewportFeature.ResetInteractionState();
m_hierarchyPanel.ResetInteractionState();
m_projectPanel.ResetInteractionState();
}