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
//! Denise's scene graph, widgets and compositor.
//!
//! A retained tree of widgets in a generational arena, stacked into scenes, drawn
//! through [`denise_render`] into a [`denise::Surface`]. This is the layer that
//! turns "a rasteriser and a display" into "a user interface".
//!
//! ```no_run
//! # use denise::{Rect, Size, theme};
//! # use denise_ui::{Ui, widgets::Panel};
//! # fn demo(surface: &mut impl denise::Surface) -> Result<(), denise::SurfaceError> {
//! #[derive(Clone, Debug)]
//! enum Msg { Ok }
//!
//! let mut ui: Ui<Msg> = Ui::new(Size::new(1920, 1080), theme::DARK);
//! let root = ui.root();
//! ui.add(root, Panel::default(), Rect::new(40, 40, 400, 240));
//!
//! loop {
//! // ui.handle(&events);
//! ui.render(surface)?; // draws nothing at all when nothing changed
//! for message in ui.drain_messages() {
//! match message { Msg::Ok => {} }
//! }
//! # break;
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Why a separate crate
//!
//! [`denise`] is the platform-agnostic contract — geometry, colour, the pixel
//! buffer, input, damage, theming — and [`denise_render`] is the rasteriser that
//! depends on it. Widgets need both, so they cannot live in either without a
//! dependency cycle. Keeping them here also means a signage application that draws
//! its own scene links no arena, no tree and no widget code at all.
//!
//! # What is not here
//!
//! No layout engine. Nodes are positioned with explicit rectangles relative to
//! their parent, which is what a fixed-resolution panel actually wants; a
//! constraint solver can be added over this without changing anything below it.
extern crate alloc;
pub use ;
pub use NodeId;
pub use Ui;
pub use ;
pub use ;
// Re-exported so an application names one crate rather than three to style a
// label, and so `FontId(0)` means the same thing everywhere.
pub use ;