1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Servo-replacement runtime for Tauri.
//!
//! v0.1 shipped the headless pipeline + script driver; v0.2 added a
//! tiny-skia rasterizer ([`render_to_pixels`]); v0.3 added cosmic-text
//! shaping + swash glyph raster so `FillText` commands render real
//! text; v0.4 added a winit + softbuffer window via [`run_window`] and
//! a runnable demo binary; v0.5 adds an IPC bridge ([`HostCommands`])
//! plus DOM-mutation back-propagation via [`run_script_with_backprop`]
//! so scripted mutations re-render in the window.
//!
//! # Example
//!
//! ```
//! # fn main() -> Result<(), tauri_runtime_servocat::Error> {
//! use tauri_runtime_servocat::{Viewport, render, render_to_pixels, run_script};
//!
//! let frame = render(
//! "<html><body><p>hello</p></body></html>",
//! "p { background-color: red; padding: 8px; }",
//! Viewport::new(800, 600),
//! )?;
//! assert!(!frame.display_list().is_empty());
//!
//! let pixels = render_to_pixels(&frame, 800, 600);
//! assert_eq!(pixels.rgba().len(), 800 * 600 * 4);
//!
//! let scripted = run_script(
//! "<html><body><p id='g'>hi</p></body></html>",
//! "",
//! "document.getElementById('g').textContent",
//! Viewport::new(800, 600),
//! )?;
//! assert_eq!(format!("{}", scripted.script_value()), "\"hi\"");
//! # Ok(())
//! # }
//! ```
pub use Error;
pub use Frame;
pub use HostCommands;
pub use Viewport;
pub use render;
pub use ;
pub use ;
pub use TextRenderer;
pub use run_window;