From 94482ab98c991b6c1bed0b7e46eb44f307c7237f Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Sun, 5 Apr 2026 16:53:40 +0800 Subject: [PATCH] Rename XCUI compatibility host surface away from ImGui --- docs/plan/XCUI_Phase_Status_2026-04-05.md | 1 + new_editor/src/Application.cpp | 2 +- new_editor/src/Application.h | 8 ++++---- new_editor/src/ApplicationLegacyImGui.cpp | 10 +++++----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/plan/XCUI_Phase_Status_2026-04-05.md b/docs/plan/XCUI_Phase_Status_2026-04-05.md index 0907e78c..03bdeb10 100644 --- a/docs/plan/XCUI_Phase_Status_2026-04-05.md +++ b/docs/plan/XCUI_Phase_Status_2026-04-05.md @@ -46,6 +46,7 @@ Old `editor` replacement is explicitly out of scope for this phase. - `XCUIShellChromeState` no longer carries the legacy host demo-window toggle or command id on the generic shell-state surface - `Application.h` no longer exposes that legacy demo command through generic `ShellCommandIds`, `ShellCommandBindings`, or `RegisterShellViewCommands(...)` - the legacy demo window toggle now lives as a compatibility-only command inside `ApplicationLegacyImGui.cpp` + - generic `Application` host-mode/member naming is now also shifting from `LegacyImGui` toward `CompatibilityHost`, so the default shell surface does not have to encode ImGui into every host-facing method name - Old `editor` replacement remains deferred; all active execution still stays inside XCUI shared code and `new_editor`. ## Three-Layer Status diff --git a/new_editor/src/Application.cpp b/new_editor/src/Application.cpp index 2f13c113..cb905064 100644 --- a/new_editor/src/Application.cpp +++ b/new_editor/src/Application.cpp @@ -1132,7 +1132,7 @@ void Application::Frame() { return; } - FrameLegacyImGuiHost(); + FrameCompatibilityHost(); } } // namespace NewEditor diff --git a/new_editor/src/Application.h b/new_editor/src/Application.h index f0e15f73..592fd122 100644 --- a/new_editor/src/Application.h +++ b/new_editor/src/Application.h @@ -52,7 +52,7 @@ public: using ShellViewToggleState = ::XCEngine::Editor::XCUIBackend::XCUIShellViewToggleState; enum class WindowHostMode : std::uint8_t { NativeXCUI = 0, - LegacyImGui + CompatibilityHost }; struct ShellCommandIds { @@ -420,12 +420,12 @@ private: const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameSnapshot& snapshot); bool IsNativeWindowHostEnabled() const; void InitializePanelsForActiveWindowHost(); - void InitializeLegacyImGuiPanels(); - void RenderLegacyImGuiUiFrame(); + void InitializeCompatibilityHostPanels(); + void RenderCompatibilityHostUiFrame(); ::XCEngine::UI::UIDrawData BuildNativeShellDrawData( const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameSnapshot& shellSnapshot, const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameDelta& shellFrameDelta); - void FrameLegacyImGuiHost(); + void FrameCompatibilityHost(); void FrameNativeXCUIHost(); void RenderShellChrome(); void RenderHostedPreviewHud(); diff --git a/new_editor/src/ApplicationLegacyImGui.cpp b/new_editor/src/ApplicationLegacyImGui.cpp index 25cffc15..5873ff6f 100644 --- a/new_editor/src/ApplicationLegacyImGui.cpp +++ b/new_editor/src/ApplicationLegacyImGui.cpp @@ -119,11 +119,11 @@ void Application::InitializePanelsForActiveWindowHost() { return; } - InitializeLegacyImGuiPanels(); + InitializeCompatibilityHostPanels(); ConfigureHostedPreviewPresenters(); } -void Application::InitializeLegacyImGuiPanels() { +void Application::InitializeCompatibilityHostPanels() { m_demoPanel = std::make_unique( &m_xcuiInputSource, CreateHostedPreviewPresenter(IsNativeHostedPreviewEnabled(ShellPanelId::XCUIDemo)), @@ -267,7 +267,7 @@ void Application::InitializeWindowCompositor() { } } -void Application::FrameLegacyImGuiHost() { +void Application::FrameCompatibilityHost() { Application::BeginHostedPreviewFrameLifecycle( m_hostedPreviewQueue, m_hostedPreviewSurfaceRegistry); @@ -279,7 +279,7 @@ void Application::FrameLegacyImGuiHost() { m_windowCompositor->RenderFrame( kLegacyHostClearColor, - [this]() { RenderLegacyImGuiUiFrame(); }, + [this]() { RenderCompatibilityHostUiFrame(); }, [this]( const ::XCEngine::Rendering::RenderContext& renderContext, const ::XCEngine::Rendering::RenderSurface& surface) { @@ -323,7 +323,7 @@ void Application::FrameLegacyImGuiHost() { m_xcuiInputSource.ClearFrameTransients(); } -void Application::RenderLegacyImGuiUiFrame() { +void Application::RenderCompatibilityHostUiFrame() { ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeCaptureOptions options = {}; options.timestampNanoseconds = MakeLegacyHostFrameTimestampNanoseconds(); options.windowFocused = m_xcuiInputSource.IsWindowFocused();