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
//! Denise — a direct-rendering UI toolkit for systems without a desktop environment.
//!
//! This crate is the platform-agnostic core. It owns geometry, colour, the pixel
//! buffer contract, input events and damage tracking. It contains no platform code
//! and no `unsafe`.
//!
//! Backends implement two traits:
//!
//! - [`Surface`] — hands out a [`Frame`] to draw into and presents damaged regions.
//! - [`InputSource`] — drains platform input into [`InputEvent`]s.
//!
//! # Frame lifecycle
//!
//! ```no_run
//! # use denise::{Surface, DamageTracker, Rect, MAX_DAMAGE_RECTS};
//! # fn demo(surface: &mut impl Surface, tracker: &mut DamageTracker) -> Result<(), denise::SurfaceError> {
//! let mut frame = surface.acquire()?;
//! // The buffer we just got back may be several frames old. Repaint everything
//! // that has been damaged since it was last current, not just this frame's damage.
//! let damage: &[Rect] = tracker.resolve(frame.age());
//! // ... draw into `frame`, clipped to `damage` ...
//! drop(frame);
//! surface.present(damage)?;
//! tracker.end_frame();
//! # Ok(())
//! # }
//! ```
//!
//! Getting that sequence wrong is the classic double-buffering bug: repaint only the
//! current frame's damage and every second frame shows stale content.
//!
//! # Status
//!
//! M0. The abstraction exists and is proven against a desktop backend; the scene
//! graph, component model and hardware backends are not here yet. See the README.
extern crate alloc;
pub use Color;
pub use CursorPlane;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;