1use cranpose_core::{location_key, MemoryApplier};
4pub use cranpose_core::{Composition, Key};
5pub use cranpose_macros::composable;
6
7mod cursor_animation;
8mod debug;
9mod draw;
10pub mod fling_animation;
11mod focus_dispatch;
12mod key_event;
13pub mod layout;
14mod modifier;
15mod modifier_nodes;
16mod pointer_dispatch;
17mod primitives;
18mod render_state;
19mod renderer;
20pub mod scroll;
21mod subcompose_layout;
22pub mod text;
23pub mod text_field_focus;
24mod text_field_handler;
25mod text_field_input;
26mod text_field_modifier_node;
27pub mod text_layout_result;
28mod text_modifier_node;
29pub mod widgets;
30mod word_boundaries;
31
32pub use text_field_focus::has_focused_field;
34pub use cursor_animation::{
36 is_cursor_visible, next_cursor_blink_time, reset_cursor_blink, start_cursor_blink,
37 stop_cursor_blink, tick_cursor_blink,
38};
39
40pub use cranpose_ui_graphics::{BlurredEdgeTreatment, ColorFilter, Dp, ImageBitmap, ImageSampling};
41pub use cranpose_ui_layout::IntrinsicSize;
42pub use draw::{execute_draw_commands, DrawCacheBuilder, DrawCommand};
43pub use focus_dispatch::{
44 active_focus_target, clear_focus_invalidations, has_pending_focus_invalidations,
45 process_focus_invalidations, schedule_focus_invalidation, set_active_focus_target,
46};
47pub use cranpose_foundation::nodes::input::focus::FocusManager;
49pub use layout::{
50 build_layout_tree_from_applier, build_semantics_tree_from_applier,
51 build_semantics_tree_from_layout_tree,
52 core::{
53 Alignment, Arrangement, HorizontalAlignment, LinearArrangement, Measurable, Placeable,
54 VerticalAlignment,
55 },
56 measure_layout, measure_layout_with_options, tree_needs_layout, tree_needs_semantics,
57 LayoutAllocationDebugStats, LayoutBox, LayoutEngine, LayoutMeasurements, LayoutNodeData,
58 LayoutNodeKind, LayoutTree, MeasureLayoutOptions, SemanticsAction, SemanticsCallback,
59 SemanticsNode, SemanticsRole, SemanticsTree,
60};
61pub use modifier::{
62 collect_modifier_slices, collect_semantics_from_modifier, collect_slices_from_modifier,
63 BlendMode, Brush, Color, CompositingStrategy, CornerRadii, DpOffset, EdgeInsets,
64 FocusDirection, FocusRequester, GlassMaterial, GraphicsLayer, LayerShape, Modifier,
65 ModifierNodeSlices, ModifierNodeSlicesDebugStats, Point, PointerEvent, PointerEventKind,
66 PointerInputScope, Rect, RenderEffect, ResolvedBackground, ResolvedModifiers,
67 RoundedCornerShape, RuntimeShader, Shadow, ShadowScope, Size, TransformOrigin,
68};
69pub use modifier_nodes::{
70 AlphaElement, AlphaNode, BackgroundElement, BackgroundNode, ClickableElement, ClickableNode,
71 CornerShapeElement, CornerShapeNode, FillDirection, FillElement, FillNode, OffsetElement,
72 OffsetNode, PaddingElement, PaddingNode, SizeElement, SizeNode,
73};
74pub use pointer_dispatch::{
75 clear_pointer_repasses, has_pending_pointer_repasses, process_pointer_repasses,
76 schedule_pointer_repass,
77};
78pub use primitives::{
79 remember_svg, BasicText, BasicTextField, BasicTextFieldOptions, BasicTextWithOptions,
80 BitmapPainter, Box, BoxScope, BoxSpec, BoxWithConstraints, BoxWithConstraintsScope,
81 BoxWithConstraintsScopeImpl, Button, Canvas, Column, ColumnSpec, ContentScale, ForEach, Image,
82 Layout, LayoutNode, Painter, Row, RowSpec, Spacer, SubcomposeLayout, SvgPainter,
83 SvgPainterError, Text, TextWithOptions, DEFAULT_ALPHA,
84};
85pub use cranpose_foundation::lazy::{LazyListItemInfo, LazyListLayoutInfo, LazyListState};
87pub use key_event::{KeyCode, KeyEvent, KeyEventType, Modifiers};
88#[cfg(any(test, feature = "test-helpers"))]
89#[doc(hidden)]
90pub use render_state::reset_render_state_for_tests;
91pub use render_state::{
92 current_density, has_pending_draw_repasses, has_pending_layout_repasses,
93 peek_focus_invalidation, peek_layout_invalidation, peek_pointer_invalidation,
94 peek_render_invalidation, request_focus_invalidation, request_layout_invalidation,
95 request_pointer_invalidation, request_render_invalidation, schedule_draw_repass,
96 schedule_layout_repass, set_density, take_draw_repass_nodes, take_focus_invalidation,
97 take_layout_invalidation, take_layout_repass_nodes, take_pointer_invalidation,
98 take_render_invalidation,
99};
100pub use renderer::{HeadlessRenderer, PaintLayer, RecordedRenderScene, RenderOp};
101pub use scroll::{ScrollElement, ScrollNode, ScrollState};
102#[cfg(feature = "test-helpers")]
104pub use modifier::{last_fling_velocity, reset_last_fling_velocity};
105pub use subcompose_layout::{
106 Constraints, MeasureResult, Placement, SubcomposeLayoutNode, SubcomposeLayoutScope,
107 SubcomposeMeasureScope, SubcomposeMeasureScopeImpl,
108};
109pub use text::{
110 get_cursor_x_for_offset, get_offset_for_position, layout_text, measure_text,
111 measure_text_for_node, measure_text_with_options, measure_text_with_options_for_node,
112 prepare_text_layout, prepare_text_layout_for_node, set_text_measurer, LinkAnnotation,
113 ParagraphStyle, PlatformParagraphStyle, PlatformSpanStyle, PlatformTextStyle,
114 PreparedTextLayout, SpanStyle, StringAnnotation, TextDrawStyle, TextLayoutOptions,
115 TextMeasurer, TextMetrics, TextOptions, TextOverflow, TextShaping, TextStyle,
116};
117pub use text_field_modifier_node::{TextFieldElement, TextFieldModifierNode};
118pub use text_modifier_node::{TextModifierElement, TextModifierNode};
119pub use widgets::clickable_text::ClickableText;
120pub use widgets::lazy_list::{LazyColumn, LazyColumnSpec, LazyRow, LazyRowSpec};
121pub use widgets::linked_text::LinkedText;
122
123pub use debug::{
125 format_layout_tree, format_modifier_chain, format_render_scene, format_screen_summary,
126 install_modifier_chain_trace, log_layout_tree, log_modifier_chain, log_render_scene,
127 log_screen_summary, ModifierChainTraceGuard,
128};
129
130pub type TestComposition = Composition<MemoryApplier>;
132
133pub fn run_test_composition(build: impl FnMut()) -> TestComposition {
135 #[cfg(test)]
136 reset_render_state_for_tests();
137 let mut composition = Composition::new(MemoryApplier::new());
138 composition
139 .render(location_key(file!(), line!(), column!()), build)
140 .expect("initial render succeeds");
141 composition
142}
143
144pub use cranpose_core::MutableState as SnapshotState;
145
146#[cfg(test)]
147#[path = "tests/anchor_async_tests.rs"]
148mod anchor_async_tests;
149
150#[cfg(test)]
151#[path = "tests/async_runtime_full_layout_test.rs"]
152mod async_runtime_full_layout_test;
153
154#[cfg(test)]
155#[path = "tests/cursor_position_tests.rs"]
156mod cursor_position_tests;
157
158#[cfg(test)]
159#[path = "tests/tab_switching_tests.rs"]
160mod tab_switching_tests;
161
162#[cfg(test)]
163#[path = "tests/lazy_list_viewport_tests.rs"]
164mod lazy_list_viewport_tests;
165
166#[cfg(test)]
167#[path = "tests/lazy_list_recompose_tests.rs"]
168mod lazy_list_recompose_tests;