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 density;
35pub mod design;
36pub mod drawing;
37mod extensions;
38pub mod file_dialog;
39pub mod font_features;
40pub mod fonts;
41pub mod highlight;
42pub mod input;
43pub mod measure;
44pub mod message;
45pub mod native_view;
46pub mod notification;
47pub mod palette;
48pub mod picked_file;
49pub mod protocol;
50pub mod runtime;
51pub mod schema;
52pub mod spans;
53pub mod storage;
54pub mod theme;
55pub mod time;
56pub mod tokens;
57pub mod ui;
58#[doc(hidden)]
59pub mod web_event_buffer;
60pub mod window;
61pub mod windows;
62mod writer;
63pub mod zoom;
64
65pub use animation::{
66 Animated, AnimationMoment, AnimationSpec, GraphicsLayer, animate_color_as_state,
67 animate_float_as_state, animate_offset_as_state, control_animation, reduced_motion,
68 start_animation, transition,
69};
70pub use asset::{AssetId, asset};
71pub use boundary::{
72 Host, LaunchBuilder, MutationBatch, RendererApi, RuntimeFactory, demo_theme, demo_theme_for,
73 install_renderer_api, launch_runtime, request_frame_from_worker,
74};
75pub use brush::{Brush, Stop, brush, release_brush};
76pub use code::{
77 CaretRect, CodeChange, CodeEditorColors, CodeHover, CodeMetrics, CodePointer, CodeRange,
78 CodeRect, CodeScroll, ContentPadding, Decoration, Decorations, EditGroupResult, EditRejected,
79 Fold, FoldChange, Folds, GutterDecoration, GutterDecorations, Position, SaveRequest,
80 SelectionChange, SelectionsChange, SyntaxSpan, SyntaxSpans, ViewZone, ViewZones, VisibleRange,
81 WordWrap,
82};
83#[doc(hidden)]
84pub use compose_rust_macros::__compose_call_check;
85pub use density::density;
86pub use design::design_system;
87pub use drawing::{DrawCommand, DrawList, DrawListBuilder};
88pub use file_dialog::{FileDialog, FileDialogResult, FileDialogSender};
89pub use font_features::FontFeature;
90pub use fonts::{FontRef, FontRefs, FontStack};
91pub use input::{
92 FileDrop, KeyEvent, MotionFinished, PointerEvent, PointerKinds, RangeRequest, pointer_button,
93};
94pub use message::{Message, show_message};
95pub use notification::{
96 Notification, NotificationActivation, NotificationSender, notification_permission,
97 request_notification_permission, withdraw_notification,
98};
99pub use palette::{Palette, PaletteViolation};
100pub use picked_file::{Delivery, FileError, PickedFile};
101pub use runtime::{Batch, Composable, ComposeHost, Recomposer, Runtime, application, launch};
102pub use schema::{
103 Alignment, Arrangement, AssetKind, BackgroundRepeat, ButtonKind, ButtonVariant, Chrome, Color,
104 ColorRole, ColorScheme, CompactNavigation, ContentScale, DecorationKind, DesignSystem,
105 EditGroupStatus, EventPayload, GenericFamily, GutterDecorationKind, HoverPhase, IconRole, Key,
106 LoopMode, MaterialRole, MessageDuration, MessageHorizontal, MessagePlacement, MessageVertical,
107 Modifier, MotionRole, NotificationImportance, NotificationPermission, NotificationPresentation,
108 OverflowWrap, Paint, PopoverAlign, PopoverPlacement, PropertyKind, RevealAlign, SCHEMA_HASH,
109 Selection, SemanticsRole, Severity, ShapeRole, SheetPresentation, Snap, SpaceRole, TextAlign,
110 TextOverflow, Theme, TileMode, TypeRole, WidgetKind, WindowHeightClass, WindowSizeClass,
111 WordBreak,
112};
113pub use schema::{
114 AnimatedProperty, Animation, AnimationControl, AnimationEventKind, AnimationEvents,
115 ColorInterpolation, FillMode, Keyframe, KeyframeValue, PlayState, PlaybackDirection,
116 ReducedMotion, StepPosition, SystemColorScheme, Timing, TransformFunction,
117 TransformFunctionKind,
118};
119pub use schema::{Cursor, PointerKind, PointerType, UserSelect, WheelDeltaMode};
120pub use schema::{MinimapSide, WordWrapMode};
121pub use schema::{NativeHandle, NativeParentKind};
122pub use theme::{
123 ThemeHandle, resolved_color_scheme, subscribe_system_color_scheme, system_color_scheme,
124};
125pub use ui::{ScrollState, remember_scroll_state};
126pub use window::{NodeSize, WindowSafeArea, WindowSize, node_size, window_size};
127pub use windows::{
128 DragFromPointer, LastWindowClosed, WindowDragEvent, WindowDragOver, WindowDragOverKind,
129 WindowDragPhase, WindowEvent, WindowFrame, WindowHandle, WindowMode, WindowRequest,
130 current_window,
131};
132pub use zoom::{Zoom, ZoomHandle, zoom};
133
134#[macro_export]
150macro_rules! ios_main {
151 ($launch:path) => {
152 #[cfg(target_os = "ios")]
153 #[unsafe(no_mangle)]
154 pub extern "C" fn compose_rust_ios_main() -> i32 {
155 $launch();
156 0
157 }
158 };
159}
160
161#[macro_export]
173macro_rules! android_application {
174 ($content:path) => {
175 $crate::android_application!($crate::LaunchBuilder::new(), $content);
176 };
177 ($builder:expr, $content:path) => {
178 #[cfg(target_os = "android")]
179 #[unsafe(no_mangle)]
180 pub extern "C" fn compose_rust_android_main() {
181 let _ = $builder
182 .with_mode($crate::LoopMode::Platform)
183 .try_launch($content);
184 }
185 };
186}
187
188#[macro_export]
198macro_rules! web_application {
199 ($content:path) => {
200 $crate::web_application!($crate::LaunchBuilder::new(), $content);
201 };
202 ($builder:expr, $content:path) => {
203 #[cfg(target_family = "wasm")]
204 #[unsafe(no_mangle)]
205 pub extern "C" fn compose_rust_host_web_start() -> u32 {
206 $crate::__web_start($builder, $crate::runtime::recomposer_for($content))
207 }
208
209 #[cfg(not(target_family = "wasm"))]
212 #[allow(dead_code)]
213 fn __compose_rust_web_start_unused() -> u32 {
214 let _: fn() = $content;
215 let _ = $builder;
216 0
217 }
218 };
219}