2026-04-07 06:30:34 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-04-10 00:41:28 +08:00
|
|
|
#include <XCEditor/Shell/UIEditorWorkspaceCompose.h>
|
|
|
|
|
#include <XCEditor/Shell/UIEditorMenuBar.h>
|
|
|
|
|
#include <XCEditor/Shell/UIEditorStatusBar.h>
|
2026-04-07 06:30:34 +08:00
|
|
|
|
|
|
|
|
namespace XCEngine::UI::Editor {
|
|
|
|
|
|
2026-04-10 16:40:11 +08:00
|
|
|
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;
|
2026-04-10 21:05:07 +08:00
|
|
|
float groupPaddingX = 6.0f;
|
|
|
|
|
float groupPaddingY = 2.0f;
|
|
|
|
|
float buttonWidth = 18.0f;
|
|
|
|
|
float buttonHeight = 16.0f;
|
|
|
|
|
float buttonGap = 4.0f;
|
|
|
|
|
float groupCornerRounding = 0.0f;
|
|
|
|
|
float buttonCornerRounding = 0.0f;
|
2026-04-10 16:40:11 +08:00
|
|
|
float borderThickness = 1.0f;
|
2026-04-10 21:05:07 +08:00
|
|
|
float iconThickness = 1.2f;
|
2026-04-10 16:40:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorShellToolbarPalette {
|
|
|
|
|
::XCEngine::UI::UIColor barColor =
|
|
|
|
|
::XCEngine::UI::UIColor(0.13f, 0.13f, 0.13f, 1.0f);
|
|
|
|
|
::XCEngine::UI::UIColor groupColor =
|
2026-04-10 21:05:07 +08:00
|
|
|
::XCEngine::UI::UIColor(0.15f, 0.15f, 0.15f, 1.0f);
|
2026-04-10 16:40:11 +08:00
|
|
|
::XCEngine::UI::UIColor groupBorderColor =
|
2026-04-10 21:05:07 +08:00
|
|
|
::XCEngine::UI::UIColor(0.25f, 0.25f, 0.25f, 1.0f);
|
2026-04-10 16:40:11 +08:00
|
|
|
::XCEngine::UI::UIColor buttonColor =
|
2026-04-10 21:05:07 +08:00
|
|
|
::XCEngine::UI::UIColor(0.19f, 0.19f, 0.19f, 1.0f);
|
2026-04-10 16:40:11 +08:00
|
|
|
::XCEngine::UI::UIColor buttonBorderColor =
|
2026-04-10 21:05:07 +08:00
|
|
|
::XCEngine::UI::UIColor(0.29f, 0.29f, 0.29f, 1.0f);
|
2026-04-10 16:40:11 +08:00
|
|
|
::XCEngine::UI::UIColor iconColor =
|
2026-04-10 21:05:07 +08:00
|
|
|
::XCEngine::UI::UIColor(0.82f, 0.82f, 0.82f, 1.0f);
|
2026-04-10 16:40:11 +08:00
|
|
|
};
|
|
|
|
|
|
2026-04-07 06:30:34 +08:00
|
|
|
struct UIEditorShellComposeModel {
|
|
|
|
|
std::vector<Widgets::UIEditorMenuBarItem> menuBarItems = {};
|
2026-04-10 16:40:11 +08:00
|
|
|
std::vector<UIEditorShellToolbarButton> toolbarButtons = {};
|
2026-04-07 06:30:34 +08:00
|
|
|
std::vector<Widgets::UIEditorStatusBarSegment> statusSegments = {};
|
|
|
|
|
std::vector<UIEditorWorkspacePanelPresentationModel> workspacePresentations = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorShellComposeState {
|
|
|
|
|
Widgets::UIEditorMenuBarState menuBarState = {};
|
|
|
|
|
UIEditorWorkspaceComposeState workspaceState = {};
|
|
|
|
|
Widgets::UIEditorStatusBarState statusBarState = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorShellComposeMetrics {
|
2026-04-10 21:05:07 +08:00
|
|
|
float outerPadding = 0.0f;
|
|
|
|
|
float sectionGap = 0.0f;
|
|
|
|
|
float surfaceCornerRounding = 0.0f;
|
2026-04-07 06:30:34 +08:00
|
|
|
Widgets::UIEditorMenuBarMetrics menuBarMetrics = {};
|
2026-04-10 16:40:11 +08:00
|
|
|
UIEditorShellToolbarMetrics toolbarMetrics = {};
|
2026-04-07 06:30:34 +08:00
|
|
|
Widgets::UIEditorDockHostMetrics dockHostMetrics = {};
|
2026-04-10 00:41:28 +08:00
|
|
|
Widgets::UIEditorViewportSlotMetrics viewportMetrics = {};
|
2026-04-07 06:30:34 +08:00
|
|
|
Widgets::UIEditorStatusBarMetrics statusBarMetrics = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorShellComposePalette {
|
|
|
|
|
::XCEngine::UI::UIColor surfaceColor =
|
|
|
|
|
::XCEngine::UI::UIColor(0.14f, 0.14f, 0.14f, 1.0f);
|
|
|
|
|
::XCEngine::UI::UIColor surfaceBorderColor =
|
|
|
|
|
::XCEngine::UI::UIColor(0.27f, 0.27f, 0.27f, 1.0f);
|
|
|
|
|
Widgets::UIEditorMenuBarPalette menuBarPalette = {};
|
2026-04-10 16:40:11 +08:00
|
|
|
UIEditorShellToolbarPalette toolbarPalette = {};
|
2026-04-07 06:30:34 +08:00
|
|
|
Widgets::UIEditorDockHostPalette dockHostPalette = {};
|
2026-04-10 00:41:28 +08:00
|
|
|
Widgets::UIEditorViewportSlotPalette viewportPalette = {};
|
2026-04-07 06:30:34 +08:00
|
|
|
Widgets::UIEditorStatusBarPalette statusBarPalette = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorShellComposeLayout {
|
|
|
|
|
::XCEngine::UI::UIRect bounds = {};
|
|
|
|
|
::XCEngine::UI::UIRect contentRect = {};
|
|
|
|
|
::XCEngine::UI::UIRect menuBarRect = {};
|
2026-04-10 16:40:11 +08:00
|
|
|
::XCEngine::UI::UIRect toolbarRect = {};
|
2026-04-07 06:30:34 +08:00
|
|
|
::XCEngine::UI::UIRect workspaceRect = {};
|
|
|
|
|
::XCEngine::UI::UIRect statusBarRect = {};
|
|
|
|
|
Widgets::UIEditorMenuBarLayout menuBarLayout = {};
|
2026-04-10 16:40:11 +08:00
|
|
|
UIEditorShellToolbarLayout toolbarLayout = {};
|
2026-04-07 06:30:34 +08:00
|
|
|
Widgets::UIEditorStatusBarLayout statusBarLayout = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorShellComposeRequest {
|
|
|
|
|
UIEditorShellComposeLayout layout = {};
|
|
|
|
|
UIEditorWorkspaceComposeRequest workspaceRequest = {};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct UIEditorShellComposeFrame {
|
|
|
|
|
UIEditorShellComposeLayout layout = {};
|
|
|
|
|
UIEditorWorkspaceComposeFrame workspaceFrame = {};
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-11 17:07:37 +08:00
|
|
|
UIEditorShellComposeLayout BuildUIEditorShellComposeLayout(
|
|
|
|
|
const ::XCEngine::UI::UIRect& bounds,
|
|
|
|
|
const std::vector<Widgets::UIEditorMenuBarItem>& menuBarItems,
|
|
|
|
|
const std::vector<Widgets::UIEditorStatusBarSegment>& statusSegments,
|
|
|
|
|
const UIEditorShellComposeMetrics& metrics = {});
|
|
|
|
|
|
2026-04-07 06:30:34 +08:00
|
|
|
UIEditorShellComposeLayout BuildUIEditorShellComposeLayout(
|
|
|
|
|
const ::XCEngine::UI::UIRect& bounds,
|
|
|
|
|
const std::vector<Widgets::UIEditorMenuBarItem>& menuBarItems,
|
2026-04-10 16:40:11 +08:00
|
|
|
const std::vector<UIEditorShellToolbarButton>& toolbarButtons,
|
2026-04-07 06:30:34 +08:00
|
|
|
const std::vector<Widgets::UIEditorStatusBarSegment>& statusSegments,
|
|
|
|
|
const UIEditorShellComposeMetrics& metrics = {});
|
|
|
|
|
|
|
|
|
|
UIEditorShellComposeRequest ResolveUIEditorShellComposeRequest(
|
|
|
|
|
const ::XCEngine::UI::UIRect& bounds,
|
|
|
|
|
const UIEditorPanelRegistry& panelRegistry,
|
|
|
|
|
const UIEditorWorkspaceModel& workspace,
|
|
|
|
|
const UIEditorWorkspaceSession& session,
|
|
|
|
|
const UIEditorShellComposeModel& model,
|
|
|
|
|
const Widgets::UIEditorDockHostState& dockHostState = {},
|
|
|
|
|
const UIEditorShellComposeState& state = {},
|
|
|
|
|
const UIEditorShellComposeMetrics& metrics = {});
|
|
|
|
|
|
|
|
|
|
UIEditorShellComposeFrame UpdateUIEditorShellCompose(
|
|
|
|
|
UIEditorShellComposeState& state,
|
|
|
|
|
const ::XCEngine::UI::UIRect& bounds,
|
|
|
|
|
const UIEditorPanelRegistry& panelRegistry,
|
|
|
|
|
const UIEditorWorkspaceModel& workspace,
|
|
|
|
|
const UIEditorWorkspaceSession& session,
|
|
|
|
|
const UIEditorShellComposeModel& model,
|
|
|
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
|
|
|
|
const Widgets::UIEditorDockHostState& dockHostState = {},
|
|
|
|
|
const UIEditorShellComposeMetrics& metrics = {});
|
|
|
|
|
|
|
|
|
|
void AppendUIEditorShellCompose(
|
|
|
|
|
::XCEngine::UI::UIDrawList& drawList,
|
|
|
|
|
const UIEditorShellComposeFrame& frame,
|
|
|
|
|
const UIEditorShellComposeModel& model,
|
|
|
|
|
const UIEditorShellComposeState& state,
|
|
|
|
|
const UIEditorShellComposePalette& palette = {},
|
|
|
|
|
const UIEditorShellComposeMetrics& metrics = {});
|
|
|
|
|
|
|
|
|
|
} // namespace XCEngine::UI::Editor
|