Skip to main content

Crate truce_gui_types

Crate truce_gui_types 

Source
Expand description

Lightweight GUI types for truce. No rasterization, no windowing.

truce-gui-types carries the trait + data surface that GUI backends (the built-in truce-gui::BuiltinEditor, plus truce-egui, truce-iced, truce-slint) build on. Crates that only need to describe layouts and react to platform-translated input events depend on this crate; the heavy machinery (tiny-skia, baseview, truce-font, fontdue) stays in truce-gui.

The split exists so truce-plugin (the user-facing PluginLogic trait crate) can name GridLayout / RenderBackend / WidgetRegion without pulling in a software rasterizer + windowing toolkit. Plugin authors who supply a custom editor (egui, iced, slint, raw window handle) end up transitively depending only on truce-gui-types instead of the full truce-gui.

Re-exports§

pub use render::ImageId;
pub use render::RenderBackend;
pub use snapshot::ParamSnapshot;
pub use theme::Theme;

Modules§

interaction
Mouse interaction for GUI widgets.
layout
Simple layout helpers for positioning widgets.
macros
render
Render backend trait for abstracting over CPU and GPU rendering.
snapshot
Read-only view of parameter state consumed by the pure-library rendering and interaction functions (widgets::draw, interaction::dispatch).
theme
widgets
Audio plugin UI widgets: knobs, sliders, toggles, labels, headers.

Macros§

grid
Declarative grid layout DSL for plugin GUIs.
layout
Declarative layout DSL for plugin GUIs.

Functions§

to_physical_px
Convert a logical extent (in points) to physical pixels.