refactor(editor): isolate windowing from composition runtime
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
#include "Frame/EditorWindowFrameOrchestrator.h"
|
||||
|
||||
#include "EditorContext.h"
|
||||
#include "EditorShellRuntime.h"
|
||||
#include "EditorShellVariant.h"
|
||||
#include "Windowing/EditorWindowMetrics.h"
|
||||
#include "EditorWindowDiagnostics.h"
|
||||
#include "EditorWindowVisuals.h"
|
||||
@@ -48,9 +45,9 @@ std::string DescribeInputEventType(const UIInputEvent& event) {
|
||||
} // namespace
|
||||
|
||||
EditorWindowFrameTransferRequests EditorWindowFrameOrchestrator::UpdateAndAppend(
|
||||
EditorContext& editorContext,
|
||||
EditorFrameServices& frameServices,
|
||||
UIEditorWorkspaceController& workspaceController,
|
||||
EditorShellRuntime& shellRuntime,
|
||||
EditorWorkspaceShellRuntime& shellRuntime,
|
||||
const ::XCEngine::UI::UIRect& workspaceBounds,
|
||||
const std::vector<UIInputEvent>& frameEvents,
|
||||
const std::optional<EditorWindowScreenPoint>& cursorScreenPoint,
|
||||
@@ -60,13 +57,13 @@ EditorWindowFrameTransferRequests EditorWindowFrameOrchestrator::UpdateAndAppend
|
||||
bool useDetachedTitleBarTabStrip,
|
||||
UIDrawData& drawData) const {
|
||||
LogInputTrace(
|
||||
editorContext,
|
||||
frameServices,
|
||||
workspaceController,
|
||||
shellRuntime.GetShellInteractionState(),
|
||||
frameEvents);
|
||||
|
||||
shellRuntime.Update(
|
||||
editorContext,
|
||||
frameServices,
|
||||
workspaceController,
|
||||
workspaceBounds,
|
||||
frameEvents,
|
||||
@@ -87,7 +84,7 @@ EditorWindowFrameTransferRequests EditorWindowFrameOrchestrator::UpdateAndAppend
|
||||
dockHostInteractionState,
|
||||
shellFrame);
|
||||
if (const std::optional<EditorUtilityWindowKind> requestedKind =
|
||||
editorContext.ConsumeOpenUtilityWindowRequest();
|
||||
frameServices.ConsumeOpenUtilityWindowRequest();
|
||||
requestedKind.has_value()) {
|
||||
transferRequests.utility.openUtilityWindow = EditorWindowOpenUtilityWindowRequest{
|
||||
.kind = *requestedKind,
|
||||
@@ -107,7 +104,7 @@ EditorWindowFrameTransferRequests EditorWindowFrameOrchestrator::UpdateAndAppend
|
||||
}
|
||||
|
||||
void EditorWindowFrameOrchestrator::AppendInvalidFrame(
|
||||
EditorContext& editorContext,
|
||||
EditorFrameServices& frameServices,
|
||||
UIDrawList& drawList) const {
|
||||
drawList.AddText(
|
||||
UIPoint(28.0f, 28.0f),
|
||||
@@ -116,9 +113,9 @@ void EditorWindowFrameOrchestrator::AppendInvalidFrame(
|
||||
16.0f);
|
||||
drawList.AddText(
|
||||
UIPoint(28.0f, 54.0f),
|
||||
editorContext.GetValidationMessage().empty()
|
||||
frameServices.GetValidationMessage().empty()
|
||||
? std::string("Unknown validation error.")
|
||||
: editorContext.GetValidationMessage(),
|
||||
: frameServices.GetValidationMessage(),
|
||||
kShellMutedTextColor,
|
||||
12.0f);
|
||||
}
|
||||
@@ -144,7 +141,7 @@ std::string EditorWindowFrameOrchestrator::DescribeInputEvents(
|
||||
}
|
||||
|
||||
void EditorWindowFrameOrchestrator::LogInputTrace(
|
||||
EditorContext& editorContext,
|
||||
EditorFrameServices& frameServices,
|
||||
const UIEditorWorkspaceController& workspaceController,
|
||||
const UIEditorShellInteractionState& shellInteractionState,
|
||||
const std::vector<UIInputEvent>& frameEvents) const {
|
||||
@@ -155,7 +152,7 @@ void EditorWindowFrameOrchestrator::LogInputTrace(
|
||||
AppendUIEditorRuntimeTrace(
|
||||
"input",
|
||||
DescribeInputEvents(frameEvents) + " | " +
|
||||
editorContext.DescribeWorkspaceState(
|
||||
frameServices.DescribeWorkspaceState(
|
||||
workspaceController,
|
||||
shellInteractionState));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user