#include "Windowing/Content/EditorWindowContentFactory.h" #include "Windowing/Content/EditorUtilityWindowContentController.h" #include "Windowing/Content/EditorWorkspaceWindowContentController.h" #include #include namespace XCEngine::UI::Editor::App { namespace { class DefaultEditorWindowContentFactory final : public EditorWindowContentFactory { public: DefaultEditorWindowContentFactory( EditorWindowSystem& windowSystem, EditorWorkspacePanelRuntimeSetFactory workspacePanelFactory) : m_windowSystem(windowSystem) , m_workspacePanelFactory(std::move(workspacePanelFactory)) {} std::unique_ptr CreateWorkspaceContentController( const UIEditorWindowWorkspaceState& windowState) const override { EditorWorkspacePanelRuntimeSet workspacePanels = m_workspacePanelFactory ? m_workspacePanelFactory() : EditorWorkspacePanelRuntimeSet{}; return CreateEditorWorkspaceWindowContentController( windowState, m_windowSystem, std::move(workspacePanels)); } std::unique_ptr CreateUtilityContentController( const EditorUtilityWindowDescriptor& descriptor) const override { return CreateEditorUtilityWindowContentController(descriptor); } private: EditorWindowSystem& m_windowSystem; EditorWorkspacePanelRuntimeSetFactory m_workspacePanelFactory = {}; }; } // namespace std::unique_ptr CreateDefaultEditorWindowContentFactory( EditorWindowSystem& windowSystem, EditorWorkspacePanelRuntimeSetFactory workspacePanelFactory) { return std::make_unique( windowSystem, std::move(workspacePanelFactory)); } } // namespace XCEngine::UI::Editor::App