关键节点
This commit is contained in:
61
editor/include/XCEditor/Shell/UIEditorShellAsset.h
Normal file
61
editor/include/XCEditor/Shell/UIEditorShellAsset.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/Foundation/UIEditorShortcutManager.h>
|
||||
#include <XCEditor/Menu/UIEditorMenuModel.h>
|
||||
#include <XCEditor/Panels/UIEditorPanelRegistry.h>
|
||||
#include <XCEditor/Shell/UIEditorShellInteraction.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceModel.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceSession.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
struct EditorShellShortcutAsset {
|
||||
UIEditorCommandRegistry commandRegistry = {};
|
||||
std::vector<UIShortcutBinding> bindings = {};
|
||||
};
|
||||
|
||||
struct EditorShellAsset {
|
||||
std::string screenId = {};
|
||||
std::filesystem::path documentPath = {};
|
||||
std::filesystem::path captureRootPath = {};
|
||||
UIEditorPanelRegistry panelRegistry = {};
|
||||
UIEditorWorkspaceModel workspace = {};
|
||||
UIEditorWorkspaceSession workspaceSession = {};
|
||||
UIEditorShellInteractionDefinition shellDefinition = {};
|
||||
EditorShellShortcutAsset shortcutAsset = {};
|
||||
};
|
||||
|
||||
enum class EditorShellAssetValidationCode : std::uint8_t {
|
||||
None = 0,
|
||||
InvalidPanelRegistry = 1,
|
||||
InvalidWorkspace = 2,
|
||||
InvalidWorkspaceSession = 3,
|
||||
InvalidShellMenuModel = 4,
|
||||
InvalidShortcutConfiguration = 5,
|
||||
MissingPanelDescriptor = 6,
|
||||
PanelTitleMismatch = 7,
|
||||
PanelPlaceholderMismatch = 8,
|
||||
DuplicateShellPresentationPanelId = 9,
|
||||
MissingShellPresentationPanelDescriptor = 10,
|
||||
MissingRequiredShellPresentation = 11,
|
||||
ShellPresentationKindMismatch = 12
|
||||
};
|
||||
|
||||
struct EditorShellAssetValidationResult {
|
||||
EditorShellAssetValidationCode code = EditorShellAssetValidationCode::None;
|
||||
std::string message = {};
|
||||
|
||||
[[nodiscard]] bool IsValid() const {
|
||||
return code == EditorShellAssetValidationCode::None;
|
||||
}
|
||||
};
|
||||
|
||||
UIEditorShortcutManager BuildEditorShellShortcutManager(const EditorShellAsset& asset);
|
||||
EditorShellAssetValidationResult ValidateEditorShellAsset(const EditorShellAsset& asset);
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
Reference in New Issue
Block a user