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
//! # Cotis
//!
//! Cotis is the core of a modular and expandable Rust library for building native user interfaces.
//!
//! The crate is intentionally split into small pieces that can be swapped or extended:
//!
//! - layout interfaces and frame-building traits in [`layout`]
//! - renderer interfaces and drawing traits in [`renders`]
//! - conversion between layout output and renderer commands in [`pipes`]
//! - application orchestration in [`cotis_app`]
//! - element construction helpers in [`element_configuring`]
//! - optional launch hooks and utilities in [`launch`] and [`utils`]
//!
//! In other words, [`layout`] and [`renders`] define the integration traits
//! that concrete layout and renderer crates implement to plug into Cotis.
//!
//! A frame is typically computed in this order:
//! 1. A layout manager prepares for a frame.
//! 2. UI code builds the element tree through the configurator API.
//! 3. The layout manager produces layout output items.
//! 4. A pipe transforms those items into renderer commands.
//! 5. A renderer draws the command stream.
//!
//! # Quick start
//!
//! The common entry point is [`cotis_app::CotisApp`], which connects a layout manager,
//! renderer, and a [`pipes::LayoutRenderPipe`]. When layout output already matches
//! renderer commands, pass [`()`] as the identity pipe (see [`pipes`]).
//!
//! ```rust,ignore
//! use cotis::cotis_app::{CotisApp, RenderApp};
//!
//! # // Renderer/manager types depend on your integration crate.
//! # // Use `()` when no layout-to-render conversion is needed.
//! let mut app = CotisApp::new(renderer, manager, ());
//! app.compute_frame(|root| {
//! root.new_element().set_config(config);
//! });
//! ```
//!
//! Use [`cotis_app::AsyncRenderApp`] when your renderer performs async drawing.
/// Application orchestration and frame computation entry points.
/// Launch hooks for platform-controlled startup and `cotis-macros` entry attributes.
/// Renderer-side traits for synchronous and asynchronous frame drawing.
/// Pipes that transform layout output into renderer command streams.
/// Layout-side traits for frame construction, element configuration types, and layout output.
/// Element configuration primitives framework used while building UI trees.
/// Shared utility types (ownership wrappers, element identifiers, serialization helpers).