class

FMiriGraphicsWidgetFactory

Turns a serialized .ui tree into a live Miri widget tree. The widget class name on each node keys a small construction table; named nodes are collected so a game can resolve them for script binding after instantiate.

Module
MiriGraphics
Header
#include "MiriGraphics/FMiriGraphicsWidgetFactory.h"
Namespace
Mowo

Properties

TypeNameDescription
static constexpr int32_tMaxUserWidgetDepthHow deep UserWidget composition may nest before the factory refuses. Default 8.

Public functions

ReturnsNameDescription
FBuildResultBuild
FBuildResultBuild
FBuildResultBuild
voidApplyBindingValueWrites one resolved binding value onto a live widget.
std::stringFormatBindingNumber
voidParseFormatSources
FMiriGraphicsBindingValueEvaluateBinding
Miri::CBrushResolveBrushA brush description resolved against the active theme: a field naming a token of the matching kind takes it, a colour field next tries colour tokens, and what is left is a literal.
Miri::MiriColorReadNodeColor
voidSetImageDecoderForwards to Miri::Mowo::CMiriImageCache, which owns the process-wide image decode hook + GPU texture cache.
voidClearImageCache
Miri::Ref<Miri::IMiriRHITexture>GetOrLoadImage
Miri::Ref<Miri::IMiriRHITexture>GetOrLoadImageAsyncThe non-blocking twin: returns the texture when it is cached, otherwise queues a decode on the worker and returns null (the caller keeps its placeholder).
voidPumpAsyncImages
size_tPendingAsyncImages
Miri::Ref<Miri::IMiriRHITexture>GetOrLoadSizedImageOne image exported at several pixel sizes ("<stem>-<N>.png"): picks the smallest export that still covers the on-screen size, because a 512 px source sampled down to 16 px without mips shimmers and a 16 px one stretched up blurs.
voidSetMediaSourceFactoryProcess-wide clip decoder for VideoPlayer nodes, injected by the host for the same reason the image decoder is: playback lives in Game.
boolHasMediaSourceFactory
std::unique_ptr<IMiriGraphicsMediaSource>CreateMediaSource
voidSetStateSoundHookPlays the sound a style state names when a widget enters that state.
voidPlayStateSound
voidSetMaterialResolver
std::shared_ptr<const Miri::FMiriCustomMaterial>ResolveMaterial
voidNotifyMaterialsChanged
uint64_tGetMaterialGeneration
voidSetRenderTargetResolver
FMiriGraphicsRenderTargetResolveRenderTarget
boolIsKnownType
std::vector<std::string>RegisteredTypes
voidSetActiveThemeProcess-wide theme every build falls back to when neither the screen nor the build context names one.
const FMiriGraphicsTheme&ActiveTheme
Miri::MiriColorResolveColorTokenToken → colour through the active theme, then the default theme.
FMiriGraphicsNodeComposeUserWidgetComposes a referenced widget asset's tree with the overrides an embedding UserWidget node supplies: every exposed variable writes its value (or its default) onto the target node named by the referenced asset.
boolResolveRightToLeftResolves a node's flow_direction ("inherit", "ltr", "rtl") against the parent's.
FMiriGraphicsCanvasSlotMirrorCanvasSlotA canvas slot mirrored about the canvas's vertical centre line, which is what a right-to-left canvas places its children by.
Miri::TSharedPtr<Miri::MWidget>BuildDetachedRowBuilds one ListView row from a template node with the item's data substituted in.

Function details

Build

C++
static FBuildResult Build(const FMiriGraphicsAsset& asset)

Build

C++
static FBuildResult Build(const FMiriGraphicsAsset& asset, const FMiriGraphicsBindingResolver& resolver)

Build

C++
static FBuildResult Build(const FMiriGraphicsAsset& asset, const FBuildContext& context)

ApplyBindingValue

C++
static void ApplyBindingValue(const std::string& property, const FMiriGraphicsBindingValue& value, const Miri::TSharedPtr<Miri::MWidget>& widget)

Writes one resolved binding value onto a live widget. Shared between the build-time application and the screen stack's per-frame binding pump.

FormatBindingNumber

C++
static std::string FormatBindingNumber(double number)

ParseFormatSources

C++
static void ParseFormatSources(const std::string& format, std::vector<std::string>& outSources)

EvaluateBinding

C++
static FMiriGraphicsBindingValue EvaluateBinding(const std::string& source, const std::string& format, const std::string& converter, const std::function<FMiriGraphicsBindingValue(const std::string&)>& resolve)

ResolveBrush

C++
static Miri::CBrush ResolveBrush(const FMiriGraphicsBrushDesc& desc)

A brush description resolved against the active theme: a field naming a token of the matching kind takes it, a colour field next tries colour tokens, and what is left is a literal.

ReadNodeColor

C++
static Miri::MiriColor ReadNodeColor(const FMiriGraphicsNode& node, const std::string& key, const Miri::MiriColor& fallback)

SetImageDecoder

C++
static void SetImageDecoder(FMiriGraphicsImageDecoder decoder)

Forwards to Miri::Mowo::CMiriImageCache, which owns the process-wide image decode hook + GPU texture cache. The cache must be cleared before the Miri bridge/device shuts down.

ClearImageCache

C++
static void ClearImageCache()

GetOrLoadImage

C++
static Miri::Ref<Miri::IMiriRHITexture> GetOrLoadImage(const std::string& path)

GetOrLoadImageAsync

C++
static Miri::Ref<Miri::IMiriRHITexture> GetOrLoadImageAsync(const std::string& path)

The non-blocking twin: returns the texture when it is cached, otherwise queues a decode on the worker and returns null (the caller keeps its placeholder). PumpAsyncImages uploads finished decodes and swaps them into the widgets that asked, once a frame, on the main thread.

PumpAsyncImages

C++
static void PumpAsyncImages()

PendingAsyncImages

C++
static size_t PendingAsyncImages()

GetOrLoadSizedImage

C++
static Miri::Ref<Miri::IMiriRHITexture> GetOrLoadSizedImage(const std::string& stem, const std::vector<int32_t>& exportedSizes, float physicalPixels)

One image exported at several pixel sizes ("<stem>-<N>.png"): picks the smallest export that still covers the on-screen size, because a 512 px source sampled down to 16 px without mips shimmers and a 16 px one stretched up blurs.

SetMediaSourceFactory

C++
static void SetMediaSourceFactory(FMiriGraphicsMediaSourceFactory factory)

Process-wide clip decoder for VideoPlayer nodes, injected by the host for the same reason the image decoder is: playback lives in Game. Null (the default) builds every VideoPlayer as a settings-only node.

HasMediaSourceFactory

C++
static bool HasMediaSourceFactory()

CreateMediaSource

C++
static std::unique_ptr<IMiriGraphicsMediaSource> CreateMediaSource()

SetStateSoundHook

C++
static void SetStateSoundHook(FMiriGraphicsStateSoundHook hook)

Plays the sound a style state names when a widget enters that state. The host installs it (MiriGraphics has no audio dependency); null mutes them.

PlayStateSound

C++
static void PlayStateSound(const std::string& sound)

SetMaterialResolver

C++
static void SetMaterialResolver(FMiriGraphicsMaterialResolver resolver)

ResolveMaterial

C++
static std::shared_ptr<const Miri::FMiriCustomMaterial> ResolveMaterial(const std::string& path)

NotifyMaterialsChanged

C++
static void NotifyMaterialsChanged()

GetMaterialGeneration

C++
static uint64_t GetMaterialGeneration()

SetRenderTargetResolver

C++
static void SetRenderTargetResolver(FMiriGraphicsRenderTargetResolver resolver)

ResolveRenderTarget

C++
static FMiriGraphicsRenderTarget ResolveRenderTarget(const std::string& path)

IsKnownType

C++
static bool IsKnownType(const std::string& type)

RegisteredTypes

C++
static std::vector<std::string> RegisteredTypes()

SetActiveTheme

C++
static void SetActiveTheme(const FMiriGraphicsTheme* theme)

Process-wide theme every build falls back to when neither the screen nor the build context names one. Hosts point this at the project theme; the pointer is borrowed, so the owner must outlive the last build.

ActiveTheme

C++
static const FMiriGraphicsTheme& ActiveTheme()

ResolveColorToken

C++
static Miri::MiriColor ResolveColorToken(const std::string& token, const Miri::MiriColor& fallback)

Token → colour through the active theme, then the default theme. Public because the designer resolves the same tokens for its swatches and its token picker, and the two must never drift apart.

ComposeUserWidget

C++
static FMiriGraphicsNode ComposeUserWidget(const FMiriGraphicsNode& instance, const FMiriGraphicsAsset& referenced)

Composes a referenced widget asset's tree with the overrides an embedding UserWidget node supplies: every exposed variable writes its value (or its default) onto the target node named by the referenced asset.

ResolveRightToLeft

C++
static bool ResolveRightToLeft(const FMiriGraphicsNode& node, bool inherited)

Resolves a node's flow_direction ("inherit", "ltr", "rtl") against the parent's.

MirrorCanvasSlot

C++
static FMiriGraphicsCanvasSlot MirrorCanvasSlot(const FMiriGraphicsCanvasSlot& slot)

A canvas slot mirrored about the canvas's vertical centre line, which is what a right-to-left canvas places its children by.

BuildDetachedRow

C++
static Miri::TSharedPtr<Miri::MWidget> BuildDetachedRow(const FMiriGraphicsNode& templateNode, const MDF::MdfValue& item, uint32_t index, const FBuildContext& context, const std::vector<std::string>* fieldNames = nullptr)

Builds one ListView row from a template node with the item's data substituted in. Runs lazily whenever the virtualized list realizes a row, so it takes a self-contained context copy rather than the live build state.

Generated from MiriGraphics/FMiriGraphicsWidgetFactory.h via mirigraphics.json · Dec 5, 2026Version 1.1.0