2026-04-06 03:17:53 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-04-10 00:41:28 +08:00
|
|
|
#include <XCEditor/Foundation/UIEditorShortcutManager.h>
|
2026-04-10 01:59:15 +08:00
|
|
|
#include <XCEditor/Shell/UIEditorMenuModel.h>
|
2026-04-10 00:41:28 +08:00
|
|
|
#include <XCEditor/Shell/UIEditorPanelRegistry.h>
|
|
|
|
|
#include <XCEditor/Shell/UIEditorShellInteraction.h>
|
|
|
|
|
#include <XCEditor/Shell/UIEditorWorkspaceModel.h>
|
|
|
|
|
#include <XCEditor/Shell/UIEditorWorkspaceSession.h>
|
2026-04-06 16:20:46 +08:00
|
|
|
|
|
|
|
|
#include <cstdint>
|
2026-04-06 03:17:53 +08:00
|
|
|
#include <filesystem>
|
|
|
|
|
#include <string>
|
2026-04-07 12:47:16 +08:00
|
|
|
#include <vector>
|
2026-04-06 03:17:53 +08:00
|
|
|
|
2026-04-06 20:02:34 +08:00
|
|
|
namespace XCEngine::UI::Editor {
|
2026-04-06 03:17:53 +08:00
|
|
|
|
2026-04-07 12:47:16 +08:00
|
|
|
struct EditorShellShortcutAsset {
|
|
|
|
|
UIEditorCommandRegistry commandRegistry = {};
|
2026-04-10 01:59:15 +08:00
|
|
|
std::vector<UIShortcutBinding> bindings = {};
|
2026-04-07 12:47:16 +08:00
|
|
|
};
|
|
|
|
|
|
2026-04-06 03:17:53 +08:00
|
|
|
struct EditorShellAsset {
|
2026-04-06 20:02:34 +08:00
|
|
|
std::string screenId = "editor.shell";
|
2026-04-06 03:17:53 +08:00
|
|
|
std::filesystem::path documentPath = {};
|
|
|
|
|
std::filesystem::path captureRootPath = {};
|
2026-04-06 16:20:46 +08:00
|
|
|
UIEditorPanelRegistry panelRegistry = {};
|
|
|
|
|
UIEditorWorkspaceModel workspace = {};
|
|
|
|
|
UIEditorWorkspaceSession workspaceSession = {};
|
2026-04-07 12:38:23 +08:00
|
|
|
UIEditorShellInteractionDefinition shellDefinition = {};
|
2026-04-07 12:47:16 +08:00
|
|
|
EditorShellShortcutAsset shortcutAsset = {};
|
2026-04-06 16:20:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum class EditorShellAssetValidationCode : std::uint8_t {
|
|
|
|
|
None = 0,
|
2026-04-10 02:04:24 +08:00
|
|
|
InvalidPanelRegistry = 1,
|
|
|
|
|
MissingPanelDescriptor = 2,
|
|
|
|
|
PanelTitleMismatch = 3,
|
|
|
|
|
PanelPlaceholderMismatch = 4,
|
|
|
|
|
InvalidWorkspace = 5,
|
|
|
|
|
InvalidWorkspaceSession = 6,
|
|
|
|
|
MissingShellPresentationPanelDescriptor = 7,
|
|
|
|
|
DuplicateShellPresentationPanelId = 8,
|
|
|
|
|
MissingRequiredShellPresentation = 9,
|
|
|
|
|
ShellPresentationKindMismatch = 10,
|
|
|
|
|
InvalidShellMenuModel = 11,
|
|
|
|
|
InvalidShortcutConfiguration = 12
|
2026-04-06 16:20:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct EditorShellAssetValidationResult {
|
|
|
|
|
EditorShellAssetValidationCode code = EditorShellAssetValidationCode::None;
|
|
|
|
|
std::string message = {};
|
|
|
|
|
|
|
|
|
|
[[nodiscard]] bool IsValid() const {
|
|
|
|
|
return code == EditorShellAssetValidationCode::None;
|
|
|
|
|
}
|
2026-04-06 03:17:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
EditorShellAsset BuildDefaultEditorShellAsset(const std::filesystem::path& repoRoot);
|
2026-04-07 12:47:16 +08:00
|
|
|
UIEditorShortcutManager BuildEditorShellShortcutManager(const EditorShellAsset& asset);
|
2026-04-06 16:20:46 +08:00
|
|
|
EditorShellAssetValidationResult ValidateEditorShellAsset(const EditorShellAsset& asset);
|
2026-04-06 03:17:53 +08:00
|
|
|
|
2026-04-06 20:02:34 +08:00
|
|
|
} // namespace XCEngine::UI::Editor
|