Rename XCUI compatibility host surface away from ImGui

This commit is contained in:
2026-04-05 16:53:40 +08:00
parent 54a699aa26
commit 94482ab98c
4 changed files with 11 additions and 10 deletions

View File

@@ -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 - `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(...)` - `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` - 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`. - Old `editor` replacement remains deferred; all active execution still stays inside XCUI shared code and `new_editor`.
## Three-Layer Status ## Three-Layer Status

View File

@@ -1132,7 +1132,7 @@ void Application::Frame() {
return; return;
} }
FrameLegacyImGuiHost(); FrameCompatibilityHost();
} }
} // namespace NewEditor } // namespace NewEditor

View File

@@ -52,7 +52,7 @@ public:
using ShellViewToggleState = ::XCEngine::Editor::XCUIBackend::XCUIShellViewToggleState; using ShellViewToggleState = ::XCEngine::Editor::XCUIBackend::XCUIShellViewToggleState;
enum class WindowHostMode : std::uint8_t { enum class WindowHostMode : std::uint8_t {
NativeXCUI = 0, NativeXCUI = 0,
LegacyImGui CompatibilityHost
}; };
struct ShellCommandIds { struct ShellCommandIds {
@@ -420,12 +420,12 @@ private:
const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameSnapshot& snapshot); const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameSnapshot& snapshot);
bool IsNativeWindowHostEnabled() const; bool IsNativeWindowHostEnabled() const;
void InitializePanelsForActiveWindowHost(); void InitializePanelsForActiveWindowHost();
void InitializeLegacyImGuiPanels(); void InitializeCompatibilityHostPanels();
void RenderLegacyImGuiUiFrame(); void RenderCompatibilityHostUiFrame();
::XCEngine::UI::UIDrawData BuildNativeShellDrawData( ::XCEngine::UI::UIDrawData BuildNativeShellDrawData(
const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameSnapshot& shellSnapshot, const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameSnapshot& shellSnapshot,
const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameDelta& shellFrameDelta); const ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeFrameDelta& shellFrameDelta);
void FrameLegacyImGuiHost(); void FrameCompatibilityHost();
void FrameNativeXCUIHost(); void FrameNativeXCUIHost();
void RenderShellChrome(); void RenderShellChrome();
void RenderHostedPreviewHud(); void RenderHostedPreviewHud();

View File

@@ -119,11 +119,11 @@ void Application::InitializePanelsForActiveWindowHost() {
return; return;
} }
InitializeLegacyImGuiPanels(); InitializeCompatibilityHostPanels();
ConfigureHostedPreviewPresenters(); ConfigureHostedPreviewPresenters();
} }
void Application::InitializeLegacyImGuiPanels() { void Application::InitializeCompatibilityHostPanels() {
m_demoPanel = std::make_unique<XCUIDemoPanel>( m_demoPanel = std::make_unique<XCUIDemoPanel>(
&m_xcuiInputSource, &m_xcuiInputSource,
CreateHostedPreviewPresenter(IsNativeHostedPreviewEnabled(ShellPanelId::XCUIDemo)), CreateHostedPreviewPresenter(IsNativeHostedPreviewEnabled(ShellPanelId::XCUIDemo)),
@@ -267,7 +267,7 @@ void Application::InitializeWindowCompositor() {
} }
} }
void Application::FrameLegacyImGuiHost() { void Application::FrameCompatibilityHost() {
Application::BeginHostedPreviewFrameLifecycle( Application::BeginHostedPreviewFrameLifecycle(
m_hostedPreviewQueue, m_hostedPreviewQueue,
m_hostedPreviewSurfaceRegistry); m_hostedPreviewSurfaceRegistry);
@@ -279,7 +279,7 @@ void Application::FrameLegacyImGuiHost() {
m_windowCompositor->RenderFrame( m_windowCompositor->RenderFrame(
kLegacyHostClearColor, kLegacyHostClearColor,
[this]() { RenderLegacyImGuiUiFrame(); }, [this]() { RenderCompatibilityHostUiFrame(); },
[this]( [this](
const ::XCEngine::Rendering::RenderContext& renderContext, const ::XCEngine::Rendering::RenderContext& renderContext,
const ::XCEngine::Rendering::RenderSurface& surface) { const ::XCEngine::Rendering::RenderSurface& surface) {
@@ -323,7 +323,7 @@ void Application::FrameLegacyImGuiHost() {
m_xcuiInputSource.ClearFrameTransients(); m_xcuiInputSource.ClearFrameTransients();
} }
void Application::RenderLegacyImGuiUiFrame() { void Application::RenderCompatibilityHostUiFrame() {
::XCEngine::Editor::XCUIBackend::XCUIInputBridgeCaptureOptions options = {}; ::XCEngine::Editor::XCUIBackend::XCUIInputBridgeCaptureOptions options = {};
options.timestampNanoseconds = MakeLegacyHostFrameTimestampNanoseconds(); options.timestampNanoseconds = MakeLegacyHostFrameTimestampNanoseconds();
options.windowFocused = m_xcuiInputSource.IsWindowFocused(); options.windowFocused = m_xcuiInputSource.IsWindowFocused();