Refactor editor host resource boundary

This commit is contained in:
2026-04-27 23:18:04 +08:00
parent 87df14f47b
commit 603d003684
28 changed files with 447 additions and 228 deletions

View File

@@ -7,13 +7,13 @@
#include "EditorWindowManager.h"
#include "Diagnostics/Win32CrashTrace.h"
#include "System/Win32SystemInteractionHost.h"
#include "Resources/Win32EditorResourceService.h"
#include "Windowing/EditorWindow.h"
#include "Windowing/EditorWindowHostConfig.h"
#include "Windowing/EditorWindowHostRuntime.h"
#include "Windowing/EditorWindowMessageDispatcher.h"
#include "D3D12EditorWindowRenderRuntime.h"
#include "EnvironmentFlags.h"
#include "ExecutablePath.h"
#include <XCEditor/Foundation/UIEditorRuntimeTrace.h>
#include <XCEditor/Windowing/System/EditorWindowSystem.h>
@@ -111,14 +111,13 @@ int RunXCEditor(HINSTANCE hInstance, int nCmdShow) {
namespace XCEngine::UI::Editor {
using App::GetExecutableDirectory;
bool Application::Initialize(HINSTANCE hInstance, int nCmdShow) {
m_hInstance = hInstance;
m_repoRoot = ResolveRepoRootPath();
m_resourceService = std::make_unique<Host::Win32EditorResourceService>(m_hInstance);
EnableDpiAwareness();
const std::filesystem::path logRoot = GetExecutableDirectory() / "logs";
const std::filesystem::path logRoot = m_resourceService->GetExecutableDirectory() / "logs";
InitializeUIEditorRuntimeTrace(logRoot);
SetUnhandledExceptionFilter(&Application::HandleUnhandledException);
AppendUIEditorRuntimeTrace("app", "initialize begin");
@@ -154,6 +153,7 @@ bool Application::Initialize(HINSTANCE hInstance, int nCmdShow) {
*m_editorContext,
*m_windowSystem,
*m_renderRuntimeFactory,
*m_resourceService,
*m_windowHostRuntime,
App::CreateEditorWorkspacePanelRuntimeSet,
App::CreateEditorUtilityWindowPanel);
@@ -235,6 +235,7 @@ void Application::Shutdown() {
m_renderRuntimeFactory.reset();
m_windowHostRuntime.reset();
m_windowSystem.reset();
m_resourceService.reset();
if (m_editorContext != nullptr) {
m_editorContext->SetSystemInteractionHost(nullptr);