Introduce editor core boundary

This commit is contained in:
2026-04-27 13:40:26 +08:00
parent 3243eea0bf
commit 1de1f768d3
29 changed files with 658 additions and 200 deletions

View File

@@ -13,12 +13,22 @@ namespace {
class DefaultEditorWindowContentFactory final : public EditorWindowContentFactory {
public:
explicit DefaultEditorWindowContentFactory(EditorWindowSystem& windowSystem)
: m_windowSystem(windowSystem) {}
DefaultEditorWindowContentFactory(
EditorWindowSystem& windowSystem,
EditorWorkspacePanelRuntimeSetFactory workspacePanelFactory)
: m_windowSystem(windowSystem)
, m_workspacePanelFactory(std::move(workspacePanelFactory)) {}
std::unique_ptr<EditorWindowContentController> CreateWorkspaceContentController(
const UIEditorWindowWorkspaceState& windowState) const override {
return CreateEditorWorkspaceWindowContentController(windowState, m_windowSystem);
EditorWorkspacePanelRuntimeSet workspacePanels =
m_workspacePanelFactory
? m_workspacePanelFactory()
: EditorWorkspacePanelRuntimeSet{};
return CreateEditorWorkspaceWindowContentController(
windowState,
m_windowSystem,
std::move(workspacePanels));
}
std::unique_ptr<EditorWindowContentController> CreateUtilityContentController(
@@ -28,13 +38,17 @@ public:
private:
EditorWindowSystem& m_windowSystem;
EditorWorkspacePanelRuntimeSetFactory m_workspacePanelFactory = {};
};
} // namespace
std::unique_ptr<EditorWindowContentFactory> CreateDefaultEditorWindowContentFactory(
EditorWindowSystem& windowSystem) {
return std::make_unique<DefaultEditorWindowContentFactory>(windowSystem);
EditorWindowSystem& windowSystem,
EditorWorkspacePanelRuntimeSetFactory workspacePanelFactory) {
return std::make_unique<DefaultEditorWindowContentFactory>(
windowSystem,
std::move(workspacePanelFactory));
}
} // namespace XCEngine::UI::Editor::App