pub struct BuiltinEditor<P: Params> { /* private fields */ }Expand description
Built-in editor that renders parameter widgets to a pixel buffer.
Uses the CPU backend (tiny-skia) for software rasterization. When
open() is called, creates a baseview window and blits pixels via wgpu.
Implementations§
Source§impl<P: Params + 'static> BuiltinEditor<P>
impl<P: Params + 'static> BuiltinEditor<P>
Sourcepub fn request_repaint(&self)
pub fn request_repaint(&self)
Request a repaint on the next idle tick. Call this if plugin
code mutates display state outside the normal param or
state_changed pathways (uncommon). User interaction and
host automation already flag themselves dirty automatically.
pub fn new(params: Arc<P>, layout: PluginLayout) -> Self
pub fn new_with_layout(params: Arc<P>, layout: Layout) -> Self
pub fn new_grid(params: Arc<P>, layout: GridLayout) -> Self
pub fn with_theme(self, theme: Theme) -> Self
Sourcepub fn render(&mut self)
pub fn render(&mut self)
Render the full UI to the internal CPU pixel buffer.
§Panics
Panics if the lazy CpuBackend::new allocation fails (out of
memory or zero dimensions). The backend is allocated on first
render - subsequent calls reuse it.
Sourcepub fn dispatch_events(&mut self, events: &[InputEvent])
pub fn dispatch_events(&mut self, events: &[InputEvent])
Feed a batch of input events through interaction::dispatch and
apply the resulting param edits. Flags a repaint when hover,
dropdown-open state, or any param moved.
Typically callers build the events by running each baseview
event through interaction::BaseviewTranslator and batching
the non-None results.
Sourcepub fn pixel_data(&self) -> Option<&[u8]>
pub fn pixel_data(&self) -> Option<&[u8]>
Get the raw pixel data after rendering (RGBA premultiplied).
Sourcepub fn has_context(&self) -> bool
pub fn has_context(&self) -> bool
Whether the editor has an active context.
Sourcepub fn take_context(&mut self) -> Option<PluginContext>
pub fn take_context(&mut self) -> Option<PluginContext>
Take the editor context, leaving None in its place.
Used by hot-reload to preserve the context when swapping editors.
Sourcepub fn set_context(&mut self, context: PluginContext)
pub fn set_context(&mut self, context: PluginContext)
Set the editor context (host callbacks) without opening the CPU view.
Sourcepub fn render_to(&mut self, backend: &mut dyn RenderBackend)
pub fn render_to(&mut self, backend: &mut dyn RenderBackend)
Render all widgets to an external RenderBackend.
Used by truce-gpu to draw through the GPU backend instead of
the internal CPU backend.