Skip to main content

Module part_paint

Module part_paint 

Expand description

Part painters: the host side of the theme SDK (tilo_theme_sdk, docs/architecture/theming.md, “Part painters”).

A theme’s painter set (PainterSet, a PartPainter) draws parts; this module is everything around it that the toolkit owns:

A set paints what it chooses to; a part it returns None for is drawn by the toolkit’s own painters, so a theme draws only the parts it changes.

Modules§

builtin
The painter sets the toolkit ships: Default, Glass and Block (docs/architecture/theming.md, “Part painters”). They implement the same PartPainter a theme’s own set does and draw through the same host; a theme document names them as it would any other set.
wasm
Painter sets loaded from wasm: a theme’s own painters, run in the UI host with nothing to reach (docs/architecture/theming.md, “Part painters”).

Structs§

Lens
How the backdrop is bent and filtered where a part shows it.
Moment
Where a part is in its motion: the states it is moving between and how far it has come.
Painted
A part as the toolkit drew it.
PaintedPart
A part as its painter drew it.
PainterSet
A painter set the toolkit draws with: its name, as a theme document names it, and the painter.
Param
A named number from the theme document, for the painter set that reads it (a glass set’s refraction, a dither set’s levels).
ParamSpec
A parameter a painter set takes from the theme document: its name, the value it has when a document leaves it out (None: a document must state it), the band a document may state it in, and the band the theme is built at.
PartImage
A small picture a painter tiles a fill with: an ordered-dither threshold pattern, a hatch, a pixel texture. Straight-alpha RGBA8, rows top to bottom.
PartMotion
One part’s motion between states, run on the toolkit’s clock.
PartScene
A part, drawn: operations in paint order.
PartState
Where a part is: the states it is in now, and the ones it is leaving (equal once a transition settled).
PartTokens
The theme’s values for one part, resolved for its role and state: the colours already carry the theme’s contrast guarantees, so a painter that lays ink on fill is legible.
ShaderSource
A surface shader as it travels from a theme document to the renderer: WGSL and the static time it is given. It is checked when the theme is read, before it reaches here.
Sides
The sides of a part that stand on the display’s own edge.
States
The states a part is in at once.
Stop
A colour stop of a gradient.

Enums§

Brush
What a path is filled or stroked with.
Easing
A curve for Transition::Eased.
Op
One drawing operation, in part coordinates (origin at the part’s top left, logical pixels).
Part
A part a ui component declares. A theme reaches parts, never an app’s view tree.
Sampling
How a backdrop sample is filtered.
Transition
How a part moves from one set of states to another.

Traits§

PartPainter
A painter set: how a theme draws every part.

Functions§

cached_parts
How many settled parts this thread holds drawn (for tests and the performance overlay).
hit_contains
Whether point (in the coordinates hit is in) lies in the painted shape hit, by the non-zero rule the shape was filled with.
paint_part
Draw part of set in rect (in the coordinates transform maps into scene’s), at moment of its motion, with tokens. None when the set leaves the part to the toolkit’s own painters, which the caller then draws.
painter_set
The set a document calls name: a built-in one, or one registered.
part_tokens
The values a part of role is drawn with under theme: fill, ink and edge as its role and state resolved them, ground what it stands on, and the parameters the role’s finish states. No backdrop: the toolkit says where a part shows one.
register_painter_set
Make set one a theme document can name. A set registered under a name already taken replaces it: a theme’s author installing a fixed version. The built-in sets’ names are the toolkit’s: false, and nothing registered, for a set that claims one.