Skip to main content

Crate fenestra_shell

Crate fenestra_shell 

Source
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§

pub use vello;
pub use vello::wgpu;
pub use winit;

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.
EventResponse
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.
ScenarioError
A failed step (or a parse failure, step: None), with enough context to fix the scenario without re-running it.
ScenarioReport
What a successful run did.
WindowOptions
Options for the application window.

Enums§

ShellError
Errors from the windowed or headless runners.
SyntheticEvent
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-provided Fonts, so design languages can register Display/Serif faces (Fonts::register) and render through them. The requested size is clamped like render_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 like render_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). Calls App::init with a fenestra_core::Proxy before 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 shot steps land in shots_dir as <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 prefer run_static (or the M4 App runner).
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 f with the process-wide embedded-only font system used by all headless rendering.
with_headless
Runs f with a process-wide shared Headless renderer. Creating a renderer compiles vello’s shaders, so tests share one.