Files
XCEngine/new_editor/src/editor/EditorShellAsset.h

46 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#include <XCNewEditor/Editor/UIEditorPanelRegistry.h>
#include <XCNewEditor/Editor/UIEditorWorkspaceModel.h>
#include <XCNewEditor/Editor/UIEditorWorkspaceSession.h>
#include <cstdint>
#include <filesystem>
#include <string>
namespace XCEngine::NewEditor {
struct EditorShellAsset {
std::string screenId = "new_editor.shell";
std::filesystem::path documentPath = {};
std::filesystem::path themePath = {};
std::filesystem::path captureRootPath = {};
UIEditorPanelRegistry panelRegistry = {};
UIEditorWorkspaceModel workspace = {};
UIEditorWorkspaceSession workspaceSession = {};
};
enum class EditorShellAssetValidationCode : std::uint8_t {
None = 0,
InvalidPanelRegistry,
InvalidWorkspace,
InvalidWorkspaceSession,
MissingPanelDescriptor,
PanelTitleMismatch,
PanelPlaceholderMismatch
};
struct EditorShellAssetValidationResult {
EditorShellAssetValidationCode code = EditorShellAssetValidationCode::None;
std::string message = {};
[[nodiscard]] bool IsValid() const {
return code == EditorShellAssetValidationCode::None;
}
};
EditorShellAsset BuildDefaultEditorShellAsset(const std::filesystem::path& repoRoot);
EditorShellAssetValidationResult ValidateEditorShellAsset(const EditorShellAsset& asset);
} // namespace XCEngine::NewEditor