Refactor editor workspace panel runtime boundary
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
#include "Rendering/Host/UiTextureHost.h"
|
||||
#include "Rendering/Host/ViewportRenderHost.h"
|
||||
#include "Composition/EditorContext.h"
|
||||
#include "Composition/EditorPanelIds.h"
|
||||
#include <XCEditor/Shell/UIEditorShellCapturePolicy.h>
|
||||
#include <XCEngine/Rendering/RenderContext.h>
|
||||
|
||||
@@ -14,16 +13,15 @@ void EditorShellRuntime::Initialize(
|
||||
UIEditorTextMeasurer& textMeasurer) {
|
||||
m_textureHost = &textureHost;
|
||||
m_builtInIcons.Initialize(textureHost);
|
||||
m_sceneViewportFeature.Initialize(
|
||||
repoRoot,
|
||||
textureHost,
|
||||
&m_builtInIcons,
|
||||
m_viewportHostService);
|
||||
m_hierarchyPanel.SetBuiltInIcons(&m_builtInIcons);
|
||||
m_hierarchyPanel.SetTextMeasurer(&textMeasurer);
|
||||
m_projectPanel.SetBuiltInIcons(&m_builtInIcons);
|
||||
m_projectPanel.SetTextMeasurer(&textMeasurer);
|
||||
m_hierarchyPanel.Initialize();
|
||||
m_workspacePanels = CreateEditorWorkspacePanelRuntimeSet();
|
||||
m_workspacePanels.Initialize(
|
||||
EditorWorkspacePanelInitializationContext{
|
||||
.repoRoot = repoRoot,
|
||||
.textureHost = textureHost,
|
||||
.textMeasurer = textMeasurer,
|
||||
.builtInIcons = m_builtInIcons,
|
||||
.viewportHostService = m_viewportHostService,
|
||||
});
|
||||
}
|
||||
|
||||
void EditorShellRuntime::AttachViewportWindowRenderer(Rendering::Host::ViewportRenderHost& renderer) {
|
||||
@@ -43,12 +41,17 @@ void EditorShellRuntime::Shutdown() {
|
||||
m_shellInteractionState = {};
|
||||
m_splitterDragCorrectionState = {};
|
||||
m_traceEntries.clear();
|
||||
m_sceneEditCommandRoute = {};
|
||||
if (m_textureHost != nullptr) {
|
||||
m_sceneViewportFeature.Shutdown(*m_textureHost, m_viewportHostService);
|
||||
m_workspacePanels.Shutdown(
|
||||
EditorWorkspacePanelShutdownContext{
|
||||
.textureHost = *m_textureHost,
|
||||
.viewportHostService = m_viewportHostService,
|
||||
});
|
||||
m_workspacePanels = {};
|
||||
m_builtInIcons.Shutdown();
|
||||
m_textureHost = nullptr;
|
||||
} else {
|
||||
m_workspacePanels = {};
|
||||
m_builtInIcons.Shutdown();
|
||||
}
|
||||
m_viewportHostService.Shutdown();
|
||||
@@ -59,9 +62,7 @@ void EditorShellRuntime::ResetInteractionState() {
|
||||
m_shellInteractionState = {};
|
||||
m_splitterDragCorrectionState = {};
|
||||
m_traceEntries.clear();
|
||||
m_sceneViewportFeature.ResetInteractionState();
|
||||
m_hierarchyPanel.ResetInteractionState();
|
||||
m_projectPanel.ResetInteractionState();
|
||||
m_workspacePanels.ResetInteractionState();
|
||||
}
|
||||
|
||||
const UIEditorShellInteractionFrame& EditorShellRuntime::GetShellFrame() const {
|
||||
@@ -91,8 +92,8 @@ void EditorShellRuntime::ClearExternalDockHostDropPreview() {
|
||||
.dockHostState.dropPreview = {};
|
||||
}
|
||||
|
||||
ProjectPanel::CursorKind EditorShellRuntime::GetHostedContentCursorKind() const {
|
||||
return m_projectPanel.GetCursorKind();
|
||||
EditorWorkspacePanelCursorKind EditorShellRuntime::GetHostedContentCursorKind() const {
|
||||
return m_workspacePanels.GetHostedContentCursorKind();
|
||||
}
|
||||
|
||||
Widgets::UIEditorDockHostCursorKind EditorShellRuntime::GetDockCursorKind() const {
|
||||
@@ -121,8 +122,7 @@ UIEditorDockHostTabDropTarget EditorShellRuntime::ResolveDockTabDropTarget(
|
||||
}
|
||||
|
||||
bool EditorShellRuntime::HasHostedContentCapture() const {
|
||||
return m_hierarchyPanel.HasActivePointerCapture() ||
|
||||
m_projectPanel.HasActivePointerCapture();
|
||||
return m_workspacePanels.HasActivePointerCapture();
|
||||
}
|
||||
|
||||
bool EditorShellRuntime::HasShellInteractiveCapture() const {
|
||||
@@ -148,11 +148,7 @@ void EditorShellRuntime::Append(::XCEngine::UI::UIDrawData& drawData) const {
|
||||
.shellFrame = m_shellFrame,
|
||||
.shellInteractionState = m_shellInteractionState,
|
||||
.builtInIcons = m_builtInIcons,
|
||||
.consolePanel = m_consolePanel,
|
||||
.hierarchyPanel = m_hierarchyPanel,
|
||||
.inspectorPanel = m_inspectorPanel,
|
||||
.projectPanel = m_projectPanel,
|
||||
.sceneViewportFeature = m_sceneViewportFeature,
|
||||
.workspacePanels = m_workspacePanels,
|
||||
},
|
||||
drawData);
|
||||
}
|
||||
@@ -178,11 +174,7 @@ void EditorShellRuntime::Update(
|
||||
.workspaceController = workspaceController,
|
||||
.captureText = captureText,
|
||||
.shellVariant = shellVariant,
|
||||
.hierarchyPanel = m_hierarchyPanel,
|
||||
.inspectorPanel = m_inspectorPanel,
|
||||
.projectPanel = m_projectPanel,
|
||||
.sceneEditCommandRoute = m_sceneEditCommandRoute,
|
||||
.sceneViewportFeature = m_sceneViewportFeature,
|
||||
.workspacePanels = m_workspacePanels,
|
||||
});
|
||||
};
|
||||
m_interactionEngine.Update(
|
||||
@@ -210,16 +202,11 @@ void EditorShellRuntime::Update(
|
||||
.shellInteractionState = m_shellInteractionState,
|
||||
.inputEvents = inputEvents,
|
||||
.shellInteractiveCaptureActive = HasShellInteractiveCapture(),
|
||||
.consolePanel = m_consolePanel,
|
||||
.hierarchyPanel = m_hierarchyPanel,
|
||||
.inspectorPanel = m_inspectorPanel,
|
||||
.projectPanel = m_projectPanel,
|
||||
.sceneViewportFeature = m_sceneViewportFeature,
|
||||
.workspacePanels = m_workspacePanels,
|
||||
});
|
||||
m_traceEntries = SyncWorkspaceEvents(
|
||||
context,
|
||||
m_hierarchyPanel.GetFrameEvents(),
|
||||
m_projectPanel.GetFrameEvents());
|
||||
m_workspacePanels.CollectFrameEvents());
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
|
||||
Reference in New Issue
Block a user