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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! Built-in GPU-free GUI for truce plugins (heavyweight runtime).
//!
//! Uses a [`truce_gui_types::RenderBackend`] trait to abstract over
//! rendering implementations. The default [`backend_cpu::CpuBackend`]
//! uses tiny-skia for software rasterization. The non-runtime data
//! types (layout, widget regions, interaction state, theme, render
//! trait, plugin-logic trait) live in `truce-gui-types` and
//! `truce-plugin`; this crate re-exports them so existing
//! `truce_gui::...` paths keep working.
// Widget-drawing helpers, `RenderBackend` trait methods, and interaction
// dispatch all take many independent geometry / state / theme arguments.
// The long signatures are intentional; bundling them into builder
// structs would obscure call sites without simplifying any single
// call.
// baseview-bound editor is macOS / Windows / Linux only. iOS
// embeds the editor in a UIView managed by the AUv3 view
// controller - see [`editor_ios`].
pub use editor_ios as editor;
// Re-export the lightweight data + trait surface from `truce-gui-types`
// so old `truce_gui::layout::*` / `truce_gui::widgets::*` /
// `truce_gui::theme::*` paths continue to resolve. New code can import
// directly from `truce_gui_types`.
pub use ios;
pub use ;
pub use ;
// Re-export plugin-logic traits from `truce-plugin` for the same
// backward-compat reason.
pub use ;
pub use __plugin_logic_deps;
pub use BuiltinEditor;
pub use ;
/// Get the display scale factor used to size the next editor.
///
/// Screenshot rendering pins this to a deterministic value via
/// [`truce_core::screenshot::override_scale`] (default 2.0) so a
/// reference PNG baked on one host renders at the same physical
/// dimensions on any other. Outside screenshot rendering the
/// override is unset and we return the platform's main-screen DPI
/// query (Retina = 2.0, normal = 1.0).
// ---------------------------------------------------------------------------
// tiny-skia conversions for the light `Color` type
//
// `truce-gui-types::theme::Color` doesn't pull in `tiny-skia` (the
// whole point of the split). The conversion helpers live here so
// the CPU backend and screenshot pipeline can call them without
// reimplementing the f32→u8 saturation logic at each site.
// ---------------------------------------------------------------------------
/// Extension trait giving [`truce_gui_types::theme::Color`] the
/// `to_skia` / `to_premultiplied` methods that used to live on the
/// inherent impl, now relocated here so `truce-gui-types` stays
/// rasterizer-free.