Add new editor product shell baseline
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
enum class UIEditorCommandKind : std::uint8_t {
|
||||
Workspace = 0,
|
||||
Host
|
||||
};
|
||||
|
||||
enum class UIEditorCommandPanelSource : std::uint8_t {
|
||||
None = 0,
|
||||
FixedPanelId,
|
||||
@@ -25,6 +30,7 @@ struct UIEditorCommandDescriptor {
|
||||
std::string commandId = {};
|
||||
std::string displayName = {};
|
||||
UIEditorWorkspaceCommandDescriptor workspaceCommand = {};
|
||||
UIEditorCommandKind kind = UIEditorCommandKind::Workspace;
|
||||
};
|
||||
|
||||
struct UIEditorCommandRegistry {
|
||||
@@ -52,6 +58,7 @@ struct UIEditorCommandRegistryValidationResult {
|
||||
};
|
||||
|
||||
std::string_view GetUIEditorCommandPanelSourceName(UIEditorCommandPanelSource source);
|
||||
std::string_view GetUIEditorCommandKindName(UIEditorCommandKind kind);
|
||||
|
||||
const UIEditorCommandDescriptor* FindUIEditorCommandDescriptor(
|
||||
const UIEditorCommandRegistry& registry,
|
||||
|
||||
@@ -62,6 +62,14 @@ public:
|
||||
return m_commandDispatcher;
|
||||
}
|
||||
|
||||
void SetHostCommandHandler(UIEditorHostCommandHandler* handler) {
|
||||
m_commandDispatcher.SetHostCommandHandler(handler);
|
||||
}
|
||||
|
||||
UIEditorHostCommandHandler* GetHostCommandHandler() const {
|
||||
return m_commandDispatcher.GetHostCommandHandler();
|
||||
}
|
||||
|
||||
const UIEditorCommandRegistry& GetCommandRegistry() const {
|
||||
return m_commandDispatcher.GetCommandRegistry();
|
||||
}
|
||||
|
||||
@@ -6,8 +6,55 @@
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
enum class UIEditorShellToolbarGlyph : std::uint8_t {
|
||||
Play = 0,
|
||||
Pause,
|
||||
Step
|
||||
};
|
||||
|
||||
struct UIEditorShellToolbarButton {
|
||||
std::string buttonId = {};
|
||||
UIEditorShellToolbarGlyph glyph = UIEditorShellToolbarGlyph::Play;
|
||||
bool enabled = true;
|
||||
};
|
||||
|
||||
struct UIEditorShellToolbarLayout {
|
||||
::XCEngine::UI::UIRect bounds = {};
|
||||
::XCEngine::UI::UIRect groupRect = {};
|
||||
std::vector<::XCEngine::UI::UIRect> buttonRects = {};
|
||||
};
|
||||
|
||||
struct UIEditorShellToolbarMetrics {
|
||||
float barHeight = 24.0f;
|
||||
float groupPaddingX = 8.0f;
|
||||
float groupPaddingY = 3.0f;
|
||||
float buttonWidth = 20.0f;
|
||||
float buttonHeight = 18.0f;
|
||||
float buttonGap = 5.0f;
|
||||
float groupCornerRounding = 6.0f;
|
||||
float buttonCornerRounding = 4.0f;
|
||||
float borderThickness = 1.0f;
|
||||
float iconThickness = 1.35f;
|
||||
};
|
||||
|
||||
struct UIEditorShellToolbarPalette {
|
||||
::XCEngine::UI::UIColor barColor =
|
||||
::XCEngine::UI::UIColor(0.13f, 0.13f, 0.13f, 1.0f);
|
||||
::XCEngine::UI::UIColor groupColor =
|
||||
::XCEngine::UI::UIColor(0.16f, 0.16f, 0.16f, 1.0f);
|
||||
::XCEngine::UI::UIColor groupBorderColor =
|
||||
::XCEngine::UI::UIColor(0.30f, 0.30f, 0.30f, 1.0f);
|
||||
::XCEngine::UI::UIColor buttonColor =
|
||||
::XCEngine::UI::UIColor(0.20f, 0.20f, 0.20f, 1.0f);
|
||||
::XCEngine::UI::UIColor buttonBorderColor =
|
||||
::XCEngine::UI::UIColor(0.36f, 0.36f, 0.36f, 1.0f);
|
||||
::XCEngine::UI::UIColor iconColor =
|
||||
::XCEngine::UI::UIColor(0.84f, 0.84f, 0.84f, 1.0f);
|
||||
};
|
||||
|
||||
struct UIEditorShellComposeModel {
|
||||
std::vector<Widgets::UIEditorMenuBarItem> menuBarItems = {};
|
||||
std::vector<UIEditorShellToolbarButton> toolbarButtons = {};
|
||||
std::vector<Widgets::UIEditorStatusBarSegment> statusSegments = {};
|
||||
std::vector<UIEditorWorkspacePanelPresentationModel> workspacePresentations = {};
|
||||
};
|
||||
@@ -23,6 +70,7 @@ struct UIEditorShellComposeMetrics {
|
||||
float sectionGap = 8.0f;
|
||||
float surfaceCornerRounding = 10.0f;
|
||||
Widgets::UIEditorMenuBarMetrics menuBarMetrics = {};
|
||||
UIEditorShellToolbarMetrics toolbarMetrics = {};
|
||||
Widgets::UIEditorDockHostMetrics dockHostMetrics = {};
|
||||
Widgets::UIEditorViewportSlotMetrics viewportMetrics = {};
|
||||
Widgets::UIEditorStatusBarMetrics statusBarMetrics = {};
|
||||
@@ -34,6 +82,7 @@ struct UIEditorShellComposePalette {
|
||||
::XCEngine::UI::UIColor surfaceBorderColor =
|
||||
::XCEngine::UI::UIColor(0.27f, 0.27f, 0.27f, 1.0f);
|
||||
Widgets::UIEditorMenuBarPalette menuBarPalette = {};
|
||||
UIEditorShellToolbarPalette toolbarPalette = {};
|
||||
Widgets::UIEditorDockHostPalette dockHostPalette = {};
|
||||
Widgets::UIEditorViewportSlotPalette viewportPalette = {};
|
||||
Widgets::UIEditorStatusBarPalette statusBarPalette = {};
|
||||
@@ -43,9 +92,11 @@ struct UIEditorShellComposeLayout {
|
||||
::XCEngine::UI::UIRect bounds = {};
|
||||
::XCEngine::UI::UIRect contentRect = {};
|
||||
::XCEngine::UI::UIRect menuBarRect = {};
|
||||
::XCEngine::UI::UIRect toolbarRect = {};
|
||||
::XCEngine::UI::UIRect workspaceRect = {};
|
||||
::XCEngine::UI::UIRect statusBarRect = {};
|
||||
Widgets::UIEditorMenuBarLayout menuBarLayout = {};
|
||||
UIEditorShellToolbarLayout toolbarLayout = {};
|
||||
Widgets::UIEditorStatusBarLayout statusBarLayout = {};
|
||||
};
|
||||
|
||||
@@ -62,6 +113,7 @@ struct UIEditorShellComposeFrame {
|
||||
UIEditorShellComposeLayout BuildUIEditorShellComposeLayout(
|
||||
const ::XCEngine::UI::UIRect& bounds,
|
||||
const std::vector<Widgets::UIEditorMenuBarItem>& menuBarItems,
|
||||
const std::vector<UIEditorShellToolbarButton>& toolbarButtons,
|
||||
const std::vector<Widgets::UIEditorStatusBarSegment>& statusSegments,
|
||||
const UIEditorShellComposeMetrics& metrics = {});
|
||||
|
||||
|
||||
@@ -16,12 +16,14 @@ namespace XCEngine::UI::Editor {
|
||||
|
||||
struct UIEditorShellInteractionDefinition {
|
||||
UIEditorMenuModel menuModel = {};
|
||||
std::vector<UIEditorShellToolbarButton> toolbarButtons = {};
|
||||
std::vector<Widgets::UIEditorStatusBarSegment> statusSegments = {};
|
||||
std::vector<UIEditorWorkspacePanelPresentationModel> workspacePresentations = {};
|
||||
};
|
||||
|
||||
struct UIEditorShellInteractionModel {
|
||||
UIEditorResolvedMenuModel resolvedMenuModel = {};
|
||||
std::vector<UIEditorShellToolbarButton> toolbarButtons = {};
|
||||
std::vector<Widgets::UIEditorStatusBarSegment> statusSegments = {};
|
||||
std::vector<UIEditorWorkspacePanelPresentationModel> workspacePresentations = {};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user