Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Editor.ThemeTokenSourceResolver Class Reference

Resolves already ordered authoritative root-token declarations for editor preparation. More...

Static Public Member Functions

static bool TryResolve (UnityEngine.UIElements.ThemeStyleSheet source, string fingerprint, IReadOnlyDictionary< string, string > tokens, Func< string, Texture2D > resolveImage, out PreparedThemeSnapshot snapshot, out string error)
 Converts supported root values into a complete serializable snapshot.
static bool TryResolveExpression (string expression, IReadOnlyDictionary< string, string > tokens, out string value)
 Resolves whole-value variable chains and nested fallbacks, refusing cycles.
static bool TryResolveWithImages (UnityEngine.UIElements.ThemeStyleSheet source, string fingerprint, IReadOnlyDictionary< string, string > tokens, Func< string, UnityEngine.Object > resolveImage, out PreparedThemeSnapshot snapshot, out string error)
 Prepares referenced raster or automatically gated compiled vector image assets.

Static Private Member Functions

static bool TryColor (string text, out Color color)
static bool TryDurationSeconds (string text, out float value)
static bool TryPixelNumber (string text, out float value)
static bool TryResolveExpression (string expression, IReadOnlyDictionary< string, string > tokens, HashSet< string > stack, int depth, out string value)

Detailed Description

Resolves already ordered authoritative root-token declarations for editor preparation.

This is deliberately not a general USS cascade interpreter. The caller supplies root declarations in import/cascade order after ownership and selector analysis. No files are read or written here. Conditional/selective declarations and arbitrary layout rules require separate analysis and cannot be represented by pretending they are global root defaults.

Member Function Documentation

◆ TryColor()

bool GWG.WindowFramework.Editor.ThemeTokenSourceResolver.TryColor ( string text,
out Color color )
inlinestaticprivate
Here is the caller graph for this function:

◆ TryDurationSeconds()

bool GWG.WindowFramework.Editor.ThemeTokenSourceResolver.TryDurationSeconds ( string text,
out float value )
inlinestaticprivate
Here is the caller graph for this function:

◆ TryPixelNumber()

bool GWG.WindowFramework.Editor.ThemeTokenSourceResolver.TryPixelNumber ( string text,
out float value )
inlinestaticprivate
Here is the caller graph for this function:

◆ TryResolve()

bool GWG.WindowFramework.Editor.ThemeTokenSourceResolver.TryResolve ( UnityEngine.UIElements.ThemeStyleSheet source,
string fingerprint,
IReadOnlyDictionary< string, string > tokens,
Func< string, Texture2D > resolveImage,
out PreparedThemeSnapshot snapshot,
out string error )
inlinestatic

Converts supported root values into a complete serializable snapshot.

Parameters
sourceMatching authoritative theme reference.
fingerprintDependency fingerprint from preparation.
tokensOrdered-cascade final token expressions, including primitives.
resolveImageEditor-owned reference resolver; null for explicit none only.
snapshotDerived entries plus blocking report on failure.
errorBounded missing/unsupported key report.
Returns
True only for complete supported values; no defaults are invented.
Here is the call graph for this function:

◆ TryResolveExpression() [1/2]

bool GWG.WindowFramework.Editor.ThemeTokenSourceResolver.TryResolveExpression ( string expression,
IReadOnlyDictionary< string, string > tokens,
HashSet< string > stack,
int depth,
out string value )
inlinestaticprivate
Here is the call graph for this function:

◆ TryResolveExpression() [2/2]

bool GWG.WindowFramework.Editor.ThemeTokenSourceResolver.TryResolveExpression ( string expression,
IReadOnlyDictionary< string, string > tokens,
out string value )
inlinestatic

Resolves whole-value variable chains and nested fallbacks, refusing cycles.

Parameters
expressionLiteral or complete var expression, at most 4096 characters per step.
tokensFinal ordinal root expressions; null permits literals/missing-key fallback only.
valueTrimmed resolved expression on success, not necessarily a valid color/image/number.
Returns
True for supported substitution within depth bounds.

Existing invalid/cyclic variables do not automatically use their fallback. Embedded var interpolation is refused. Type/catalog validation happens in TryResolveWithImages.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryResolveWithImages()

bool GWG.WindowFramework.Editor.ThemeTokenSourceResolver.TryResolveWithImages ( UnityEngine.UIElements.ThemeStyleSheet source,
string fingerprint,
IReadOnlyDictionary< string, string > tokens,
Func< string, UnityEngine.Object > resolveImage,
out PreparedThemeSnapshot snapshot,
out string error )
inlinestatic

Prepares referenced raster or automatically gated compiled vector image assets.

Parameters
sourceAuthoritative stylesheet.
fingerprintDependency fingerprint.
tokensFinal ordered root expressions.
resolveImageTrusted editor asset resolver; no player filesystem access.
snapshotComplete prepared output.
errorBounded unsupported report.
Returns
True only when all catalog fields are representable.
Here is the call graph for this function:
Here is the caller graph for this function: