Refactor XCUI editor module layout
This commit is contained in:
54
new_editor/include/XCEditor/Shell/UIEditorPanelRegistry.h
Normal file
54
new_editor/include/XCEditor/Shell/UIEditorPanelRegistry.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
enum class UIEditorPanelPresentationKind : std::uint8_t {
|
||||
Placeholder = 0,
|
||||
ViewportShell,
|
||||
HostedContent
|
||||
};
|
||||
|
||||
struct UIEditorPanelDescriptor {
|
||||
std::string panelId = {};
|
||||
std::string defaultTitle = {};
|
||||
UIEditorPanelPresentationKind presentationKind = UIEditorPanelPresentationKind::Placeholder;
|
||||
bool placeholder = true;
|
||||
bool canHide = true;
|
||||
bool canClose = true;
|
||||
};
|
||||
|
||||
struct UIEditorPanelRegistry {
|
||||
std::vector<UIEditorPanelDescriptor> panels = {};
|
||||
};
|
||||
|
||||
enum class UIEditorPanelRegistryValidationCode : std::uint8_t {
|
||||
None = 0,
|
||||
EmptyPanelId,
|
||||
EmptyDefaultTitle,
|
||||
DuplicatePanelId
|
||||
};
|
||||
|
||||
struct UIEditorPanelRegistryValidationResult {
|
||||
UIEditorPanelRegistryValidationCode code = UIEditorPanelRegistryValidationCode::None;
|
||||
std::string message = {};
|
||||
|
||||
[[nodiscard]] bool IsValid() const {
|
||||
return code == UIEditorPanelRegistryValidationCode::None;
|
||||
}
|
||||
};
|
||||
|
||||
UIEditorPanelRegistry BuildDefaultEditorShellPanelRegistry();
|
||||
|
||||
const UIEditorPanelDescriptor* FindUIEditorPanelDescriptor(
|
||||
const UIEditorPanelRegistry& registry,
|
||||
std::string_view panelId);
|
||||
|
||||
UIEditorPanelRegistryValidationResult ValidateUIEditorPanelRegistry(
|
||||
const UIEditorPanelRegistry& registry);
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
Reference in New Issue
Block a user