关键节点
This commit is contained in:
120
editor/app/Composition/EditorShellRuntime.h
Normal file
120
editor/app/Composition/EditorShellRuntime.h
Normal file
@@ -0,0 +1,120 @@
|
||||
#pragma once
|
||||
|
||||
#include "Composition/EditorShellDrawComposer.h"
|
||||
#include "Composition/EditorShellHostedPanelCoordinator.h"
|
||||
#include "Composition/EditorShellInteractionEngine.h"
|
||||
#include "Composition/EditorShellSessionCoordinator.h"
|
||||
#include "Composition/EditorShellVariant.h"
|
||||
#include "Features/Console/ConsolePanel.h"
|
||||
#include "Features/Hierarchy/HierarchyPanel.h"
|
||||
#include "Features/Inspector/InspectorPanel.h"
|
||||
#include "Features/Project/ProjectPanel.h"
|
||||
#include "Features/Scene/SceneEditCommandRoute.h"
|
||||
#include "Features/Scene/SceneViewportFeature.h"
|
||||
#include "Rendering/Assets/BuiltInIcons.h"
|
||||
#include "Rendering/Viewport/ViewportHostService.h"
|
||||
#include "Composition/WorkspaceEventSync.h"
|
||||
|
||||
#include <XCEditor/Shell/UIEditorShellInteraction.h>
|
||||
#include <XCEditor/Docking/UIEditorDockHostTransfer.h>
|
||||
#include <XCEditor/Foundation/UIEditorTextMeasurement.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceLayoutPersistence.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceSplitterDragCorrection.h>
|
||||
|
||||
#include <XCEngine/UI/DrawData.h>
|
||||
|
||||
#include <filesystem>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
class EditorContext;
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
|
||||
namespace XCEngine::UI::Editor::Rendering::Host {
|
||||
|
||||
class UiTextureHost;
|
||||
class ViewportRenderHost;
|
||||
|
||||
} // namespace XCEngine::UI::Editor::Rendering::Host
|
||||
|
||||
namespace XCEngine::Rendering {
|
||||
|
||||
class RenderContext;
|
||||
|
||||
} // namespace XCEngine::Rendering
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
class EditorShellRuntime {
|
||||
public:
|
||||
void Initialize(
|
||||
const std::filesystem::path& repoRoot,
|
||||
Rendering::Host::UiTextureHost& textureHost,
|
||||
UIEditorTextMeasurer& textMeasurer);
|
||||
void Shutdown();
|
||||
void ResetInteractionState();
|
||||
void AttachViewportWindowRenderer(Rendering::Host::ViewportRenderHost& renderer);
|
||||
void DetachViewportWindowRenderer();
|
||||
void SetViewportSurfacePresentationEnabled(bool enabled);
|
||||
|
||||
void Update(
|
||||
EditorContext& context,
|
||||
UIEditorWorkspaceController& workspaceController,
|
||||
const ::XCEngine::UI::UIRect& bounds,
|
||||
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
||||
std::string_view captureText,
|
||||
EditorShellVariant shellVariant = EditorShellVariant::Primary,
|
||||
bool useDetachedTitleBarTabStrip = false,
|
||||
float detachedTitleBarTabHeight = 0.0f,
|
||||
float detachedWindowChromeHeight = 0.0f);
|
||||
void RenderRequestedViewports(
|
||||
const ::XCEngine::Rendering::RenderContext& renderContext);
|
||||
void Append(::XCEngine::UI::UIDrawData& drawData) const;
|
||||
|
||||
const UIEditorShellInteractionFrame& GetShellFrame() const;
|
||||
const UIEditorShellInteractionState& GetShellInteractionState() const;
|
||||
const std::vector<WorkspaceTraceEntry>& GetTraceEntries() const;
|
||||
const std::string& GetBuiltInIconError() const;
|
||||
void SetExternalDockHostDropPreview(
|
||||
const Widgets::UIEditorDockHostDropPreviewState& preview);
|
||||
void ClearExternalDockHostDropPreview();
|
||||
|
||||
ProjectPanel::CursorKind GetHostedContentCursorKind() const;
|
||||
Widgets::UIEditorDockHostCursorKind GetDockCursorKind() const;
|
||||
bool TryResolveDockTabDragHotspot(
|
||||
std::string_view nodeId,
|
||||
std::string_view panelId,
|
||||
const ::XCEngine::UI::UIPoint& point,
|
||||
::XCEngine::UI::UIPoint& outHotspot) const;
|
||||
UIEditorDockHostTabDropTarget ResolveDockTabDropTarget(
|
||||
const ::XCEngine::UI::UIPoint& point) const;
|
||||
bool HasHostedContentCapture() const;
|
||||
bool HasShellInteractiveCapture() const;
|
||||
bool HasInteractiveCapture() const;
|
||||
|
||||
private:
|
||||
ViewportHostService m_viewportHostService = {};
|
||||
SceneViewportFeature m_sceneViewportFeature = {};
|
||||
BuiltInIcons m_builtInIcons = {};
|
||||
Rendering::Host::UiTextureHost* m_textureHost = nullptr;
|
||||
ConsolePanel m_consolePanel = {};
|
||||
HierarchyPanel m_hierarchyPanel = {};
|
||||
InspectorPanel m_inspectorPanel = {};
|
||||
ProjectPanel m_projectPanel = {};
|
||||
SceneEditCommandRoute m_sceneEditCommandRoute = {};
|
||||
UIEditorShellInteractionState m_shellInteractionState = {};
|
||||
UIEditorShellInteractionFrame m_shellFrame = {};
|
||||
std::vector<WorkspaceTraceEntry> m_traceEntries = {};
|
||||
UIEditorWorkspaceSplitterDragCorrectionState m_splitterDragCorrectionState = {};
|
||||
EditorShellDrawComposer m_drawComposer = {};
|
||||
EditorShellHostedPanelCoordinator m_hostedPanelCoordinator = {};
|
||||
EditorShellInteractionEngine m_interactionEngine = {};
|
||||
EditorShellSessionCoordinator m_sessionCoordinator = {};
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
|
||||
|
||||
Reference in New Issue
Block a user