1use std::fmt;
6
7#[cfg(not(target_arch = "wasm32"))]
11mod access;
12#[cfg(not(target_arch = "wasm32"))]
13mod blur;
14#[cfg(not(target_arch = "wasm32"))]
15mod element_render;
16#[cfg(not(target_arch = "wasm32"))]
17mod embed;
18#[cfg(not(target_arch = "wasm32"))]
19mod harness;
20#[cfg(not(target_arch = "wasm32"))]
21mod headless;
22#[cfg(not(target_arch = "wasm32"))]
23mod multi_pass;
24#[cfg(not(target_arch = "wasm32"))]
25mod os_clipboard;
26#[cfg(not(target_arch = "wasm32"))]
27mod scenario;
28#[cfg(not(target_arch = "wasm32"))]
29mod synthetic;
30#[cfg(not(target_arch = "wasm32"))]
31pub mod testing;
32mod window;
33
34#[cfg(not(target_arch = "wasm32"))]
35pub use blur::{apply_element_filter, box_blur_rgba8};
36#[cfg(not(target_arch = "wasm32"))]
37pub use element_render::{
38 render_element, render_element_with, render_element_with_state, with_fonts, with_headless,
39};
40#[cfg(not(target_arch = "wasm32"))]
41pub use embed::{Embedded, EventResponse};
42#[cfg(not(target_arch = "wasm32"))]
43pub use harness::Harness;
44#[cfg(not(target_arch = "wasm32"))]
45pub use headless::Headless;
46#[cfg(not(target_arch = "wasm32"))]
47pub use multi_pass::process_specs;
48#[cfg(not(target_arch = "wasm32"))]
49pub use os_clipboard::OsClipboard;
50#[cfg(not(target_arch = "wasm32"))]
51pub use scenario::{ScenarioError, ScenarioReport, run_scenario};
52#[cfg(not(target_arch = "wasm32"))]
53pub use synthetic::{SyntheticEvent, render_app};
54pub use window::{WindowOptions, run_app};
55
56pub use vello;
59pub use vello::wgpu;
60#[cfg(not(target_arch = "wasm32"))]
61pub use window::{run_scene, run_static};
62pub use winit;
63
64#[derive(Debug)]
66pub enum ShellError {
67 NoDevice,
69 Vello(vello::Error),
71 EventLoop(winit::error::EventLoopError),
73 Readback,
75}
76
77impl fmt::Display for ShellError {
78 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
79 match self {
80 Self::NoDevice => write!(f, "no compute-capable wgpu adapter found"),
81 Self::Vello(e) => write!(f, "vello renderer error: {e}"),
82 Self::EventLoop(e) => write!(f, "winit event loop error: {e}"),
83 Self::Readback => write!(f, "GPU readback failed"),
84 }
85 }
86}
87
88impl std::error::Error for ShellError {}