Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding Class Referencesealed

Maps resolved semantic tokens onto one explicitly scoped framework surface. More...

Inheritance diagram for GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding:
Collaboration diagram for GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding:

Public Member Functions

 PlayerThemeSurfaceBinding (VisualElement element, PlayerThemeValues values)
 Creates a binding for an explicit surface and resolved token source.
void Dispose ()
 Removes callbacks and restores only overrides still owned by this binding.
PlayerThemeSurfaceBinding MapAppearance (string background=null, string text=null, string border=null, string image=null)
 Maps optional colour and image roles to this element.
PlayerThemeSurfaceBinding MapBottomBorder (string token)
 Maps only the bottom border colour, leaving other border roles untouched.
PlayerThemeSurfaceBinding MapCursor (string token)
 Maps a validated cursor image while retaining the element's original cursor on release.
PlayerThemeSurfaceBinding MapFont ()
 Applies the configured shipped font without loading player font content.
PlayerThemeSurfaceBinding MapGeometry (string borderWidth=null, string cornerRadius=null, string minHeight=null, string fontSize=null, Func< bool > suppressFrameGeometry=null)
 Maps dimensions without changing position, padding, margins or visibility.
PlayerThemeSurfaceBinding MapIconTint (string normal, string hover=null)
 Maps icon tint with event-driven hover, restoring caller-owned styles on release.
PlayerThemeSurfaceBinding MapModalQueue ()
 Maps supported modal queue presentation values without changing dismissal policy.
PlayerThemeSurfaceBinding MapPadding (string token)
 Maps uniform padding from a validated spacing token, restoring owned values on release.
PlayerThemeSurfaceBinding MapScrollbarGeometry (Scroller scroller)
 Maps only a native Scroller's cross-axis thickness and arrow/end-space dimensions.
PlayerThemeSurfaceBinding MapSize (string width=null, string height=null, string minWidth=null)
 Maps explicit dimensions without changing position, parenting or visibility.
PlayerThemeSurfaceBinding MapTint (string token)
 Maps uniform image tint without installing interaction callbacks.
void Refresh ()
 Applies supplied values and current suppression state; no per-frame polling.

Properties

bool IsDisposed [get]
 Gets whether this binding has released its callbacks and overrides.

Private Member Functions

void BindColor (string token, Func< StyleColor > get, Action< StyleColor > set)
void BindLength (Func< string > token, Func< StyleLength > get, Action< StyleLength > set)
void BindLength (string token, Func< StyleLength > get, Action< StyleLength > set, Func< bool > suppress)
void BindNumber (string token, Func< StyleFloat > get, Action< StyleFloat > set, Func< bool > suppress)
void Detach (DetachFromPanelEvent evt)
void EnsureActive ()
PlayerThemeSurfaceBinding MapCursor (Func< string > token)

Private Attributes

bool _disposed
readonly VisualElement _element
readonly List< Action > _refresh = new List<Action>()
readonly List< Action > _restore = new List<Action>()
readonly PlayerThemeValues _values

Detailed Description

Maps resolved semantic tokens onto one explicitly scoped framework surface.

Uses only public inline-style APIs. Owners supply mappings from the framework catalog; this class does not guess selectors, scan hierarchies or override layout positions. Refresh after values or fullscreen state changes. Detachment disposes the binding; create a fresh binding on reattachment. Texture lifetime belongs to the theme owner.

Constructor & Destructor Documentation

◆ PlayerThemeSurfaceBinding()

GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.PlayerThemeSurfaceBinding ( VisualElement element,
PlayerThemeValues values )
inline

Creates a binding for an explicit surface and resolved token source.

Parameters
elementElement inside the intended theme scope.
valuesResolved tokens without an invented default palette.
Exceptions
ArgumentNullExceptionEither argument is null.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ BindColor()

void GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.BindColor ( string token,
Func< StyleColor > get,
Action< StyleColor > set )
inlineprivate
Here is the caller graph for this function:

◆ BindLength() [1/2]

void GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.BindLength ( Func< string > token,
Func< StyleLength > get,
Action< StyleLength > set )
inlineprivate

◆ BindLength() [2/2]

void GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.BindLength ( string token,
Func< StyleLength > get,
Action< StyleLength > set,
Func< bool > suppress )
inlineprivate
Here is the caller graph for this function:

◆ BindNumber()

void GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.BindNumber ( string token,
Func< StyleFloat > get,
Action< StyleFloat > set,
Func< bool > suppress )
inlineprivate
Here is the caller graph for this function:

◆ Detach()

void GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.Detach ( DetachFromPanelEvent evt)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dispose()

void GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.Dispose ( )
inline

Removes callbacks and restores only overrides still owned by this binding.

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

◆ EnsureActive()

void GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.EnsureActive ( )
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MapAppearance()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapAppearance ( string background = null,
string text = null,
string border = null,
string image = null )
inline

Maps optional colour and image roles to this element.

Parameters
backgroundBackground token or null.
textText token or null.
borderBorder colour token for all four sides or null.
imageBackground image token or null.
Returns
This binding for chained configuration.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MapBottomBorder()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapBottomBorder ( string token)
inline

Maps only the bottom border colour, leaving other border roles untouched.

Parameters
tokenResolved bottom-border colour token.
Returns
This binding for chained configuration.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MapCursor() [1/2]

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapCursor ( Func< string > token)
inlineprivate
Here is the call graph for this function:

◆ MapCursor() [2/2]

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapCursor ( string token)
inline

Maps a validated cursor image while retaining the element's original cursor on release.

Parameters
tokenCanonical directional cursor image token.
Returns
This binding.

Images are borrowed from the theme owner. The hotspot is the image center, preserving the existing 16,16 hotspot for 32-pixel cursors. Omission restores the configured cursor; explicit null clears it. Detach restores before texture release.

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

◆ MapFont()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapFont ( )
inline

Applies the configured shipped font without loading player font content.

Returns
This binding.

Omitted font data leaves source styles untouched. panel-default clears the element's font override to inherit its panel font. Both legacy Font and FontDefinition properties are restored only while still owned by this binding.

Here is the call graph for this function:

◆ MapGeometry()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapGeometry ( string borderWidth = null,
string cornerRadius = null,
string minHeight = null,
string fontSize = null,
Func< bool > suppressFrameGeometry = null )
inline

Maps dimensions without changing position, padding, margins or visibility.

Parameters
borderWidthAll-side border width token or null.
cornerRadiusAll-corner radius token or null.
minHeightMinimum-height token or null.
fontSizeFont-size token or null.
suppressFrameGeometryOptional current-state predicate, e.g. fullscreen frame.
Returns
This binding for chained configuration.

Suppression restores original border geometry so fullscreen USS rules remain effective.

Here is the call graph for this function:

◆ MapIconTint()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapIconTint ( string normal,
string hover = null )
inline

Maps icon tint with event-driven hover, restoring caller-owned styles on release.

Parameters
normalNormal tint token.
hoverOptional hover tint token.
Returns
This binding.
Here is the call graph for this function:

◆ MapModalQueue()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapModalQueue ( )
inline

Maps supported modal queue presentation values without changing dismissal policy.

Returns
This binding.
Here is the call graph for this function:

◆ MapPadding()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapPadding ( string token)
inline

Maps uniform padding from a validated spacing token, restoring owned values on release.

Parameters
tokenCanonical spacing role from the portable catalog.
Returns
This binding.
Here is the call graph for this function:

◆ MapScrollbarGeometry()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapScrollbarGeometry ( Scroller scroller)
inline

Maps only a native Scroller's cross-axis thickness and arrow/end-space dimensions.

Parameters
scrollerOwning native scroller; its direction determines the dimension axis.
Returns
This binding. Scroll ranges and thumb length remain native-owned.
Here is the call graph for this function:

◆ MapSize()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapSize ( string width = null,
string height = null,
string minWidth = null )
inline

Maps explicit dimensions without changing position, parenting or visibility.

Parameters
widthOptional resolved width token.
heightOptional resolved height token.
minWidthOptional resolved minimum-width token.
Returns
This binding for chained mappings.

Writes inline dimensions immediately when values exist, so this does affect layout sizing. It does not decide which application container owns the element. Missing tokens restore owned overrides; disposal preserves differing newer caller values. Do not map the same style property through multiple competing bindings.

Here is the call graph for this function:

◆ MapTint()

PlayerThemeSurfaceBinding GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.MapTint ( string token)
inline

Maps uniform image tint without installing interaction callbacks.

Parameters
tokenResolved tint role, selected by the existing state binding.
Returns
This binding.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Refresh()

void GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.Refresh ( )
inline

Applies supplied values and current suppression state; no per-frame polling.

Here is the caller graph for this function:

Field Documentation

◆ _disposed

bool GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding._disposed
private

◆ _element

readonly VisualElement GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding._element
private

◆ _refresh

readonly List<Action> GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding._refresh = new List<Action>()
private

◆ _restore

readonly List<Action> GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding._restore = new List<Action>()
private

◆ _values

readonly PlayerThemeValues GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding._values
private

Property Documentation

◆ IsDisposed

bool GWG.WindowFramework.Theming.PlayerThemeSurfaceBinding.IsDisposed
get

Gets whether this binding has released its callbacks and overrides.