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
//! Iced GUI backend for truce plugins.
//!
//! An alternative GUI backend that replaces the built-in tiny-skia/wgpu
//! renderer with [iced](https://github.com/iced-rs/iced), giving plugin
//! authors access to a full retained-mode widget toolkit.
//!
//! # Usage Modes
//!
//! ## Auto mode - zero custom code
//!
//! ```rust,ignore
//! fn editor(&mut self) -> Option<Box<dyn Editor>> {
//! let layout = self.layout();
//! Some(Box::new(IcedEditor::from_layout(self.params.clone(), layout)))
//! }
//! ```
//!
//! ## Custom mode - full iced control
//!
//! ```rust,ignore
//! fn editor(&mut self) -> Option<Box<dyn Editor>> {
//! Some(Box::new(IcedEditor::<_, MyIcedUi>::new(
//! self.params.clone(),
//! (600, 400),
//! )))
//! }
//! ```
// Facade re-assembling the `iced` umbrella's API from its sub-crates, so
// the crate never depends on `iced_winit` (which can't build for iOS).
// Public so plugin crates can reach iced types without the umbrella too.
// Surface-agnostic iced render pipeline (`IcedRuntime`/`RenderState`/
// `IcedProgram`) shared by the desktop and iOS editors.
// Re-export primary types for convenience. The plugin-facing traits live
// in the shared `runtime` module (all platforms); only the windowing
// `IcedEditor` differs per platform.
pub use ;
pub use IcedEditor;
pub use IcedEditor;
pub use ParamCache;
pub use ;
// Re-export `PluginContext` so plugin authors can use it without a direct
// truce-core dependency.
pub use PluginContext;
// Re-export widget helper functions.
pub use ;
use crateElement;
use Debug;
/// Convert any truce-iced widget into an `Element` with `.el()`.
///
/// Avoids the verbose `Into::<Element<'a, Message<M>>>::into(...)` pattern.
///
/// ```ignore
/// Row::new()
/// .push(knob(P::Gain, params).label("Gain").el())
/// .push(knob(P::Pan, params).label("Pan").el())
/// ```