Skip to main content

kui_core/
lib.rs

1//! kui-core: the data-driven contract every frontend and backend binds to.
2//!
3//! - Flat per-frame tree ([`tree::Tree`]) built through [`ui::Ui`]
4//! - Clay-style flex solver ([`layout`])
5//! - Session-owned text stack: shaping, wrapping, caching, atlas ([`text`], [`atlas`], [`session`])
6//! - Events as data ([`input`], [`value::Value`]) routed by origin
7//! - Renderer boundary: a flat quad list ([`display::DisplayList`])
8
9pub mod access;
10pub mod anim;
11pub mod atlas;
12pub mod audio;
13pub mod calc;
14pub mod cells;
15pub mod color;
16pub(crate) mod composite;
17/// The scene corpus every binding is checked against. Test infrastructure,
18/// behind the `conformance` feature so no shipped binary carries it.
19#[cfg(feature = "conformance")]
20pub mod conformance;
21pub mod cursor;
22pub mod deco;
23pub mod depart;
24pub mod diag;
25pub mod dialog;
26pub mod display;
27pub mod edit;
28pub mod enter;
29pub mod env;
30pub mod event;
31pub mod fragment;
32pub mod geom;
33pub mod input;
34pub(crate) mod join;
35pub mod key;
36pub mod keyframes;
37pub mod layout;
38pub mod line;
39pub mod menu;
40pub mod message;
41pub mod metrics;
42pub mod resources;
43pub(crate) mod retain;
44pub mod runtime;
45pub mod schema;
46pub mod scroll;
47pub mod select;
48pub mod session;
49pub mod slider;
50pub mod slot;
51pub mod slots;
52pub mod spec;
53pub mod stats;
54/// The headless driver the crate's own tests use. Test infrastructure,
55/// behind the `conformance` feature like the corpus.
56#[cfg(feature = "conformance")]
57pub mod testing;
58pub mod text;
59pub mod theme;
60pub mod tokens;
61pub mod tree;
62pub mod ui;
63pub mod value;
64pub(crate) mod weights;
65pub mod widgets;
66pub mod window;
67
68pub use access::{
69    AccessAction, AccessNode, AccessRequest, AccessRun, AccessTree, Announcement, Live,
70    Orientation, Role, ScrollState, TextPos,
71};
72pub use anim::{Bounce, Easing, MAX_BOUNCE, Repeat, Transition};
73pub use audio::{AudioCommand, AudioSpec, AudioStore, PlayOptions, PlaybackId, Why};
74pub use calc::{Calc, Expr as SizeExpr};
75pub use cells::{Cell, CellGrid, CellStore, CellsId, CursorShape as CellCursor};
76pub use color::Color;
77pub use cursor::CursorShape;
78pub use depart::DepartStore;
79pub use diag::Warning;
80pub use dialog::{FileDialog, FileDialogMode, FileFilter};
81pub use display::{
82    Clip, ClipId, DisplayList, FragmentDraw, FragmentImage, NO_CLIP, NO_CLIP_ID, Quad, QuadKind,
83};
84pub use edit::{EditOptions, MAX_UNDECLARED_EDITS};
85pub use enter::Enter;
86pub use env::{Appearance, Assistive, AudioDevice, AudioEnv, Env, Locale, MotionPref, SystemEnv};
87pub use event::{
88    ButtonEvent, ButtonPhase, Drag, DragPhase, Hover, HoverBy, HoverPhase, Layout, Scroll,
89    TextInput,
90};
91pub use fragment::{FragmentDrawId, FragmentList, FragmentRef};
92pub use geom::{Edges, Rect, Size, Vec2};
93pub use input::ScrollAxis;
94pub use input::{
95    Buttons, ClipboardMarks, EditKey, InputEvent, KeyCode, KeyLocation, KeyLocks, KeyMods,
96    KeyPhase, KeyPress, LayoutScript, Mods, MouseButton, OptionAsAlt, UiEvent,
97};
98pub use key::Key;
99pub use keyframes::Keyframe;
100/// `#[derive(Message)]` (backlog C50), with the `derive` feature; `kui-native`
101/// turns it on. From a crate that depends on kui-core alone, say
102/// `#[message(crate = "kui_core")]` — the generated code reaches `::kui`
103/// unless told otherwise.
104#[cfg(feature = "derive")]
105pub use kui_derive::Message;
106pub use line::{LineId, LineStore, Stroke};
107pub use menu::{Accel, BarMenu, Menu, MenuAction, MenuBar, MenuItem, MenuRole};
108pub use message::{MessageError, MessageField};
109pub use metrics::Metrics;
110pub use resources::{
111    FontId, FragmentId, ImageBacking, ImageFit, ImageId, ImageOpts, Resources, Sampling, SessionId,
112    SoundId, SystemFont,
113};
114pub use runtime::cause::{FrameCause, FrameHolder, FrameRequest, OwedBy};
115pub use runtime::devtools;
116pub use runtime::devtools::Dock as DevtoolsDock;
117pub use runtime::inspect::{NodeInfo, NodeKind};
118pub use runtime::{Content, Core, Extension, Owed};
119pub use scroll::{MAX_UNDECLARED_SCROLLS, ScrollGeometry};
120pub use select::{CellEnd, CellSelection, CopyRequest, Endpoint, Grain, RangeEnd, Selection};
121pub use session::{Session, SharedAudio, SharedResources};
122pub use slot::{
123    ANY_SLOT, Extensions, Fill, NAMESPACE_SEPARATOR, ROOT_SLOT, Slot, full_name, split_name,
124};
125pub use spec::{
126    Align, Bound, Dir, FLOAT_PRESETS, FloatAnchor, FloatConfig, FontFamily, FontFeatures, Min,
127    NodeSpec, OVERFLOW_CLIP, OVERFLOW_SCROLL_X, OVERFLOW_SCROLL_Y, Overscroll, PadShorthand,
128    ScrollAxes, Scrollbar, ScrollbarMode, Shadow, Sizing, TextStyle, TextWrap, UnderlineStyle,
129    Vec2Offset, corner,
130};
131pub use stats::{FrameSample, FrameStats};
132pub use text::{DEFAULT_TEXT_CACHE_BYTES, LONG_LINE_BYTES, Span, TextHit, TextMetrics};
133pub use theme::{Theme, ThemeSource};
134pub use tokens::{
135    ColorOp, ColorToken, NameRefs, OpRange, TokenError, TokenKind, TokenLookup, TokenRef, Tokens,
136    Unresolved,
137};
138pub use tree::OriginId;
139pub use ui::Ui;
140pub use value::{Handles, Value};
141pub use window::{
142    DismissReason, WindowButton, WindowCommand, WindowConfig, WindowEnv, WindowId, WindowKind,
143    WindowRole,
144};