1#![deny(unsafe_op_in_unsafe_fn)]
2
3extern crate self as compose_rust;
7
8pub mod animation;
9pub mod asset;
10pub mod boundary;
11#[cfg(target_os = "android")]
14#[path = "boundary_jni.gen.rs"]
15mod boundary_jni;
16#[cfg(target_family = "wasm")]
19#[path = "boundary_wasm.gen.rs"]
20mod boundary_wasm;
21pub mod brush;
22pub mod clipboard;
23pub mod code;
24#[cfg(test)]
27mod code_colours;
28pub mod contrast;
29#[cfg(target_family = "wasm")]
30#[doc(hidden)]
31pub use boundary_wasm::web_start as __web_start;
32#[doc(hidden)]
33pub mod codegen;
34pub mod design;
35pub mod drawing;
36mod extensions;
37pub mod file_dialog;
38pub mod fonts;
39pub mod highlight;
40pub mod input;
41pub mod measure;
42pub mod message;
43pub mod notification;
44pub mod palette;
45pub mod picked_file;
46pub mod protocol;
47pub mod runtime;
48pub mod schema;
49pub mod spans;
50pub mod storage;
51pub mod theme;
52pub mod tokens;
53pub mod ui;
54#[doc(hidden)]
55pub mod web_event_buffer;
56pub mod window;
57pub mod windows;
58mod writer;
59pub mod zoom;
60
61pub use animation::{
62 Animated, AnimationMoment, AnimationSpec, GraphicsLayer, animate_color_as_state,
63 animate_float_as_state, animate_offset_as_state, control_animation, reduced_motion,
64 start_animation, transition,
65};
66pub use asset::asset;
67pub use boundary::{
68 Host, LaunchBuilder, MutationBatch, RendererApi, RuntimeFactory, demo_theme, demo_theme_for,
69 install_renderer_api, launch_runtime, request_frame_from_worker,
70};
71pub use brush::{Brush, Stop, brush, release_brush};
72pub use code::{
73 CodeChange, CodeEditorColors, CodeHover, CodeMetrics, CodeRange, CodeScroll, Decoration,
74 Decorations, EditRejected, Fold, FoldChange, Folds, GutterDecoration, GutterDecorations,
75 Position, SaveRequest, SelectionChange, SyntaxSpan, SyntaxSpans, VisibleRange,
76};
77#[doc(hidden)]
78pub use compose_rust_macros::__compose_call_check;
79pub use design::design_system;
80pub use drawing::{DrawCommand, DrawList, DrawListBuilder};
81pub use file_dialog::{FileDialog, FileDialogResult, FileDialogSender};
82pub use fonts::{FontRef, FontRefs, FontStack};
83pub use input::{FileDrop, KeyEvent, PointerEvent, PointerKinds, RangeRequest, pointer_button};
84pub use message::{Message, show_message};
85pub use notification::{
86 Notification, NotificationActivation, NotificationSender, notification_permission,
87 request_notification_permission, withdraw_notification,
88};
89pub use palette::{Palette, PaletteViolation};
90pub use picked_file::{Delivery, FileError, PickedFile};
91pub use runtime::{Batch, Composable, ComposeHost, Recomposer, Runtime, application, launch};
92pub use schema::{
93 Alignment, Arrangement, AssetKind, ButtonKind, ButtonVariant, Chrome, Color, ColorRole,
94 ColorScheme, CompactNavigation, DecorationKind, DesignSystem, EventPayload, GenericFamily,
95 GutterDecorationKind, HoverPhase, IconRole, Key, LoopMode, MaterialRole, MessageDuration,
96 Modifier, MotionRole, NotificationImportance, NotificationPermission, NotificationPresentation,
97 OverflowWrap, Paint, PopoverAlign, PopoverPlacement, PropertyKind, RevealAlign, SCHEMA_HASH,
98 Selection, SemanticsRole, Severity, ShapeRole, SpaceRole, TextAlign, TextOverflow, Theme,
99 TileMode, TypeRole, WidgetKind, WindowHeightClass, WindowSizeClass, WordBreak,
100};
101pub use schema::{
102 AnimatedProperty, Animation, AnimationControl, AnimationEventKind, AnimationEvents,
103 ColorInterpolation, FillMode, Keyframe, KeyframeValue, PlayState, PlaybackDirection,
104 ReducedMotion, StepPosition, Timing, TransformFunction, TransformFunctionKind,
105};
106pub use schema::{Cursor, PointerKind, PointerType, UserSelect, WheelDeltaMode};
107pub use theme::ThemeHandle;
108pub use ui::{ScrollState, remember_scroll_state};
109pub use window::{NodeSize, WindowSafeArea, WindowSize, node_size, window_size};
110pub use windows::{
111 DragFromPointer, LastWindowClosed, WindowDragEvent, WindowDragOver, WindowDragOverKind,
112 WindowDragPhase, WindowEvent, WindowFrame, WindowHandle, WindowMode, WindowRequest,
113 current_window,
114};
115pub use zoom::{Zoom, ZoomHandle, zoom};
116
117#[macro_export]
133macro_rules! ios_main {
134 ($launch:path) => {
135 #[cfg(target_os = "ios")]
136 #[unsafe(no_mangle)]
137 pub extern "C" fn compose_rust_ios_main() -> i32 {
138 $launch();
139 0
140 }
141 };
142}
143
144#[macro_export]
156macro_rules! android_application {
157 ($content:path) => {
158 $crate::android_application!($crate::LaunchBuilder::new(), $content);
159 };
160 ($builder:expr, $content:path) => {
161 #[cfg(target_os = "android")]
162 #[unsafe(no_mangle)]
163 pub extern "C" fn compose_rust_android_main() {
164 let _ = $builder
165 .with_mode($crate::LoopMode::Platform)
166 .try_launch($content);
167 }
168 };
169}
170
171#[macro_export]
181macro_rules! web_application {
182 ($content:path) => {
183 $crate::web_application!($crate::LaunchBuilder::new(), $content);
184 };
185 ($builder:expr, $content:path) => {
186 #[cfg(target_family = "wasm")]
187 #[unsafe(no_mangle)]
188 pub extern "C" fn compose_rust_host_web_start() -> u32 {
189 $crate::__web_start($builder, $crate::runtime::recomposer_for($content))
190 }
191
192 #[cfg(not(target_family = "wasm"))]
195 #[allow(dead_code)]
196 fn __compose_rust_web_start_unused() -> u32 {
197 let _: fn() = $content;
198 let _ = $builder;
199 0
200 }
201 };
202}