Refactor XCUI editor module layout
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
enum class UIEditorCommandPanelSource : std::uint8_t {
|
||||
None = 0,
|
||||
FixedPanelId,
|
||||
ActivePanel
|
||||
};
|
||||
|
||||
struct UIEditorWorkspaceCommandDescriptor {
|
||||
UIEditorWorkspaceCommandKind kind = UIEditorWorkspaceCommandKind::ActivatePanel;
|
||||
UIEditorCommandPanelSource panelSource = UIEditorCommandPanelSource::FixedPanelId;
|
||||
std::string panelId = {};
|
||||
};
|
||||
|
||||
struct UIEditorCommandDescriptor {
|
||||
std::string commandId = {};
|
||||
std::string displayName = {};
|
||||
UIEditorWorkspaceCommandDescriptor workspaceCommand = {};
|
||||
};
|
||||
|
||||
struct UIEditorCommandRegistry {
|
||||
std::vector<UIEditorCommandDescriptor> commands = {};
|
||||
};
|
||||
|
||||
enum class UIEditorCommandRegistryValidationCode : std::uint8_t {
|
||||
None = 0,
|
||||
EmptyCommandId,
|
||||
EmptyDisplayName,
|
||||
DuplicateCommandId,
|
||||
MissingPanelSource,
|
||||
MissingFixedPanelId,
|
||||
UnexpectedPanelSource
|
||||
};
|
||||
|
||||
struct UIEditorCommandRegistryValidationResult {
|
||||
UIEditorCommandRegistryValidationCode code =
|
||||
UIEditorCommandRegistryValidationCode::None;
|
||||
std::string message = {};
|
||||
|
||||
[[nodiscard]] bool IsValid() const {
|
||||
return code == UIEditorCommandRegistryValidationCode::None;
|
||||
}
|
||||
};
|
||||
|
||||
std::string_view GetUIEditorCommandPanelSourceName(UIEditorCommandPanelSource source);
|
||||
|
||||
const UIEditorCommandDescriptor* FindUIEditorCommandDescriptor(
|
||||
const UIEditorCommandRegistry& registry,
|
||||
std::string_view commandId);
|
||||
|
||||
UIEditorCommandRegistryValidationResult ValidateUIEditorCommandRegistry(
|
||||
const UIEditorCommandRegistry& registry);
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
Reference in New Issue
Block a user