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 code;
23#[cfg(test)]
26mod code_colours;
27pub mod contrast;
28#[cfg(target_family = "wasm")]
29#[doc(hidden)]
30pub use boundary_wasm::web_start as __web_start;
31#[doc(hidden)]
32pub mod codegen;
33pub mod design;
34pub mod drawing;
35mod extensions;
36pub mod fonts;
37pub mod highlight;
38pub mod input;
39pub mod measure;
40pub mod message;
41pub mod notification;
42pub mod palette;
43pub mod protocol;
44pub mod runtime;
45pub mod schema;
46pub mod spans;
47pub mod theme;
48pub mod tokens;
49pub mod ui;
50pub mod window;
51mod writer;
52pub mod zoom;
53
54pub use animation::{
55 Animated, AnimationMoment, AnimationSpec, GraphicsLayer, animate_color_as_state,
56 animate_float_as_state, animate_offset_as_state, control_animation, reduced_motion,
57 start_animation, transition,
58};
59pub use asset::asset;
60pub use boundary::{
61 Host, LaunchBuilder, MutationBatch, RendererApi, RuntimeFactory, demo_theme, demo_theme_for,
62 install_renderer_api, launch_runtime, request_frame_from_worker,
63};
64pub use brush::{Brush, Stop, brush, release_brush};
65pub use code::{
66 CodeChange, CodeHover, CodeRange, Decoration, Decorations, EditRejected, Fold, FoldChange,
67 Folds, GutterDecoration, GutterDecorations, Position, SaveRequest, SelectionChange, SyntaxSpan,
68 SyntaxSpans, VisibleRange,
69};
70pub use design::design_system;
71pub use drawing::{DrawCommand, DrawList, DrawListBuilder};
72pub use fonts::{FontRef, FontRefs};
73pub use input::{FileDrop, KeyEvent, PointerEvent, PointerKinds, RangeRequest, pointer_button};
74pub use message::{Message, show_message};
75pub use notification::{
76 Notification, NotificationActivation, NotificationSender, notification_permission,
77 request_notification_permission, withdraw_notification,
78};
79pub use palette::{Palette, PaletteViolation};
80pub use runtime::{Batch, ComposeHost, Recomposer, Runtime, application, composable, launch};
81pub use schema::{
82 Alignment, Arrangement, AssetKind, ButtonKind, ButtonVariant, Chrome, Color, ColorRole,
83 ColorScheme, DecorationKind, DesignSystem, EventPayload, GenericFamily, GutterDecorationKind,
84 HoverPhase, IconRole, Key, LoopMode, MaterialRole, MessageDuration, Modifier, MotionRole,
85 NotificationImportance, NotificationPermission, NotificationPresentation, OverflowWrap, Paint,
86 PropertyKind, RevealAlign, SCHEMA_HASH, Selection, Severity, ShapeRole, SpaceRole, TextAlign,
87 TextOverflow, Theme, TileMode, TypeRole, WidgetKind, WindowHeightClass, WindowSizeClass,
88 WordBreak,
89};
90pub use schema::{
91 AnimatedProperty, Animation, AnimationControl, AnimationEventKind, AnimationEvents,
92 ColorInterpolation, FillMode, Keyframe, KeyframeValue, PlayState, PlaybackDirection,
93 ReducedMotion, StepPosition, Timing, TransformFunction, TransformFunctionKind,
94};
95pub use schema::{Cursor, PointerKind, PointerType, UserSelect, WheelDeltaMode};
96pub use theme::ThemeHandle;
97pub use window::{NodeSize, WindowSize, node_size, window_size};
98pub use zoom::{Zoom, ZoomHandle, zoom};
99
100#[macro_export]
116macro_rules! ios_main {
117 ($launch:path) => {
118 #[cfg(target_os = "ios")]
119 #[unsafe(no_mangle)]
120 pub extern "C" fn compose_rust_ios_main() -> i32 {
121 $launch();
122 0
123 }
124 };
125}
126
127#[macro_export]
139macro_rules! android_application {
140 ($content:path) => {
141 $crate::android_application!($crate::LaunchBuilder::new(), $content);
142 };
143 ($builder:expr, $content:path) => {
144 #[cfg(target_os = "android")]
145 #[unsafe(no_mangle)]
146 pub extern "C" fn compose_rust_android_main() {
147 let _ = $builder
148 .with_mode($crate::LoopMode::Platform)
149 .try_launch($content);
150 }
151 };
152}
153
154#[macro_export]
164macro_rules! web_application {
165 ($content:path) => {
166 $crate::web_application!($crate::LaunchBuilder::new(), $content);
167 };
168 ($builder:expr, $content:path) => {
169 #[cfg(target_family = "wasm")]
170 #[unsafe(no_mangle)]
171 pub extern "C" fn compose_rust_host_web_start() -> u32 {
172 $crate::__web_start($builder, $crate::runtime::recomposer_for($content))
173 }
174
175 #[cfg(not(target_family = "wasm"))]
178 #[allow(dead_code)]
179 fn __compose_rust_web_start_unused() -> u32 {
180 let _: fn() = $content;
181 let _ = $builder;
182 0
183 }
184 };
185}