refactor(new_editor): continue architecture closeout

This commit is contained in:
2026-04-15 22:47:42 +08:00
parent a458f2838c
commit dde03c5241
225 changed files with 4214 additions and 5196 deletions

View File

@@ -1,8 +1,8 @@
#include "Platform/Win32/EditorWindow.h"
#include "Platform/Win32/EditorWindowConstants.h"
#include "Platform/Win32/EditorWindowInputSupport.h"
#include "Platform/Win32/EditorWindowRuntimeSupport.h"
#include "Platform/Win32/EditorWindowRuntimeInternal.h"
#include "Platform/Win32/EditorWindowStyle.h"
#include "State/EditorContext.h"
#include <XCEngine/UI/DrawData.h>
@@ -10,24 +10,24 @@
namespace XCEngine::UI::Editor::App {
using namespace EditorWindowSupport;
using namespace EditorWindowInternal;
using ::XCEngine::UI::UIDrawData;
using ::XCEngine::UI::UIDrawList;
using ::XCEngine::UI::UIInputEvent;
using ::XCEngine::UI::UIPoint;
using ::XCEngine::UI::UIRect;
void EditorWindow::RenderFrame(
EditorWindowFrameTransferRequests EditorWindow::RenderFrame(
EditorContext& editorContext,
bool globalTabDragActive) {
if (!m_render.ready || m_window.hwnd == nullptr) {
return;
return {};
}
UINT pixelWidth = 0u;
UINT pixelHeight = 0u;
if (!ResolveRenderClientPixelSize(pixelWidth, pixelHeight)) {
return;
return {};
}
const float width = PixelsToDips(static_cast<float>(pixelWidth));
@@ -40,8 +40,10 @@ void EditorWindow::RenderFrame(
UIRect(0.0f, 0.0f, width, height),
kShellSurfaceColor);
EditorWindowFrameTransferRequests transferRequests = {};
if (editorContext.IsValid()) {
RenderRuntimeFrame(editorContext, globalTabDragActive, workspaceBounds, drawList);
transferRequests =
RenderRuntimeFrame(editorContext, globalTabDragActive, workspaceBounds, drawList);
} else {
RenderInvalidFrame(editorContext, drawList);
}
@@ -60,19 +62,22 @@ void EditorWindow::RenderFrame(
pixelWidth,
pixelHeight,
presentResult.framePresented);
return transferRequests;
}
void EditorWindow::OnPaintMessage(
EditorWindowFrameTransferRequests EditorWindow::OnPaintMessage(
EditorContext& editorContext,
bool globalTabDragActive) {
if (!m_render.ready || m_window.hwnd == nullptr) {
return;
return {};
}
PAINTSTRUCT paintStruct = {};
BeginPaint(m_window.hwnd, &paintStruct);
RenderFrame(editorContext, globalTabDragActive);
const EditorWindowFrameTransferRequests transferRequests =
RenderFrame(editorContext, globalTabDragActive);
EndPaint(m_window.hwnd, &paintStruct);
return transferRequests;
}
UIRect EditorWindow::ResolveWorkspaceBounds(float clientWidthDips, float clientHeightDips) const {