Build XCUI splitter foundation and test harness
This commit is contained in:
52
new_editor/include/XCNewEditor/Host/AutoScreenshot.h
Normal file
52
new_editor/include/XCNewEditor/Host/AutoScreenshot.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#include <XCEngine/UI/DrawData.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace XCEngine::XCUI::Host {
|
||||
|
||||
class NativeRenderer;
|
||||
|
||||
class AutoScreenshotController {
|
||||
public:
|
||||
void Initialize(const std::filesystem::path& captureRoot);
|
||||
void Shutdown();
|
||||
|
||||
void RequestCapture(std::string reason);
|
||||
void CaptureIfRequested(
|
||||
NativeRenderer& renderer,
|
||||
const ::XCEngine::UI::UIDrawData& drawData,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
bool framePresented);
|
||||
|
||||
bool HasPendingCapture() const;
|
||||
const std::filesystem::path& GetLatestCapturePath() const;
|
||||
const std::string& GetLastCaptureSummary() const;
|
||||
const std::string& GetLastCaptureError() const;
|
||||
|
||||
private:
|
||||
std::filesystem::path BuildHistoryCapturePath(std::string_view reason) const;
|
||||
|
||||
static std::string BuildTimestampString();
|
||||
static std::string SanitizeReason(std::string_view reason);
|
||||
|
||||
std::filesystem::path m_captureRoot = {};
|
||||
std::filesystem::path m_historyRoot = {};
|
||||
std::filesystem::path m_latestCapturePath = {};
|
||||
std::string m_pendingReason = {};
|
||||
std::string m_lastCaptureSummary = {};
|
||||
std::string m_lastCaptureError = {};
|
||||
std::uint64_t m_captureCount = 0;
|
||||
bool m_capturePending = false;
|
||||
};
|
||||
|
||||
} // namespace XCEngine::XCUI::Host
|
||||
Reference in New Issue
Block a user