2026-04-05 04:55:25 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Panel.h"
|
|
|
|
|
|
|
|
|
|
#include "XCUIBackend/XCUIHostedPreviewPresenter.h"
|
|
|
|
|
#include "XCUIBackend/XCUIInputBridge.h"
|
2026-04-05 12:30:03 +08:00
|
|
|
#include "XCUIBackend/XCUIPanelCanvasHost.h"
|
2026-04-05 04:55:25 +08:00
|
|
|
#include "XCUIBackend/XCUIDemoRuntime.h"
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
namespace XCEngine {
|
|
|
|
|
namespace NewEditor {
|
|
|
|
|
|
|
|
|
|
class XCUIDemoPanel : public Panel {
|
|
|
|
|
public:
|
|
|
|
|
explicit XCUIDemoPanel(
|
2026-04-05 13:24:14 +08:00
|
|
|
::XCEngine::Editor::XCUIBackend::IXCUIInputSnapshotSource* inputSource = nullptr);
|
2026-04-05 04:55:25 +08:00
|
|
|
XCUIDemoPanel(
|
2026-04-05 13:24:14 +08:00
|
|
|
::XCEngine::Editor::XCUIBackend::IXCUIInputSnapshotSource* inputSource,
|
|
|
|
|
std::unique_ptr<::XCEngine::Editor::XCUIBackend::IXCUIHostedPreviewPresenter> previewPresenter,
|
|
|
|
|
std::unique_ptr<::XCEngine::Editor::XCUIBackend::IXCUIPanelCanvasHost> canvasHost = nullptr);
|
2026-04-05 04:55:25 +08:00
|
|
|
~XCUIDemoPanel() override = default;
|
|
|
|
|
|
|
|
|
|
void Render() override;
|
|
|
|
|
void SetHostedPreviewEnabled(bool enabled);
|
|
|
|
|
void SetHostedPreviewPresenter(
|
|
|
|
|
std::unique_ptr<::XCEngine::Editor::XCUIBackend::IXCUIHostedPreviewPresenter> previewPresenter);
|
2026-04-05 12:30:03 +08:00
|
|
|
void SetCanvasHost(
|
|
|
|
|
std::unique_ptr<::XCEngine::Editor::XCUIBackend::IXCUIPanelCanvasHost> canvasHost);
|
2026-04-05 04:55:25 +08:00
|
|
|
bool IsHostedPreviewEnabled() const { return m_hostedPreviewEnabled; }
|
|
|
|
|
bool IsUsingNativeHostedPreview() const;
|
|
|
|
|
const ::XCEngine::Editor::XCUIBackend::XCUIDemoFrameResult& GetFrameResult() const;
|
|
|
|
|
const ::XCEngine::Editor::XCUIBackend::XCUIHostedPreviewStats& GetLastPreviewStats() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool m_lastReloadSucceeded = false;
|
|
|
|
|
bool m_hostedPreviewEnabled = true;
|
|
|
|
|
bool m_showCanvasHud = true;
|
|
|
|
|
bool m_showDebugRects = true;
|
2026-04-05 13:24:14 +08:00
|
|
|
::XCEngine::Editor::XCUIBackend::IXCUIInputSnapshotSource* m_inputSource = nullptr;
|
2026-04-05 04:55:25 +08:00
|
|
|
::XCEngine::Editor::XCUIBackend::XCUIInputBridge m_inputBridge;
|
|
|
|
|
::XCEngine::Editor::XCUIBackend::XCUIDemoRuntime m_runtime;
|
|
|
|
|
std::unique_ptr<::XCEngine::Editor::XCUIBackend::IXCUIHostedPreviewPresenter> m_previewPresenter;
|
2026-04-05 12:30:03 +08:00
|
|
|
std::unique_ptr<::XCEngine::Editor::XCUIBackend::IXCUIPanelCanvasHost> m_canvasHost;
|
2026-04-05 04:55:25 +08:00
|
|
|
::XCEngine::Editor::XCUIBackend::XCUIHostedPreviewStats m_lastPreviewStats = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace NewEditor
|
|
|
|
|
} // namespace XCEngine
|