pub struct Harness<P: UiPlugin> { /* private fields */ }Implementations§
Source§impl<P: UiPlugin> Harness<P>
impl<P: UiPlugin> Harness<P>
Sourcepub fn activate(host: MockHost, config: &str) -> Self
pub fn activate(host: MockHost, config: &str) -> Self
Installs host and activates the plugin with config.
Sourcepub fn resize(&mut self, surface: &str, geometry: Geometry)
pub fn resize(&mut self, surface: &str, geometry: Geometry)
Lays a surface out at geometry and delivers the resize event.
Sourcepub fn frame(
&mut self,
now_ms: u64,
interval_ms: u32,
power: Power,
) -> Option<u64>
pub fn frame( &mut self, now_ms: u64, interval_ms: u32, power: Power, ) -> Option<u64>
Calls frame with the paced interval and power state a viewer
passes; returns when the plugin wants the next one.
pub fn event(&mut self, event: Event)
Sourcepub fn show(&mut self, surface: &str, visible: bool)
pub fn show(&mut self, surface: &str, visible: bool)
Shows or hides a surface, as the viewer does when it places it.
Sourcepub fn set_capabilities(&mut self, capabilities: Capabilities)
pub fn set_capabilities(&mut self, capabilities: Capabilities)
Changes what the viewer can show and tells the plugin.
Sourcepub fn set_reduced_motion(&mut self, reduced: bool)
pub fn set_reduced_motion(&mut self, reduced: bool)
Turns the viewer’s reduce-motion setting on or off and tells the
plugin, as the viewer does (Event::ThemeChanged).
Sourcepub fn set_model(&mut self, surface: &str, model: Model)
pub fn set_model(&mut self, surface: &str, model: Model)
Switches a multi-model surface to model, as the viewer does when
its graphics support changes.
Sourcepub fn pointer(&mut self, surface: &str, kind: PointerKind, x: u32, y: u32)
pub fn pointer(&mut self, surface: &str, kind: PointerKind, x: u32, y: u32)
A pointer event at (x, y) in the surface’s units.
Sourcepub fn link(&mut self, url: &str, pane: Option<&str>, machine: Option<&str>)
pub fn link(&mut self, url: &str, pane: Option<&str>, machine: Option<&str>)
A link clicked in a pane, as a plugin with links.handle hears it.
Sourcepub fn answer_calls(&mut self) -> usize
pub fn answer_calls(&mut self) -> usize
Answers every call-async the plugin made so far from
MockHost::call_answers, delivering one
Event::CallResult each, in order. Returns how many.
Sourcepub fn take_frame_request(&mut self) -> Option<u64>
pub fn take_frame_request(&mut self) -> Option<u64>
The frame the plugin asked for from an event, and clears it.