Refactor editor windowing boundaries

This commit is contained in:
2026-04-25 19:25:49 +08:00
parent f7ddd58f78
commit 9ab1beb2c4
23 changed files with 396 additions and 304 deletions

View File

@@ -4,12 +4,15 @@
#include "Composition/EditorContext.h"
#include "Platform/Win32/Chrome/EditorWindowChromeController.h"
#include "Platform/Win32/Windowing/EditorWindow.h"
#include "Windowing/Content/EditorWindowContentFactory.h"
#include "Windowing/Content/EditorWindowContentController.h"
#include "Platform/Win32/Runtime/EditorWindowFrameDriver.h"
#include "Platform/Win32/Windowing/EditorUtilityWindowCoordinator.h"
#include "Platform/Win32/Windowing/EditorWindowLifecycleCoordinator.h"
#include "Platform/Win32/Windowing/EditorWindowWorkspaceCoordinator.h"
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEditor/Foundation/UIEditorRuntimeTrace.h>
#include <algorithm>
@@ -57,10 +60,12 @@ std::string DescribeHostWindows(
EditorWindowHostRuntime::EditorWindowHostRuntime(
EditorWindowHostConfig hostConfig,
std::filesystem::path repoRoot,
EditorContext& editorContext)
EditorContext& editorContext,
EditorWindowContentFactory& contentFactory)
: m_hostConfig(hostConfig),
m_repoRoot(std::move(repoRoot)),
m_editorContext(editorContext) {}
m_editorContext(editorContext),
m_contentFactory(contentFactory) {}
EditorWindowHostRuntime::~EditorWindowHostRuntime() = default;
@@ -174,6 +179,22 @@ EditorWindow* EditorWindowHostRuntime::CreateEditorWindow(
return rawWindow;
}
EditorWindow* EditorWindowHostRuntime::CreateWorkspaceWindow(
UIEditorWorkspaceController workspaceController,
const CreateParams& params) {
return CreateEditorWindow(
m_contentFactory.CreateWorkspaceContentController(std::move(workspaceController)),
params);
}
EditorWindow* EditorWindowHostRuntime::CreateUtilityWindow(
const EditorUtilityWindowDescriptor& descriptor,
const CreateParams& params) {
return CreateEditorWindow(
m_contentFactory.CreateUtilityContentController(descriptor),
params);
}
void EditorWindowHostRuntime::BindLifecycleCoordinator(
EditorWindowLifecycleCoordinator& lifecycleCoordinator) {
m_lifecycleCoordinator = &lifecycleCoordinator;