plushie_renderer/lib.rs
1//! # plushie-renderer
2//!
3//! Native GUI renderer binary. Three execution modes:
4//!
5//! - **Windowed (default):** `plushie-renderer` - full iced rendering
6//! with real windows and GPU. Production mode. Reports
7//! `"mode": "windowed"`.
8//! - **Headless:** `plushie-renderer --headless` - no display server.
9//! Real rendering via tiny-skia with persistent widget state.
10//! Accurate screenshots after interactions. For CI with visual
11//! verification.
12//! - **Mock:** `plushie-renderer --mock` - no rendering. Core + wire
13//! protocol only. Stub screenshots. For fast protocol-level testing
14//! from any language.
15//!
16//! All modes handle scripting messages (Query, Interact, TreeHash,
17//! Screenshot, Reset) for programmatic inspection and interaction.
18//!
19//! Wire codec auto-detection: the first byte of stdin determines the format
20//! (`{` = JSON, anything else = MessagePack). Override with `--json` or
21//! `--msgpack`.
22
23mod headless;
24mod output;
25mod renderer;
26mod startup;
27pub(crate) mod transport;
28
29/// Entry point for the plushie renderer.
30///
31/// Widget packages create a `PlushieAppBuilder`, register their widgets,
32/// and pass it here. The default `main.rs` simply passes an empty builder.
33pub fn run(builder: plushie_widget_sdk::app::PlushieAppBuilder) -> iced::Result {
34 renderer::run(builder)
35}