Add new editor product shell baseline

This commit is contained in:
2026-04-10 16:40:11 +08:00
parent 1f79afba3c
commit 8cde4e0649
15 changed files with 1290 additions and 438 deletions

View File

@@ -8,11 +8,34 @@
namespace XCEngine::UI::Editor {
struct UIEditorHostCommandEvaluationResult {
bool executable = false;
std::string message = {};
};
struct UIEditorHostCommandDispatchResult {
bool commandExecuted = false;
std::string message = {};
};
class UIEditorHostCommandHandler {
public:
virtual ~UIEditorHostCommandHandler() = default;
virtual UIEditorHostCommandEvaluationResult EvaluateHostCommand(
std::string_view commandId) const = 0;
virtual UIEditorHostCommandDispatchResult DispatchHostCommand(
std::string_view commandId) = 0;
};
enum class UIEditorCommandEvaluationCode : std::uint8_t {
None = 0,
InvalidCommandRegistry,
UnknownCommandId,
MissingActivePanel
MissingActivePanel,
MissingHostCommandHandler,
HostCommandDisabled
};
struct UIEditorCommandEvaluationResult {
@@ -23,6 +46,7 @@ struct UIEditorCommandEvaluationResult {
UIEditorWorkspaceCommand workspaceCommand = {};
UIEditorWorkspaceCommandResult previewResult = {};
std::string message = {};
UIEditorCommandKind kind = UIEditorCommandKind::Workspace;
[[nodiscard]] bool IsExecutable() const {
return executable;
@@ -42,6 +66,7 @@ struct UIEditorCommandDispatchResult {
UIEditorWorkspaceCommand workspaceCommand = {};
UIEditorWorkspaceCommandResult commandResult = {};
std::string message = {};
UIEditorCommandKind kind = UIEditorCommandKind::Workspace;
};
std::string_view GetUIEditorCommandDispatchStatusName(
@@ -56,6 +81,14 @@ public:
return m_commandRegistry;
}
void SetHostCommandHandler(UIEditorHostCommandHandler* handler) {
m_hostCommandHandler = handler;
}
UIEditorHostCommandHandler* GetHostCommandHandler() const {
return m_hostCommandHandler;
}
UIEditorCommandRegistryValidationResult ValidateConfiguration() const;
UIEditorCommandEvaluationResult Evaluate(
@@ -68,6 +101,7 @@ public:
private:
UIEditorCommandRegistry m_commandRegistry = {};
UIEditorHostCommandHandler* m_hostCommandHandler = nullptr;
};
} // namespace XCEngine::UI::Editor