cotis_defaults/lib.rs
1//! Default data types shared across Cotis integrations.
2//!
3//! This crate provides concrete element config structs and render command structs
4//! used by layout managers and renderers in the Cotis ecosystem.
5//!
6//! Typical data flow:
7//! 1. Build an [`element_configs::ElementConfig`].
8//! 2. The layout crate consumes that config and produces layout output.
9//! 3. A pipe maps layout output to [`render_commands`] values.
10//! 4. A renderer draws those commands.
11//!
12//! `cotis-defaults` depends on `cotis-utils` for shared primitives such as
13//! `BoundingBox`, `Vector2`, and renderer context traits.
14//!
15//! # Features
16//!
17//! - `serialization`: enables serde support for configs/commands and also enables
18//! `cotis/serialization` and `cotis-utils/serialization`.
19//! - `complex_color`: enables layered/gradient color support through
20//! [`colors::ColorLayer`] for backgrounds in style and commands.
21//! - `complex_colored_text`: extends `complex_color` to text color fields.
22//! - `child_wrapping`: adds `LayoutStyle::child_wrapping` (currently experimental;
23//! not fully wired in all layout integrations).
24//!
25//! # Text and fonts (evolving API)
26//!
27//! Text config, font IDs, and measuring wiring are functional today but planned
28//! for refactoring. Treat text/font/measuring integration points as subject to
29//! change across minor versions until that refactor lands.
30//!
31//! # Quick start
32//!
33//! ```rust,ignore
34//! use cotis_defaults::element_configs::ElementConfig;
35//! use cotis_defaults::element_configs::style::sizing::DoubleAxisSizing;
36//!
37//! // Usually consumed by cotis-layout and transformed into render commands by a pipe.
38//! let config: ElementConfig<'_, DoubleAxisSizing, (), (), ()> = ElementConfig::default();
39//! ```
40/// Base color types, gradients and layered paints.
41pub mod colors;
42/// Element configuration structs consumed by layout integrations.
43pub mod element_configs;
44/// Path-based generic image wrappers used by image configs.
45pub mod generic_image;
46/// Render command structs consumed by renderer integrations.
47pub mod render_commands;