Expand description
OS glue for fenestra: the winit + wgpu windowed runner and the headless
renderer. Everything that touches a display server lives here;
fenestra-core and fenestra-kit stay windowless.
Re-exports§
Modules§
- testing
- PNG golden testing: tolerance-based image comparison with an update mode, used by every visual test in the workspace.
Structs§
- Embedded
- A fenestra app embedded in a caller-owned wgpu world. See the module docs for the contract.
- Event
Response - What the embedded UI did with one window event.
- Harness
- A headless app under test. See the module docs for the model.
- Headless
- A reusable offscreen renderer. Creating one compiles vello’s shaders, so tests should create it once and render many scenes through it.
- OsClipboard
- Lazy arboard wrapper; failures (no display server) degrade to a no-op.
- Scenario
Error - A failed step (or a parse failure,
step: None), with enough context to fix the scenario without re-running it. - Scenario
Report - What a successful run did.
- Window
Options - Options for the application window.
Enums§
- Shell
Error - Errors from the windowed or headless runners.
- Synthetic
Event - A scripted input event for
render_app.
Functions§
- render_
app - Drives an app headlessly: dispatches each event against the current view, applies the emitted messages, then renders one settle frame. Deterministic: scale 1.0, reduced motion, embedded fonts only. The requested size is clamped to the device-supported range (at least 1x1, at most the maximum texture dimension).
- render_
element - Renders an element tree headlessly at scale factor 1.0 over the theme background, using only the embedded fonts for determinism. This is fenestra’s product thesis: agents render what they build and look at it.
- render_
element_ with - Like
render_element, but with caller-providedFonts, so design languages can register Display/Serif faces (Fonts::register) and render through them. The requested size is clamped likerender_element’s. - render_
element_ with_ state - Like
render_element, but with caller-provided retained state, so tests can render scrolled (and later focused/hovered) configurations. The requested size is clamped likerender_element’s. - run_app
- Runs an
App: the full Elm-shaped loop with hit testing, hover/active/ focus, keyboard navigation, message dispatch, and event-driven repaint (animation frames only while something animates). CallsApp::initwith afenestra_core::Proxybefore the first frame; proxied messages wake the loop and repaint. Blocks until the window closes. - run_
scenario - Runs a JSON scenario against the harness. Screenshots from
shotsteps land inshots_diras<name>.png. - run_
scene - Opens a window and repaints via
paint(scene, logical_w, logical_h, bg)on every redraw. Blocks until the window closes. Low-level escape hatch; element views should preferrun_static(or the M4Apprunner). - run_
static - Opens a window showing a message-free element view. The view is rebuilt
on every redraw; scroll state persists in a
FrameState. Blocks until the window closes. - with_
fonts - Runs
fwith the process-wide embedded-only font system used by all headless rendering. - with_
headless - Runs
fwith a process-wide sharedHeadlessrenderer. Creating a renderer compiles vello’s shaders, so tests share one.