关键节点
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
#pragma once
|
||||
|
||||
#include "Platform/Win32/Windowing/EditorWindowManager.h"
|
||||
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
|
||||
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
class EditorContext;
|
||||
class EditorWindow;
|
||||
class EditorWindowContentController;
|
||||
class EditorWindowLifecycleCoordinator;
|
||||
class EditorUtilityWindowCoordinator;
|
||||
class EditorWindowWorkspaceCoordinator;
|
||||
|
||||
class EditorWindowHostRuntime final {
|
||||
public:
|
||||
using CreateParams = EditorWindowManager::CreateParams;
|
||||
|
||||
EditorWindowHostRuntime(
|
||||
EditorWindowHostConfig hostConfig,
|
||||
std::filesystem::path repoRoot,
|
||||
EditorContext& editorContext);
|
||||
~EditorWindowHostRuntime();
|
||||
|
||||
EditorWindow* CreateEditorWindow(
|
||||
std::unique_ptr<EditorWindowContentController> contentController,
|
||||
const CreateParams& params);
|
||||
void BindLifecycleCoordinator(EditorWindowLifecycleCoordinator& lifecycleCoordinator);
|
||||
void HandlePendingNativeWindowCreated(HWND hwnd);
|
||||
|
||||
EditorWindow* FindWindow(HWND hwnd);
|
||||
const EditorWindow* FindWindow(HWND hwnd) const;
|
||||
EditorWindow* FindWindow(std::string_view windowId);
|
||||
const EditorWindow* FindWindow(std::string_view windowId) const;
|
||||
EditorWindow* FindPrimaryWindow();
|
||||
const EditorWindow* FindPrimaryWindow() const;
|
||||
|
||||
bool HasWindows() const;
|
||||
void RenderAllWindows(
|
||||
bool globalTabDragActive,
|
||||
EditorWindowWorkspaceCoordinator& workspaceCoordinator,
|
||||
EditorUtilityWindowCoordinator& utilityCoordinator);
|
||||
|
||||
EditorContext& GetEditorContext() {
|
||||
return m_editorContext;
|
||||
}
|
||||
|
||||
const EditorContext& GetEditorContext() const {
|
||||
return m_editorContext;
|
||||
}
|
||||
|
||||
const EditorWindowHostConfig& GetHostConfig() const {
|
||||
return m_hostConfig;
|
||||
}
|
||||
|
||||
const std::filesystem::path& GetRepoRoot() const {
|
||||
return m_repoRoot;
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<EditorWindow>>& GetWindows() {
|
||||
return m_windows;
|
||||
}
|
||||
|
||||
const std::vector<std::unique_ptr<EditorWindow>>& GetWindows() const {
|
||||
return m_windows;
|
||||
}
|
||||
|
||||
void LogRuntimeTrace(std::string_view channel, std::string_view message) const;
|
||||
|
||||
private:
|
||||
friend class EditorWindowLifecycleCoordinator;
|
||||
|
||||
EditorWindowHostConfig m_hostConfig = {};
|
||||
std::filesystem::path m_repoRoot = {};
|
||||
EditorContext& m_editorContext;
|
||||
std::vector<std::unique_ptr<EditorWindow>> m_windows = {};
|
||||
EditorWindow* m_pendingCreateWindow = nullptr;
|
||||
EditorWindowLifecycleCoordinator* m_lifecycleCoordinator = nullptr;
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user