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