Add XCUI new editor sandbox phase 1
This commit is contained in:
74
new_editor/src/XCUIBackend/XCUILayoutLabRuntime.h
Normal file
74
new_editor/src/XCUIBackend/XCUILayoutLabRuntime.h
Normal file
@@ -0,0 +1,74 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEngine/UI/DrawData.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace UI {
|
||||
struct UIRect;
|
||||
struct UIPoint;
|
||||
} // namespace UI
|
||||
namespace Editor {
|
||||
namespace XCUIBackend {
|
||||
|
||||
struct XCUILayoutLabInputState {
|
||||
UI::UIRect canvasRect = {};
|
||||
UI::UIPoint pointerPosition = {};
|
||||
bool pointerInside = false;
|
||||
};
|
||||
|
||||
struct XCUILayoutLabFrameStats {
|
||||
bool documentsReady = false;
|
||||
std::string statusMessage = {};
|
||||
std::size_t drawListCount = 0;
|
||||
std::size_t commandCount = 0;
|
||||
std::size_t filledRectCommandCount = 0;
|
||||
std::size_t rectOutlineCommandCount = 0;
|
||||
std::size_t textCommandCount = 0;
|
||||
std::size_t imageCommandCount = 0;
|
||||
std::size_t clipPushCommandCount = 0;
|
||||
std::size_t clipPopCommandCount = 0;
|
||||
std::size_t nativeSupportedCommandCount = 0;
|
||||
std::size_t nativeUnsupportedCommandCount = 0;
|
||||
std::size_t nativeUnsupportedImageCommandCount = 0;
|
||||
std::size_t nativeUnsupportedUnknownCommandCount = 0;
|
||||
bool nativeOverlayReady = false;
|
||||
std::string nativeOverlayStatusMessage = {};
|
||||
std::size_t rowCount = 0;
|
||||
std::size_t columnCount = 0;
|
||||
std::size_t overlayCount = 0;
|
||||
std::size_t scrollViewCount = 0;
|
||||
std::string hoveredElementId = {};
|
||||
};
|
||||
|
||||
struct XCUILayoutLabFrameResult {
|
||||
UI::UIDrawData drawData = {};
|
||||
XCUILayoutLabFrameStats stats = {};
|
||||
};
|
||||
|
||||
class XCUILayoutLabRuntime {
|
||||
public:
|
||||
XCUILayoutLabRuntime();
|
||||
~XCUILayoutLabRuntime();
|
||||
|
||||
XCUILayoutLabRuntime(XCUILayoutLabRuntime&& other) noexcept;
|
||||
XCUILayoutLabRuntime& operator=(XCUILayoutLabRuntime&& other) noexcept;
|
||||
|
||||
XCUILayoutLabRuntime(const XCUILayoutLabRuntime&) = delete;
|
||||
XCUILayoutLabRuntime& operator=(const XCUILayoutLabRuntime&) = delete;
|
||||
|
||||
bool ReloadDocuments();
|
||||
const XCUILayoutLabFrameResult& Update(const XCUILayoutLabInputState& input);
|
||||
const XCUILayoutLabFrameResult& GetFrameResult() const;
|
||||
bool TryGetElementRect(const std::string& elementId, UI::UIRect& outRect) const;
|
||||
|
||||
private:
|
||||
struct RuntimeState;
|
||||
std::unique_ptr<RuntimeState> m_state;
|
||||
};
|
||||
|
||||
} // namespace XCUIBackend
|
||||
} // namespace Editor
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user