2026-04-06 18:05:34 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-04-10 00:41:28 +08:00
|
|
|
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
|
2026-04-06 18:05:34 +08:00
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <string_view>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2026-04-06 20:02:34 +08:00
|
|
|
namespace XCEngine::UI::Editor {
|
2026-04-06 18:05:34 +08:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
2026-04-06 20:02:34 +08:00
|
|
|
} // namespace XCEngine::UI::Editor
|