Files
XCEngine/new_editor/include/XCEditor/Shell/UIEditorShellAsset.h

63 lines
2.0 KiB
C
Raw Normal View History

#pragma once
2026-04-10 00:41:28 +08:00
#include <XCEditor/Foundation/UIEditorShortcutManager.h>
#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>
#include <cstdint>
#include <filesystem>
#include <string>
2026-04-07 12:47:16 +08:00
#include <vector>
namespace XCEngine::UI::Editor {
2026-04-07 12:47:16 +08:00
struct EditorShellShortcutAsset {
UIEditorCommandRegistry commandRegistry = {};
std::vector<UIShortcutBinding> bindings = {};
2026-04-07 12:47:16 +08:00
};
struct EditorShellAsset {
std::string screenId = "editor.shell";
std::filesystem::path documentPath = {};
std::filesystem::path captureRootPath = {};
UIEditorPanelRegistry panelRegistry = {};
UIEditorWorkspaceModel workspace = {};
UIEditorWorkspaceSession workspaceSession = {};
UIEditorShellInteractionDefinition shellDefinition = {};
2026-04-07 12:47:16 +08:00
EditorShellShortcutAsset shortcutAsset = {};
};
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
};
struct EditorShellAssetValidationResult {
EditorShellAssetValidationCode code = EditorShellAssetValidationCode::None;
std::string message = {};
[[nodiscard]] bool IsValid() const {
return code == EditorShellAssetValidationCode::None;
}
};
EditorShellAsset BuildDefaultEditorShellAsset(const std::filesystem::path& repoRoot);
2026-04-07 12:47:16 +08:00
UIEditorShortcutManager BuildEditorShellShortcutManager(const EditorShellAsset& asset);
EditorShellAssetValidationResult ValidateEditorShellAsset(const EditorShellAsset& asset);
} // namespace XCEngine::UI::Editor