载入中...
搜索中...
未找到
EditorUiSkinPreview.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6
7#include <map>
8
9namespace eve::editor {
10
13 double width = 0.0;
14 double height = 0.0;
15};
16
19public:
21 virtual ~IUiSkinAssetResolver() = default;
23 virtual Result<UiTextureMetadata> texture(const std::string& asset) const = 0;
25 virtual Result<void> font(const std::string& asset) const = 0;
26};
27
29enum class UiSkinDrawKind { Image, Text };
30
35 std::string asset;
36 std::string text;
37 double x = 0.0, y = 0.0, width = 0.0, height = 0.0;
38 double clipX = 0.0, clipY = 0.0, clipWidth = 0.0, clipHeight = 0.0;
39 double u0 = 0.0, v0 = 0.0, u1 = 1.0, v1 = 1.0;
40 double r = 1.0, g = 1.0, b = 1.0, a = 1.0;
41 double fontSize = 16.0;
42};
43
46 EditorStatus status = EditorStatus::Failed;
48 std::vector<UiSkinDrawCommand> commands;
49 std::vector<EditorDiagnostic> diagnostics;
50};
51
54public:
56 UiSkinDrawPlan build(const UiDocumentTarget& document, const UiPreviewSnapshot& preview,
57 const IUiSkinAssetResolver& assets) const;
58};
59
62public:
64 virtual ~IUiSkinPlanRenderer() = default;
66 virtual Result<void> render(const UiSkinDrawPlan& plan) = 0;
67};
68
69} // namespace eve::editor
#define EVENGINE_API_EDITORS
Definition Export.h:112
Move-only operation result carrying either a value or Status.
Definition Result.h:155
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
Asset metadata boundary used by renderer-neutral UI preview planning.
virtual ~IUiSkinAssetResolver()=default
Releases IUiSkinAssetResolver resources.
virtual Result< void > font(const std::string &asset) const =0
Report whether a font asset can be resolved.
virtual Result< UiTextureMetadata > texture(const std::string &asset) const =0
Resolve texture dimensions, returning NotFound for missing assets.
Narrow presentation boundary consuming a renderer-neutral UI skin plan.
virtual Result< void > render(const UiSkinDrawPlan &plan)=0
Draw all commands in document order into the active target.
virtual ~IUiSkinPlanRenderer()=default
Releases IUiSkinPlanRenderer resources.
Builds deterministic text/texture commands without touching runtime graphics.
Serializable UI authoring document with hierarchy and inspector capabilities.
Definition UiDocument.h:149
UiSkinDrawKind
UiSkinDrawKind public API.
eve::editing::Revision Revision
StatusCode
Stable outcome category for an operation.
Definition Status.h:27
One deterministic text or image command, including effective clipping.
Revision-bound content plan suitable for graphics or UI-host presenters.
std::vector< UiSkinDrawCommand > commands
std::vector< EditorDiagnostic > diagnostics
Dimensions known for an editor-resolved UI texture.
Deterministic UI layout preview used by canvas rendering and picking.
Definition UiDocument.h:246