Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Editor.ThemeSourceGraph Class Referencesealed

Read-only ordered source graph for preparation of shipped 2.0 theme tokens. More...

Data Structures

class  ScopedDeclaration

Public Member Functions

bool IsDeveloperPosition (string source, int position)
 Whether an original source position belongs to a valid marked developer region.

Static Public Member Functions

static string ResolveAssetPath (string origin, string reference)
 Resolves local imports/references through actual origin paths and GUID URLs.
static bool TryRead (ThemeStyleSheet source, out ThemeSourceGraph graph, out string error)
 Reads an attached asset's source graph without changing files or importing player data.
static bool TryRead (WindowFrameThemeData data, ThemeStyleSheet source, out ThemeSourceGraph graph, out string error, bool requireModern=true)
 Reads collection application sheets in order before selected theme settings.

Properties

int ComponentRuleCount [get, private set]
 Number of component rules outside root token snapshot semantics.
IReadOnlyList< KeyValuePair< string, string > > ComponentRules [get]
 Original component rule text with its source path, for source-preserving editor migration.
IReadOnlyDictionary< string, string > Origins [get]
 Declaring source path for each final token; editor-only provenance.
IReadOnlyList< int > SourceRuleOffsets [get]
 Original offsets corresponding to SourceRules; used for declaration ownership validation.
IReadOnlyList< KeyValuePair< string, string > > SourceRules [get]
 Every original rule, including root annotations, in configured import/declaration order.
IReadOnlyList< string > Sources [get]
 Ordered visited source assets, including repeated non-cyclic imports.
IReadOnlyDictionary< string, string > Tokens [get]
 Final root declarations in stylesheet import order.

Private Member Functions

void RecordDeveloperRegion (string path, string original, string masked)
void Visit (string path, int depth)

Static Private Member Functions

static int Find (string text, int start, char target)
static int FindMarker (string original, string masked, string marker)
static string RemoveComments (string text)

Private Attributes

int _characters
readonly List< KeyValuePair< string, string > > _componentRules = new List<KeyValuePair<string, string>>()
readonly Dictionary< string, KeyValuePair< int, int > > _developerRegions = new Dictionary<string, KeyValuePair<int, int>>(StringComparer.Ordinal)
readonly Dictionary< string, string > _origins = new Dictionary<string, string>(StringComparer.Ordinal)
readonly List< ScopedDeclaration > _scopedDeclarations = new List<ScopedDeclaration>()
readonly List< int > _sourceRuleOffsets = new List<int>()
readonly List< KeyValuePair< string, string > > _sourceRules = new List<KeyValuePair<string, string>>()
readonly List< string > _sources = new List<string>()
readonly HashSet< string > _stack = new HashSet<string>(StringComparer.Ordinal)
readonly Dictionary< string, string > _tokens = new Dictionary<string, string>(StringComparer.Ordinal)

Detailed Description

Read-only ordered source graph for preparation of shipped 2.0 theme tokens.

Not a full USS cascade engine. Non-root custom declarations are refused rather than flattened into global values. Ordinary component rules are retained in source and reported as outside root-token preparation. No source adoption/rewrite occurs. Imported assets resolve relative to their actual AssetDatabase paths or GUID URLs, never an assumed package directory.

Member Function Documentation

◆ Find()

int GWG.WindowFramework.Editor.ThemeSourceGraph.Find ( string text,
int start,
char target )
inlinestaticprivate
Here is the caller graph for this function:

◆ FindMarker()

int GWG.WindowFramework.Editor.ThemeSourceGraph.FindMarker ( string original,
string masked,
string marker )
inlinestaticprivate
Here is the caller graph for this function:

◆ IsDeveloperPosition()

bool GWG.WindowFramework.Editor.ThemeSourceGraph.IsDeveloperPosition ( string source,
int position )
inline

Whether an original source position belongs to a valid marked developer region.

Here is the caller graph for this function:

◆ RecordDeveloperRegion()

void GWG.WindowFramework.Editor.ThemeSourceGraph.RecordDeveloperRegion ( string path,
string original,
string masked )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveComments()

string GWG.WindowFramework.Editor.ThemeSourceGraph.RemoveComments ( string text)
inlinestaticprivate
Here is the caller graph for this function:

◆ ResolveAssetPath()

string GWG.WindowFramework.Editor.ThemeSourceGraph.ResolveAssetPath ( string origin,
string reference )
inlinestatic

Resolves local imports/references through actual origin paths and GUID URLs.

Parameters
originProject-relative path of the declaring stylesheet, used for relative references.
referenceLocal Assets/Packages path, project database URL or origin-relative reference.
Returns
Project-relative slash-normalized asset path; existence is checked by subsequent asset loading.
Exceptions
InvalidDataExceptionExternal reference or path outside project is encountered.

This is editor-source resolution, not the portable player's SafeAssetPath policy. GUID resolution takes priority where valid. It neither copies dependencies nor imports files.

Here is the caller graph for this function:

◆ TryRead() [1/2]

bool GWG.WindowFramework.Editor.ThemeSourceGraph.TryRead ( ThemeStyleSheet source,
out ThemeSourceGraph graph,
out string error )
inlinestatic

Reads an attached asset's source graph without changing files or importing player data.

Parameters
sourceShipped theme asset.
graphRead graph on success.
errorBounded diagnostic without absolute paths.
Returns
True only for structurally modern 2.0 root tokens and supported syntax.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryRead() [2/2]

bool GWG.WindowFramework.Editor.ThemeSourceGraph.TryRead ( WindowFrameThemeData data,
ThemeStyleSheet source,
out ThemeSourceGraph graph,
out string error,
bool requireModern = true )
inlinestatic

Reads collection application sheets in order before selected theme settings.

Parameters
dataComposition owner, or null for isolated source inspection.
sourceSelected theme entry sheet.
graphCombined ordered source graph.
errorPreparation diagnostic.
requireModernTrue for modern preparation; false for migration inspection without modern marker/scoped-value equivalence checks. Syntax/import/resource bounds still apply.
Returns
Whether the composed source is supported.
Here is the call graph for this function:

◆ Visit()

void GWG.WindowFramework.Editor.ThemeSourceGraph.Visit ( string path,
int depth )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ _characters

int GWG.WindowFramework.Editor.ThemeSourceGraph._characters
private

◆ _componentRules

readonly List<KeyValuePair<string, string> > GWG.WindowFramework.Editor.ThemeSourceGraph._componentRules = new List<KeyValuePair<string, string>>()
private

◆ _developerRegions

readonly Dictionary<string, KeyValuePair<int, int> > GWG.WindowFramework.Editor.ThemeSourceGraph._developerRegions = new Dictionary<string, KeyValuePair<int, int>>(StringComparer.Ordinal)
private

◆ _origins

readonly Dictionary<string, string> GWG.WindowFramework.Editor.ThemeSourceGraph._origins = new Dictionary<string, string>(StringComparer.Ordinal)
private

◆ _scopedDeclarations

readonly List<ScopedDeclaration> GWG.WindowFramework.Editor.ThemeSourceGraph._scopedDeclarations = new List<ScopedDeclaration>()
private

◆ _sourceRuleOffsets

readonly List<int> GWG.WindowFramework.Editor.ThemeSourceGraph._sourceRuleOffsets = new List<int>()
private

◆ _sourceRules

readonly List<KeyValuePair<string, string> > GWG.WindowFramework.Editor.ThemeSourceGraph._sourceRules = new List<KeyValuePair<string, string>>()
private

◆ _sources

readonly List<string> GWG.WindowFramework.Editor.ThemeSourceGraph._sources = new List<string>()
private

◆ _stack

readonly HashSet<string> GWG.WindowFramework.Editor.ThemeSourceGraph._stack = new HashSet<string>(StringComparer.Ordinal)
private

◆ _tokens

readonly Dictionary<string, string> GWG.WindowFramework.Editor.ThemeSourceGraph._tokens = new Dictionary<string, string>(StringComparer.Ordinal)
private

Property Documentation

◆ ComponentRuleCount

int GWG.WindowFramework.Editor.ThemeSourceGraph.ComponentRuleCount
getprivate set

Number of component rules outside root token snapshot semantics.

◆ ComponentRules

IReadOnlyList<KeyValuePair<string, string> > GWG.WindowFramework.Editor.ThemeSourceGraph.ComponentRules
get

Original component rule text with its source path, for source-preserving editor migration.

◆ Origins

IReadOnlyDictionary<string, string> GWG.WindowFramework.Editor.ThemeSourceGraph.Origins
get

Declaring source path for each final token; editor-only provenance.

◆ SourceRuleOffsets

IReadOnlyList<int> GWG.WindowFramework.Editor.ThemeSourceGraph.SourceRuleOffsets
get

Original offsets corresponding to SourceRules; used for declaration ownership validation.

◆ SourceRules

IReadOnlyList<KeyValuePair<string, string> > GWG.WindowFramework.Editor.ThemeSourceGraph.SourceRules
get

Every original rule, including root annotations, in configured import/declaration order.

Comments and declaring origins are retained for the developer compiler. The framework root catalog still uses its own strict root-token validation.

◆ Sources

IReadOnlyList<string> GWG.WindowFramework.Editor.ThemeSourceGraph.Sources
get

Ordered visited source assets, including repeated non-cyclic imports.

◆ Tokens

IReadOnlyDictionary<string, string> GWG.WindowFramework.Editor.ThemeSourceGraph.Tokens
get

Final root declarations in stylesheet import order.