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

@@ -13,9 +13,6 @@ endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/dock_host_basic/CMakeLists.txt")
add_subdirectory(dock_host_basic)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/dock_tab_reorder_same_stack/CMakeLists.txt")
add_subdirectory(dock_tab_reorder_same_stack)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/panel_content_host_basic/CMakeLists.txt")
add_subdirectory(panel_content_host_basic)
endif()

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,8 +6,8 @@
#include <XCEditor/Fields/UIEditorAssetField.h>
#include <XCEditor/Fields/UIEditorAssetFieldInteraction.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,8 +6,8 @@
#include <XCEditor/Foundation/UIEditorTheme.h>
#include <XCEditor/Fields/UIEditorBoolField.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,8 +6,8 @@
#include <XCEditor/Foundation/UIEditorTheme.h>
#include <XCEditor/Fields/UIEditorColorField.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>

View File

@@ -3,14 +3,14 @@
#endif
#include <XCEditor/Foundation/UIEditorCommandDispatcher.h>
#include <XCEditor/Shell/UIEditorMenuModel.h>
#include <XCEditor/Shell/UIEditorMenuSession.h>
#include <XCEditor/Menu/UIEditorMenuModel.h>
#include <XCEditor/Menu/UIEditorMenuSession.h>
#include <XCEditor/Foundation/UIEditorShortcutManager.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Shell/UIEditorWorkspaceModel.h>
#include <XCEditor/Shell/UIEditorMenuPopup.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEditor/Workspace/UIEditorWorkspaceModel.h>
#include <XCEditor/Menu/UIEditorMenuPopup.h>
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -2,12 +2,12 @@
#define NOMINMAX
#endif
#include <XCEditor/Shell/UIEditorDockHostInteraction.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Shell/UIEditorWorkspaceModel.h>
#include <XCEditor/Shell/UIEditorDockHost.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include <XCEditor/Docking/UIEditorDockHostInteraction.h>
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEditor/Workspace/UIEditorWorkspaceModel.h>
#include <XCEditor/Docking/UIEditorDockHost.h>
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>
@@ -124,16 +124,12 @@ std::string DescribeHitTarget(const UIEditorDockHostHitTarget& target) {
return "TabStripBackground: " + target.nodeId;
case UIEditorDockHostHitTargetKind::Tab:
return "Tab: " + target.panelId;
case UIEditorDockHostHitTargetKind::TabCloseButton:
return "TabClose: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelHeader:
return "PanelHeader: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelBody:
return "PanelBody: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelFooter:
return "PanelFooter: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelCloseButton:
return "PanelClose: " + target.panelId;
case UIEditorDockHostHitTargetKind::None:
default:
return "None";

View File

@@ -1,30 +0,0 @@
add_executable(editor_ui_dock_tab_reorder_same_stack_validation WIN32
main.cpp
)
target_include_directories(editor_ui_dock_tab_reorder_same_stack_validation PRIVATE
${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}/include
${XCENGINE_EDITOR_UI_TESTS_EDITOR_ROOT}
${CMAKE_SOURCE_DIR}/engine/include
)
target_compile_definitions(editor_ui_dock_tab_reorder_same_stack_validation PRIVATE
UNICODE
_UNICODE
XCENGINE_EDITOR_UI_TESTS_REPO_ROOT="${XCENGINE_EDITOR_UI_TESTS_REPO_ROOT_PATH}"
)
if(MSVC)
target_compile_options(editor_ui_dock_tab_reorder_same_stack_validation PRIVATE /utf-8 /FS)
set_property(TARGET editor_ui_dock_tab_reorder_same_stack_validation PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
target_link_libraries(editor_ui_dock_tab_reorder_same_stack_validation PRIVATE
XCUIEditorLib
XCUIEditorHost
)
set_target_properties(editor_ui_dock_tab_reorder_same_stack_validation PROPERTIES
OUTPUT_NAME "XCUIEditorDockTabReorderSameStackValidation"
)

View File

@@ -1,680 +0,0 @@
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <XCEditor/Shell/UIEditorDockHost.h>
#include <XCEditor/Shell/UIEditorDockHostInteraction.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Shell/UIEditorWorkspaceModel.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>
#include <windows.h>
#include <windowsx.h>
#include <algorithm>
#include <filesystem>
#include <sstream>
#include <string>
#include <string_view>
#include <vector>
#ifndef XCENGINE_EDITOR_UI_TESTS_REPO_ROOT
#define XCENGINE_EDITOR_UI_TESTS_REPO_ROOT "."
#endif
namespace {
using XCEngine::Input::KeyCode;
using XCEngine::UI::UIColor;
using XCEngine::UI::UIDrawData;
using XCEngine::UI::UIDrawList;
using XCEngine::UI::UIInputEvent;
using XCEngine::UI::UIInputEventType;
using XCEngine::UI::UIPoint;
using XCEngine::UI::UIPointerButton;
using XCEngine::UI::UIRect;
using XCEngine::UI::Editor::BuildDefaultUIEditorWorkspaceController;
using XCEngine::UI::Editor::BuildUIEditorWorkspacePanel;
using XCEngine::UI::Editor::BuildUIEditorWorkspaceSingleTabStack;
using XCEngine::UI::Editor::BuildUIEditorWorkspaceSplit;
using XCEngine::UI::Editor::BuildUIEditorWorkspaceTabStack;
using XCEngine::UI::Editor::FindUIEditorWorkspaceNode;
using XCEngine::UI::Editor::Host::AutoScreenshotController;
using XCEngine::UI::Editor::Host::NativeRenderer;
using XCEngine::UI::Editor::UIEditorDockHostInteractionFrame;
using XCEngine::UI::Editor::UIEditorDockHostInteractionResult;
using XCEngine::UI::Editor::UIEditorDockHostInteractionState;
using XCEngine::UI::Editor::UIEditorDockHostTabStripInteractionEntry;
using XCEngine::UI::Editor::UIEditorPanelRegistry;
using XCEngine::UI::Editor::UIEditorWorkspaceController;
using XCEngine::UI::Editor::UIEditorWorkspaceLayoutOperationStatus;
using XCEngine::UI::Editor::UIEditorWorkspaceModel;
using XCEngine::UI::Editor::UIEditorWorkspaceSplitAxis;
using XCEngine::UI::Editor::UpdateUIEditorDockHostInteraction;
using XCEngine::UI::Editor::Widgets::AppendUIEditorDockHostBackground;
using XCEngine::UI::Editor::Widgets::AppendUIEditorDockHostForeground;
using XCEngine::UI::Editor::Widgets::UIEditorDockHostHitTarget;
using XCEngine::UI::Editor::Widgets::UIEditorDockHostHitTargetKind;
using XCEngine::UI::Editor::Widgets::UIEditorDockHostTabStackLayout;
constexpr const wchar_t* kWindowClassName = L"XCUIEditorDockTabReorderSameStackValidation";
constexpr const wchar_t* kWindowTitle = L"XCUI Editor | Dock Tab Reorder Same Stack";
constexpr UIColor kWindowBg(0.10f, 0.10f, 0.10f, 1.0f);
constexpr UIColor kCardBg(0.16f, 0.16f, 0.16f, 1.0f);
constexpr UIColor kCardBorder(0.28f, 0.28f, 0.28f, 1.0f);
constexpr UIColor kPreviewBg(0.12f, 0.12f, 0.12f, 1.0f);
constexpr UIColor kTextPrimary(0.92f, 0.92f, 0.92f, 1.0f);
constexpr UIColor kTextMuted(0.74f, 0.74f, 0.74f, 1.0f);
constexpr UIColor kTextWeak(0.57f, 0.57f, 0.57f, 1.0f);
constexpr UIColor kButtonBg(0.24f, 0.24f, 0.24f, 1.0f);
constexpr UIColor kButtonHover(0.31f, 0.31f, 0.31f, 1.0f);
constexpr UIColor kButtonBorder(0.44f, 0.44f, 0.44f, 1.0f);
constexpr UIColor kOk(0.47f, 0.71f, 0.50f, 1.0f);
constexpr UIColor kWarn(0.85f, 0.68f, 0.36f, 1.0f);
enum class ActionId : unsigned char {
Reset = 0,
Capture
};
struct ButtonState {
ActionId action = ActionId::Reset;
std::string label = {};
UIRect rect = {};
bool hovered = false;
};
std::filesystem::path ResolveRepoRootPath() {
std::string root = XCENGINE_EDITOR_UI_TESTS_REPO_ROOT;
if (root.size() >= 2u && root.front() == '"' && root.back() == '"') {
root = root.substr(1u, root.size() - 2u);
}
return std::filesystem::path(root).lexically_normal();
}
bool ContainsPoint(const UIRect& rect, float x, float y) {
return x >= rect.x &&
x <= rect.x + rect.width &&
y >= rect.y &&
y <= rect.y + rect.height;
}
std::string FormatBool(bool value) {
return value ? "" : "";
}
std::string FormatOptionalIndex(std::size_t index) {
if (index == XCEngine::UI::Editor::Widgets::UIEditorTabStripInvalidIndex) {
return "";
}
return std::to_string(index);
}
std::string DescribeHitTarget(const UIEditorDockHostHitTarget& target) {
switch (target.kind) {
case UIEditorDockHostHitTargetKind::Tab:
return "标签: " + target.panelId;
case UIEditorDockHostHitTargetKind::TabStripBackground:
return "标签栏空白";
case UIEditorDockHostHitTargetKind::PanelBody:
return "面板主体: " + target.panelId;
case UIEditorDockHostHitTargetKind::SplitterHandle:
return "分割条: " + target.nodeId;
case UIEditorDockHostHitTargetKind::None:
default:
return "";
}
}
void DrawCard(
UIDrawList& drawList,
const UIRect& rect,
std::string_view title,
std::string_view subtitle = {}) {
drawList.AddFilledRect(rect, kCardBg, 10.0f);
drawList.AddRectOutline(rect, kCardBorder, 1.0f, 10.0f);
drawList.AddText(UIPoint(rect.x + 16.0f, rect.y + 14.0f), std::string(title), kTextPrimary, 17.0f);
if (!subtitle.empty()) {
drawList.AddText(UIPoint(rect.x + 16.0f, rect.y + 38.0f), std::string(subtitle), kTextMuted, 12.0f);
}
}
void DrawButton(UIDrawList& drawList, const ButtonState& button) {
drawList.AddFilledRect(button.rect, button.hovered ? kButtonHover : kButtonBg, 8.0f);
drawList.AddRectOutline(button.rect, kButtonBorder, 1.0f, 8.0f);
drawList.AddText(UIPoint(button.rect.x + 14.0f, button.rect.y + 10.0f), button.label, kTextPrimary, 12.0f);
}
UIEditorPanelRegistry BuildPanelRegistry() {
UIEditorPanelRegistry registry = {};
registry.panels = {
{ "doc-a", "Document A", {}, true, true, true },
{ "doc-b", "Document B", {}, true, true, true },
{ "doc-c", "Document C", {}, true, true, true },
{ "details", "Details", {}, true, true, true }
};
return registry;
}
UIEditorWorkspaceModel BuildWorkspace() {
UIEditorWorkspaceModel workspace = {};
workspace.root = BuildUIEditorWorkspaceSplit(
"root-split",
UIEditorWorkspaceSplitAxis::Horizontal,
0.72f,
BuildUIEditorWorkspaceTabStack(
"document-tabs",
{
BuildUIEditorWorkspacePanel("doc-a-node", "doc-a", "Document A", true),
BuildUIEditorWorkspacePanel("doc-b-node", "doc-b", "Document B", true),
BuildUIEditorWorkspacePanel("doc-c-node", "doc-c", "Document C", true)
},
0u),
BuildUIEditorWorkspaceSingleTabStack("details-node", "details", "Details", true));
workspace.activePanelId = "doc-a";
return workspace;
}
std::string CollectDocumentTabOrder(const UIEditorWorkspaceController& controller) {
const auto* node = FindUIEditorWorkspaceNode(controller.GetWorkspace(), "document-tabs");
if (node == nullptr) {
return "缺失";
}
std::ostringstream stream = {};
for (std::size_t index = 0; index < node->children.size(); ++index) {
if (index > 0u) {
stream << " | ";
}
stream << node->children[index].panel.panelId;
}
return stream.str();
}
const XCEngine::UI::Editor::Widgets::UIEditorDockHostTabStackLayout* FindDocumentTabStackLayout(
const UIEditorDockHostInteractionFrame& frame) {
for (const auto& tabStack : frame.layout.tabStacks) {
if (tabStack.nodeId == "document-tabs") {
return &tabStack;
}
}
return nullptr;
}
const UIEditorDockHostTabStripInteractionEntry* FindDocumentTabStripInteractionEntry(
const UIEditorDockHostInteractionState& state) {
for (const UIEditorDockHostTabStripInteractionEntry& entry : state.tabStripInteractions) {
if (entry.nodeId == "document-tabs") {
return &entry;
}
}
return nullptr;
}
class ScenarioApp {
public:
int Run(HINSTANCE hInstance, int nCmdShow) {
if (!Initialize(hInstance, nCmdShow)) {
Shutdown();
return 1;
}
MSG message = {};
while (message.message != WM_QUIT) {
if (PeekMessageW(&message, nullptr, 0U, 0U, PM_REMOVE)) {
TranslateMessage(&message);
DispatchMessageW(&message);
continue;
}
RenderFrame();
Sleep(8);
}
Shutdown();
return static_cast<int>(message.wParam);
}
private:
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
if (message == WM_NCCREATE) {
const auto* createStruct = reinterpret_cast<CREATESTRUCTW*>(lParam);
auto* app = reinterpret_cast<ScenarioApp*>(createStruct->lpCreateParams);
SetWindowLongPtrW(hwnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(app));
return TRUE;
}
auto* app = reinterpret_cast<ScenarioApp*>(GetWindowLongPtrW(hwnd, GWLP_USERDATA));
switch (message) {
case WM_SIZE:
if (app != nullptr && wParam != SIZE_MINIMIZED) {
app->m_renderer.Resize(static_cast<UINT>(LOWORD(lParam)), static_cast<UINT>(HIWORD(lParam)));
}
return 0;
case WM_PAINT:
if (app != nullptr) {
PAINTSTRUCT paintStruct = {};
BeginPaint(hwnd, &paintStruct);
app->RenderFrame();
EndPaint(hwnd, &paintStruct);
return 0;
}
break;
case WM_MOUSEMOVE:
if (app != nullptr) {
if (!app->m_trackingMouseLeave) {
TRACKMOUSEEVENT trackMouseEvent = {};
trackMouseEvent.cbSize = sizeof(trackMouseEvent);
trackMouseEvent.dwFlags = TME_LEAVE;
trackMouseEvent.hwndTrack = hwnd;
if (TrackMouseEvent(&trackMouseEvent)) {
app->m_trackingMouseLeave = true;
}
}
app->HandleMouseMove(
static_cast<float>(GET_X_LPARAM(lParam)),
static_cast<float>(GET_Y_LPARAM(lParam)));
return 0;
}
break;
case WM_MOUSELEAVE:
if (app != nullptr) {
app->m_trackingMouseLeave = false;
UIInputEvent event = {};
event.type = UIInputEventType::PointerLeave;
app->m_pendingInputEvents.push_back(event);
return 0;
}
break;
case WM_LBUTTONDOWN:
if (app != nullptr) {
SetFocus(hwnd);
app->HandleLeftButtonDown(
static_cast<float>(GET_X_LPARAM(lParam)),
static_cast<float>(GET_Y_LPARAM(lParam)));
return 0;
}
break;
case WM_LBUTTONUP:
if (app != nullptr) {
app->HandleLeftButtonUp(
static_cast<float>(GET_X_LPARAM(lParam)),
static_cast<float>(GET_Y_LPARAM(lParam)));
return 0;
}
break;
case WM_SETFOCUS:
if (app != nullptr) {
UIInputEvent event = {};
event.type = UIInputEventType::FocusGained;
app->m_pendingInputEvents.push_back(event);
return 0;
}
break;
case WM_KILLFOCUS:
if (app != nullptr) {
UIInputEvent event = {};
event.type = UIInputEventType::FocusLost;
app->m_pendingInputEvents.push_back(event);
app->m_lastInputCause = "focus_lost";
return 0;
}
break;
case WM_CAPTURECHANGED:
if (app != nullptr &&
!app->m_interactionState.activeTabDragNodeId.empty() &&
reinterpret_cast<HWND>(lParam) != hwnd) {
UIInputEvent event = {};
event.type = UIInputEventType::FocusLost;
app->m_pendingInputEvents.push_back(event);
app->m_lastInputCause = "focus_lost";
return 0;
}
break;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
if (app != nullptr) {
if (wParam == VK_F12) {
app->m_autoScreenshot.RequestCapture("manual_f12");
return 0;
}
UIInputEvent event = {};
event.type = UIInputEventType::KeyDown;
event.keyCode = static_cast<std::int32_t>(wParam == VK_ESCAPE ? KeyCode::Escape : KeyCode::None);
app->m_pendingInputEvents.push_back(event);
return 0;
}
break;
case WM_ERASEBKGND:
return 1;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
break;
}
return DefWindowProcW(hwnd, message, wParam, lParam);
}
bool Initialize(HINSTANCE hInstance, int nCmdShow) {
m_captureRoot =
ResolveRepoRootPath() / "tests/UI/Editor/integration/shell/dock_tab_reorder_same_stack/captures";
m_autoScreenshot.Initialize(m_captureRoot);
WNDCLASSEXW windowClass = {};
windowClass.cbSize = sizeof(windowClass);
windowClass.style = CS_HREDRAW | CS_VREDRAW;
windowClass.lpfnWndProc = &ScenarioApp::WndProc;
windowClass.hInstance = hInstance;
windowClass.hCursor = LoadCursorW(nullptr, IDC_ARROW);
windowClass.lpszClassName = kWindowClassName;
m_windowClassAtom = RegisterClassExW(&windowClass);
if (m_windowClassAtom == 0) {
return false;
}
m_hwnd = CreateWindowExW(
0,
kWindowClassName,
kWindowTitle,
WS_OVERLAPPEDWINDOW | WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
1500,
920,
nullptr,
nullptr,
hInstance,
this);
if (m_hwnd == nullptr) {
return false;
}
ShowWindow(m_hwnd, nCmdShow);
if (!m_renderer.Initialize(m_hwnd)) {
return false;
}
ResetScenario();
return true;
}
void Shutdown() {
if (GetCapture() == m_hwnd) {
ReleaseCapture();
}
m_autoScreenshot.Shutdown();
m_renderer.Shutdown();
if (m_hwnd != nullptr && IsWindow(m_hwnd)) {
DestroyWindow(m_hwnd);
}
if (m_windowClassAtom != 0) {
UnregisterClassW(kWindowClassName, GetModuleHandleW(nullptr));
}
}
void ResetScenario() {
if (GetCapture() == m_hwnd) {
ReleaseCapture();
}
m_controller = BuildDefaultUIEditorWorkspaceController(BuildPanelRegistry(), BuildWorkspace());
m_interactionState = {};
m_cachedFrame = {};
m_pendingInputEvents.clear();
m_lastInputCause.clear();
m_hoverText = "";
m_lastResult = "等待验证:请在同一标签栏内拖拽标签。";
m_lastResultColor = kWarn;
}
void UpdateLayout() {
RECT clientRect = {};
GetClientRect(m_hwnd, &clientRect);
const float width = static_cast<float>((std::max)(clientRect.right - clientRect.left, 1L));
const float height = static_cast<float>((std::max)(clientRect.bottom - clientRect.top, 1L));
constexpr float padding = 20.0f;
constexpr float sidebarWidth = 360.0f;
m_introRect = UIRect(padding, padding, width - padding * 2.0f, 168.0f);
m_previewRect = UIRect(
padding,
m_introRect.y + m_introRect.height + 16.0f,
width - sidebarWidth - padding * 3.0f,
height - m_introRect.height - padding * 3.0f);
m_stateRect = UIRect(
m_previewRect.x + m_previewRect.width + 20.0f,
m_previewRect.y,
sidebarWidth,
m_previewRect.height);
m_dockHostRect = UIRect(
m_previewRect.x + 16.0f,
m_previewRect.y + 64.0f,
m_previewRect.width - 32.0f,
m_previewRect.height - 80.0f);
const float buttonWidth = (m_stateRect.width - 44.0f) * 0.5f;
const float buttonY = m_stateRect.y + m_stateRect.height - 52.0f;
m_buttons = {
{ ActionId::Reset, "重置", UIRect(m_stateRect.x + 16.0f, buttonY, buttonWidth, 36.0f), false },
{ ActionId::Capture, "截图(F12)", UIRect(m_stateRect.x + 28.0f + buttonWidth, buttonY, buttonWidth, 36.0f), false }
};
}
void HandleMouseMove(float x, float y) {
UpdateLayout();
for (ButtonState& button : m_buttons) {
button.hovered = ContainsPoint(button.rect, x, y);
}
UIInputEvent event = {};
event.type = UIInputEventType::PointerMove;
event.position = UIPoint(x, y);
m_pendingInputEvents.push_back(event);
}
void HandleLeftButtonDown(float x, float y) {
UpdateLayout();
for (const ButtonState& button : m_buttons) {
if (ContainsPoint(button.rect, x, y)) {
ExecuteAction(button.action);
return;
}
}
UIInputEvent event = {};
event.type = UIInputEventType::PointerButtonDown;
event.position = UIPoint(x, y);
event.pointerButton = UIPointerButton::Left;
m_pendingInputEvents.push_back(event);
}
void HandleLeftButtonUp(float x, float y) {
UIInputEvent event = {};
event.type = UIInputEventType::PointerButtonUp;
event.position = UIPoint(x, y);
event.pointerButton = UIPointerButton::Left;
m_pendingInputEvents.push_back(event);
}
void ExecuteAction(ActionId action) {
if (action == ActionId::Reset) {
ResetScenario();
m_lastResult = "已重置:请重新检查提交、取消和失焦取消。";
m_lastResultColor = kWarn;
return;
}
m_autoScreenshot.RequestCapture("manual_button");
m_lastResult = "截图已排队:输出到 captures/。";
m_lastResultColor = kWarn;
}
void ApplyHostCaptureRequests(const UIEditorDockHostInteractionResult& result) {
if (result.requestPointerCapture && GetCapture() != m_hwnd) {
SetCapture(m_hwnd);
}
if (result.releasePointerCapture && GetCapture() == m_hwnd) {
ReleaseCapture();
}
}
void UpdateLastResult(const UIEditorDockHostInteractionResult& result) {
if (result.layoutResult.status == UIEditorWorkspaceLayoutOperationStatus::Changed) {
m_lastResult = "结果:同一标签栏内的标签重排已提交。";
m_lastResultColor = kOk;
return;
}
if (result.requestPointerCapture) {
m_lastResult = "结果:开始拖拽,宿主已拿到 pointer capture。";
m_lastResultColor = kOk;
return;
}
if (result.releasePointerCapture && !result.layoutChanged && !result.commandExecuted) {
if (m_lastInputCause == "focus_lost") {
m_lastResult = "结果:窗口失焦,本次重排已取消。";
} else {
m_lastResult = "结果:拖拽已取消。拖到 body 区再松开时,标签顺序应保持不变。";
}
m_lastResultColor = kWarn;
return;
}
}
void RenderFrame() {
UpdateLayout();
m_cachedFrame = UpdateUIEditorDockHostInteraction(
m_interactionState,
m_controller,
m_dockHostRect,
m_pendingInputEvents);
m_pendingInputEvents.clear();
ApplyHostCaptureRequests(m_cachedFrame.result);
UpdateLastResult(m_cachedFrame.result);
m_lastInputCause.clear();
RECT clientRect = {};
GetClientRect(m_hwnd, &clientRect);
const float width = static_cast<float>((std::max)(clientRect.right - clientRect.left, 1L));
const float height = static_cast<float>((std::max)(clientRect.bottom - clientRect.top, 1L));
UIDrawData drawData = {};
UIDrawList& drawList = drawData.EmplaceDrawList("DockTabReorderSameStack");
drawList.AddFilledRect(UIRect(0.0f, 0.0f, width, height), kWindowBg);
DrawCard(drawList, m_introRect, "这个测试验证什么功能?", "只验证同一标签栏内 tab 重排的基础 contract不做 editor 业务。");
drawList.AddText(UIPoint(m_introRect.x + 16.0f, m_introRect.y + 70.0f), "1. 拖动 Document A / B / C 的 tab header 到同一行其他位置。", kTextPrimary, 12.0f);
drawList.AddText(UIPoint(m_introRect.x + 16.0f, m_introRect.y + 92.0f), "2. 在 header 区松开:应提交重排,并更新右侧标签顺序。", kTextPrimary, 12.0f);
drawList.AddText(UIPoint(m_introRect.x + 16.0f, m_introRect.y + 114.0f), "3. 拖到 body 区再松开:应取消,本次标签顺序不能变化。", kTextPrimary, 12.0f);
drawList.AddText(UIPoint(m_introRect.x + 16.0f, m_introRect.y + 136.0f), "4. 拖拽中切走窗口或按 Esc应释放 capture并取消这次重排。", kTextWeak, 11.0f);
DrawCard(drawList, m_previewRect, "预览区", "这里只保留同栏重排所需的最小工作区。");
drawList.AddFilledRect(m_dockHostRect, kPreviewBg, 8.0f);
AppendUIEditorDockHostBackground(drawList, m_cachedFrame.layout);
AppendUIEditorDockHostForeground(drawList, m_cachedFrame.layout);
DrawCard(drawList, m_stateRect, "状态", "拖拽时重点观察右侧状态是否和画面一致。");
float y = m_stateRect.y + 68.0f;
auto addLine = [&](std::string text, const UIColor& color = kTextPrimary, float fontSize = 12.0f) mutable {
drawList.AddText(UIPoint(m_stateRect.x + 16.0f, y), std::move(text), color, fontSize);
y += 22.0f;
};
const auto* documentTabStack = FindDocumentTabStackLayout(m_cachedFrame);
const bool previewVisible =
documentTabStack != nullptr &&
documentTabStack->tabStripLayout.insertionPreview.visible;
const std::size_t previewInsertionIndex =
documentTabStack != nullptr
? documentTabStack->tabStripLayout.insertionPreview.insertionIndex
: XCEngine::UI::Editor::Widgets::UIEditorTabStripInvalidIndex;
addLine("当前标签顺序: " + CollectDocumentTabOrder(m_controller), kTextPrimary, 11.0f);
addLine("活动面板: " + m_controller.GetWorkspace().activePanelId, kTextPrimary, 11.0f);
addLine("已聚焦: " + FormatBool(m_cachedFrame.focused), m_cachedFrame.focused ? kOk : kTextMuted, 11.0f);
addLine("宿主捕获: " + FormatBool(GetCapture() == m_hwnd), GetCapture() == m_hwnd ? kOk : kTextMuted, 11.0f);
addLine(
"拖拽标签栈: " +
(m_interactionState.activeTabDragNodeId.empty()
? std::string("")
: m_interactionState.activeTabDragNodeId),
kTextWeak,
11.0f);
addLine("预览插入位激活: " + FormatBool(previewVisible), previewVisible ? kOk : kTextWeak, 11.0f);
addLine("预览插入索引: " + FormatOptionalIndex(previewInsertionIndex), kTextWeak, 11.0f);
addLine("当前 Hover: " + m_hoverText, kTextWeak, 11.0f);
drawList.AddText(
UIPoint(m_stateRect.x + 16.0f, y + 8.0f),
"最近结果",
kTextPrimary,
13.0f);
drawList.AddText(
UIPoint(m_stateRect.x + 16.0f, y + 32.0f),
m_lastResult,
m_lastResultColor,
12.0f);
const std::string captureSummary =
m_autoScreenshot.HasPendingCapture()
? "截图排队中..."
: (m_autoScreenshot.GetLastCaptureSummary().empty()
? "F12 或按钮 -> captures/"
: m_autoScreenshot.GetLastCaptureSummary());
drawList.AddText(
UIPoint(m_stateRect.x + 16.0f, m_stateRect.y + m_stateRect.height - 86.0f),
captureSummary,
kTextWeak,
11.0f);
for (const ButtonState& button : m_buttons) {
DrawButton(drawList, button);
}
const bool framePresented = m_renderer.Render(drawData);
m_autoScreenshot.CaptureIfRequested(
m_renderer,
drawData,
static_cast<unsigned int>(width),
static_cast<unsigned int>(height),
framePresented);
}
HWND m_hwnd = nullptr;
ATOM m_windowClassAtom = 0;
NativeRenderer m_renderer = {};
AutoScreenshotController m_autoScreenshot = {};
std::filesystem::path m_captureRoot = {};
UIEditorWorkspaceController m_controller = {};
UIEditorDockHostInteractionState m_interactionState = {};
UIEditorDockHostInteractionFrame m_cachedFrame = {};
std::vector<UIInputEvent> m_pendingInputEvents = {};
std::vector<ButtonState> m_buttons = {};
UIRect m_introRect = {};
UIRect m_previewRect = {};
UIRect m_stateRect = {};
UIRect m_dockHostRect = {};
bool m_trackingMouseLeave = false;
std::string m_lastInputCause = {};
std::string m_hoverText = {};
std::string m_lastResult = {};
UIColor m_lastResultColor = kTextMuted;
};
} // namespace
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) {
return ScenarioApp().Run(hInstance, nCmdShow);
}

View File

@@ -2,14 +2,14 @@
#define NOMINMAX
#endif
#include <XCEditor/Shell/UIEditorPanelRegistry.h>
#include <XCEditor/Panels/UIEditorPanelRegistry.h>
#include <XCEditor/Shell/UIEditorShellCompose.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Shell/UIEditorWorkspaceModel.h>
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEditor/Workspace/UIEditorWorkspaceModel.h>
#include <XCEditor/Foundation/UIEditorTheme.h>
#include "../../shared/src/EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,13 +6,13 @@
#include <XCEditor/Foundation/UIEditorCommandDispatcher.h>
#include <XCEditor/Foundation/UIEditorTheme.h>
#include <XCEditor/Shell/UIEditorMenuModel.h>
#include <XCEditor/Menu/UIEditorMenuModel.h>
#include <XCEditor/Shell/UIEditorShellInteraction.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Shell/UIEditorWorkspaceModel.h>
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEditor/Workspace/UIEditorWorkspaceModel.h>
#include "../../shared/src/EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,14 +1,14 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <XCEditor/Fields/UIEditorEnumFieldInteraction.h>
#include <XCEditor/Foundation/UIEditorTheme.h>
#include <XCEditor/Fields/UIEditorEnumField.h>
#include <XCEditor/Shell/UIEditorMenuPopup.h>
#include <XCEditor/Menu/UIEditorMenuPopup.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -4,8 +4,8 @@
#include <XCEditor/Collections/UIEditorListView.h>
#include <XCEditor/Collections/UIEditorListViewInteraction.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -9,9 +9,9 @@
#include <XCEditor/Fields/UIEditorTextField.h>
#include <XCEditor/Foundation/UIEditorTheme.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/InputModifierTracker.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Platform/Win32/InputModifierTracker.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -5,9 +5,9 @@
#include <XCEditor/Collections/UIEditorListView.h>
#include <XCEditor/Collections/UIEditorListViewInteraction.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/InputModifierTracker.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Platform/Win32/InputModifierTracker.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -3,13 +3,13 @@
#endif
#include <XCEditor/Foundation/UIEditorCommandDispatcher.h>
#include <XCEditor/Shell/UIEditorMenuModel.h>
#include <XCEditor/Shell/UIEditorMenuSession.h>
#include <XCEditor/Menu/UIEditorMenuModel.h>
#include <XCEditor/Menu/UIEditorMenuSession.h>
#include <XCEditor/Foundation/UIEditorShortcutManager.h>
#include <XCEditor/Shell/UIEditorMenuBar.h>
#include <XCEditor/Shell/UIEditorMenuPopup.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include <XCEditor/Menu/UIEditorMenuBar.h>
#include <XCEditor/Menu/UIEditorMenuPopup.h>
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -7,8 +7,8 @@
#include <XCEditor/Fields/UIEditorFieldStyle.h>
#include <XCEditor/Fields/UIEditorNumberField.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,8 +6,8 @@
#include <XCEditor/Fields/UIEditorObjectField.h>
#include <XCEditor/Fields/UIEditorObjectFieldInteraction.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -2,11 +2,11 @@
#define NOMINMAX
#endif
#include <XCEditor/Shell/UIEditorPanelContentHost.h>
#include <XCEditor/Shell/UIEditorWorkspaceCompose.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include <XCEditor/Panels/UIEditorPanelContentHost.h>
#include <XCEditor/Workspace/UIEditorWorkspaceCompose.h>
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>

View File

@@ -2,9 +2,9 @@
#define NOMINMAX
#endif
#include <XCEditor/Shell/UIEditorPanelFrame.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include <XCEditor/Panels/UIEditorPanelFrame.h>
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,8 +6,8 @@
#include <XCEditor/Foundation/UIEditorTheme.h>
#include <XCEditor/Fields/UIEditorPropertyGrid.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -4,8 +4,8 @@
#include <XCEditor/Collections/UIEditorScrollViewInteraction.h>
#include <XCEditor/Collections/UIEditorScrollView.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>

View File

@@ -3,8 +3,8 @@
#endif
#include <XCEditor/Shell/UIEditorStatusBar.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>

View File

@@ -3,11 +3,11 @@
#endif
#include <XCEditor/Collections/UIEditorTabStripInteraction.h>
#include <XCEditor/Shell/UIEditorPanelRegistry.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Panels/UIEditorPanelRegistry.h>
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEditor/Collections/UIEditorTabStrip.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>
@@ -40,12 +40,10 @@ using XCEngine::UI::UIRect;
using XCEngine::UI::Editor::BuildDefaultUIEditorWorkspaceController;
using XCEngine::UI::Editor::BuildUIEditorWorkspacePanel;
using XCEngine::UI::Editor::BuildUIEditorWorkspaceTabStack;
using XCEngine::UI::Editor::FindUIEditorPanelDescriptor;
using XCEngine::UI::Editor::FindUIEditorPanelSessionState;
using XCEngine::UI::Editor::GetUIEditorWorkspaceCommandStatusName;
using XCEngine::UI::Editor::Host::AutoScreenshotController;
using XCEngine::UI::Editor::Host::NativeRenderer;
using XCEngine::UI::Editor::UIEditorPanelDescriptor;
using XCEngine::UI::Editor::UIEditorPanelRegistry;
using XCEngine::UI::Editor::UIEditorTabStripInteractionFrame;
using XCEngine::UI::Editor::UIEditorTabStripInteractionResult;
@@ -534,7 +532,6 @@ private:
void RefreshTabItems() {
const UIEditorWorkspaceModel& workspace = m_controller.GetWorkspace();
const UIEditorPanelRegistry& registry = m_controller.GetPanelRegistry();
const auto* tabStack = GetRootTabStack(workspace);
m_tabItems.clear();
@@ -550,12 +547,9 @@ private:
continue;
}
const UIEditorPanelDescriptor* descriptor =
FindUIEditorPanelDescriptor(registry, child.panel.panelId);
UIEditorTabStripItem item = {};
item.tabId = child.panel.panelId;
item.title = child.panel.title;
item.closable = descriptor != nullptr ? descriptor->canClose : true;
m_tabItems.push_back(std::move(item));
}
}

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -7,8 +7,8 @@
#include <XCEditor/Fields/UIEditorTextField.h>
#include <XCEditor/Foundation/UIEditorTheme.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -4,8 +4,8 @@
#include <XCEditor/Collections/UIEditorTreeView.h>
#include <XCEditor/Collections/UIEditorTreeViewInteraction.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -9,8 +9,8 @@
#include <XCEditor/Fields/UIEditorTextField.h>
#include <XCEditor/Foundation/UIEditorTheme.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -4,8 +4,8 @@
#include <XCEditor/Collections/UIEditorTreeView.h>
#include <XCEditor/Collections/UIEditorTreeViewInteraction.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,8 +6,8 @@
#include <XCEditor/Fields/UIEditorVector2FieldInteraction.h>
#include <XCEditor/Fields/UIEditorVector2Field.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,8 +6,8 @@
#include <XCEditor/Fields/UIEditorVector3FieldInteraction.h>
#include <XCEditor/Fields/UIEditorVector3Field.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -1,4 +1,4 @@
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -6,8 +6,8 @@
#include <XCEditor/Fields/UIEditorVector4FieldInteraction.h>
#include <XCEditor/Fields/UIEditorVector4Field.h>
#include "EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/Input/InputTypes.h>
#include <XCEngine/UI/DrawData.h>

View File

@@ -2,11 +2,11 @@
#define NOMINMAX
#endif
#include <XCEditor/Shell/UIEditorViewportShell.h>
#include <XCEditor/Shell/UIEditorViewportSlot.h>
#include "Host/AutoScreenshot.h"
#include "Host/InputModifierTracker.h"
#include "Host/NativeRenderer.h"
#include <XCEditor/Viewport/UIEditorViewportShell.h>
#include <XCEditor/Viewport/UIEditorViewportSlot.h>
#include "Rendering/Native/AutoScreenshot.h"
#include "Platform/Win32/InputModifierTracker.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>

View File

@@ -2,9 +2,9 @@
#define NOMINMAX
#endif
#include <XCEditor/Shell/UIEditorViewportSlot.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include <XCEditor/Viewport/UIEditorViewportSlot.h>
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>

View File

@@ -3,10 +3,10 @@
#endif
#include <XCEditor/Foundation/UIEditorTheme.h>
#include <XCEditor/Shell/UIEditorWorkspaceInteraction.h>
#include <XCEditor/Workspace/UIEditorWorkspaceInteraction.h>
#include "../../shared/src/EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>
@@ -139,16 +139,12 @@ std::string DescribeHitTarget(const UIEditorDockHostHitTarget& target) {
return "标签栏背景: " + target.nodeId;
case UIEditorDockHostHitTargetKind::Tab:
return "标签: " + target.panelId;
case UIEditorDockHostHitTargetKind::TabCloseButton:
return "标签关闭: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelHeader:
return "面板标题: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelBody:
return "面板内容: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelFooter:
return "面板底栏: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelCloseButton:
return "面板关闭: " + target.panelId;
case UIEditorDockHostHitTargetKind::None:
default:
return "None";
@@ -209,16 +205,12 @@ std::string DescribeValidationHitTarget(const UIEditorDockHostHitTarget& target)
return "Tab strip background: " + target.nodeId;
case UIEditorDockHostHitTargetKind::Tab:
return "Tab: " + target.panelId;
case UIEditorDockHostHitTargetKind::TabCloseButton:
return "Tab close: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelHeader:
return "Panel header: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelBody:
return "Panel body: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelFooter:
return "Panel footer: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelCloseButton:
return "Panel close: " + target.panelId;
case UIEditorDockHostHitTargetKind::None:
default:
return "None";

View File

@@ -2,13 +2,13 @@
#define NOMINMAX
#endif
#include <XCEditor/Shell/UIEditorDockHostInteraction.h>
#include <XCEditor/Shell/UIEditorPanelRegistry.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Shell/UIEditorWorkspaceModel.h>
#include <XCEditor/Shell/UIEditorDockHost.h>
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include <XCEditor/Docking/UIEditorDockHostInteraction.h>
#include <XCEditor/Panels/UIEditorPanelRegistry.h>
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEditor/Workspace/UIEditorWorkspaceModel.h>
#include <XCEditor/Docking/UIEditorDockHost.h>
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>
@@ -166,16 +166,12 @@ std::string DescribeHitTarget(const UIEditorDockHostHitTarget& target) {
return "TabStripBackground: " + target.nodeId;
case UIEditorDockHostHitTargetKind::Tab:
return "Tab: " + target.panelId;
case UIEditorDockHostHitTargetKind::TabCloseButton:
return "TabClose: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelHeader:
return "PanelHeader: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelBody:
return "PanelBody: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelFooter:
return "PanelFooter: " + target.panelId;
case UIEditorDockHostHitTargetKind::PanelCloseButton:
return "PanelClose: " + target.panelId;
case UIEditorDockHostHitTargetKind::None:
default:
return "None";

View File

@@ -3,14 +3,14 @@
#endif
#include <XCEditor/Foundation/UIEditorTheme.h>
#include <XCEditor/Shell/UIEditorPanelRegistry.h>
#include <XCEditor/Shell/UIEditorViewportSlot.h>
#include <XCEditor/Shell/UIEditorWorkspaceCompose.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Shell/UIEditorWorkspaceModel.h>
#include <XCEditor/Panels/UIEditorPanelRegistry.h>
#include <XCEditor/Viewport/UIEditorViewportSlot.h>
#include <XCEditor/Workspace/UIEditorWorkspaceCompose.h>
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEditor/Workspace/UIEditorWorkspaceModel.h>
#include "../../shared/src/EditorValidationTheme.h"
#include "Host/AutoScreenshot.h"
#include "Host/NativeRenderer.h"
#include "Rendering/Native/AutoScreenshot.h"
#include "Rendering/Native/NativeRenderer.h"
#include <XCEngine/UI/DrawData.h>