refactor(editor): isolate windowing from composition runtime

This commit is contained in:
2026-04-27 23:45:24 +08:00
parent 603d003684
commit 6b488d5eac
34 changed files with 418 additions and 193 deletions

View File

@@ -1,7 +1,6 @@
#include "EditorShellRuntime.h"
#include "UiTextureHost.h"
#include "ViewportRenderHost.h"
#include "EditorContext.h"
#include <XCEditor/Shell/UIEditorShellCapturePolicy.h>
#include <XCEngine/Rendering/RenderContext.h>
@@ -138,6 +137,11 @@ bool EditorShellRuntime::HasInteractiveCapture() const {
return HasHostedContentCapture() || HasShellInteractiveCapture();
}
std::unique_ptr<EditorWorkspaceShellRuntime> CreateEditorWorkspaceShellRuntime(
EditorWorkspacePanelRuntimeSet workspacePanels) {
return std::make_unique<EditorShellRuntime>(std::move(workspacePanels));
}
} // namespace XCEngine::UI::Editor::App
namespace XCEngine::UI::Editor::App {
@@ -163,7 +167,7 @@ void EditorShellRuntime::Append(::XCEngine::UI::UIDrawData& drawData) const {
namespace XCEngine::UI::Editor::App {
void EditorShellRuntime::Update(
EditorContext& context,
EditorFrameServices& frameServices,
UIEditorWorkspaceController& workspaceController,
const ::XCEngine::UI::UIRect& bounds,
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
@@ -175,7 +179,7 @@ void EditorShellRuntime::Update(
const auto buildDefinition = [&]() {
return m_sessionCoordinator.PrepareShellDefinition(
EditorShellSessionCoordinatorContext{
.context = context,
.frameServices = frameServices,
.workspaceController = workspaceController,
.captureText = captureText,
.shellVariant = shellVariant,
@@ -190,7 +194,7 @@ void EditorShellRuntime::Update(
.workspaceController = workspaceController,
.bounds = bounds,
.inputEvents = inputEvents,
.shellServices = context.GetShellServices(),
.shellServices = frameServices.GetShellServices(),
.buildDefinition = buildDefinition,
.hostedContentCaptureActive = HasHostedContentCapture(),
.useDetachedTitleBarTabStrip = useDetachedTitleBarTabStrip,
@@ -198,19 +202,18 @@ void EditorShellRuntime::Update(
.detachedWindowChromeHeight = detachedWindowChromeHeight,
.viewportHostService = m_viewportHostService,
});
m_sessionCoordinator.FinalizeFrame(context, workspaceController, m_shellFrame.result);
m_sessionCoordinator.FinalizeFrame(frameServices, workspaceController, m_shellFrame.result);
m_hostedPanelCoordinator.Update(
EditorShellHostedPanelCoordinatorContext{
.context = context,
.frameServices = frameServices,
.shellFrame = m_shellFrame,
.shellInteractionState = m_shellInteractionState,
.inputEvents = inputEvents,
.shellInteractiveCaptureActive = HasShellInteractiveCapture(),
.workspacePanels = m_workspacePanels,
});
m_traceEntries = SyncWorkspaceEvents(
context,
m_traceEntries = frameServices.SyncWorkspacePanelFrameEvents(
m_workspacePanels.CollectFrameEvents());
}