#![deny(unsafe_op_in_unsafe_fn)]
extern crate self as compose_rust;
pub mod animation;
pub mod asset;
pub mod boundary;
#[cfg(target_os = "android")]
#[path = "boundary_jni.gen.rs"]
mod boundary_jni;
#[cfg(target_family = "wasm")]
#[path = "boundary_wasm.gen.rs"]
mod boundary_wasm;
pub mod brush;
pub mod code;
#[cfg(test)]
mod code_colours;
pub mod contrast;
#[cfg(target_family = "wasm")]
#[doc(hidden)]
pub use boundary_wasm::web_start as __web_start;
#[doc(hidden)]
pub mod codegen;
pub mod design;
pub mod drawing;
mod extensions;
pub mod fonts;
pub mod highlight;
pub mod input;
pub mod measure;
pub mod message;
pub mod notification;
pub mod palette;
pub mod protocol;
pub mod runtime;
pub mod schema;
pub mod spans;
pub mod theme;
pub mod tokens;
pub mod ui;
pub mod window;
mod writer;
pub mod zoom;
pub use animation::{
Animated, AnimationMoment, AnimationSpec, GraphicsLayer, animate_color_as_state,
animate_float_as_state, animate_offset_as_state, control_animation, reduced_motion,
start_animation, transition,
};
pub use asset::asset;
pub use boundary::{
Host, LaunchBuilder, MutationBatch, RendererApi, RuntimeFactory, demo_theme, demo_theme_for,
install_renderer_api, launch_runtime, request_frame_from_worker,
};
pub use brush::{Brush, Stop, brush, release_brush};
pub use code::{
CodeChange, CodeHover, CodeRange, Decoration, Decorations, EditRejected, Fold, FoldChange,
Folds, GutterDecoration, GutterDecorations, Position, SaveRequest, SelectionChange, SyntaxSpan,
SyntaxSpans, VisibleRange,
};
pub use design::design_system;
pub use drawing::{DrawCommand, DrawList, DrawListBuilder};
pub use fonts::{FontRef, FontRefs};
pub use input::{FileDrop, KeyEvent, PointerEvent, PointerKinds, RangeRequest, pointer_button};
pub use message::{Message, show_message};
pub use notification::{
Notification, NotificationActivation, NotificationSender, notification_permission,
request_notification_permission, withdraw_notification,
};
pub use palette::{Palette, PaletteViolation};
pub use runtime::{Batch, ComposeHost, Recomposer, Runtime, application, composable, launch};
pub use schema::{
Alignment, Arrangement, AssetKind, ButtonKind, ButtonVariant, Chrome, Color, ColorRole,
ColorScheme, DecorationKind, DesignSystem, EventPayload, GenericFamily, GutterDecorationKind,
HoverPhase, IconRole, Key, LoopMode, MaterialRole, MessageDuration, Modifier, MotionRole,
NotificationImportance, NotificationPermission, NotificationPresentation, OverflowWrap, Paint,
PropertyKind, RevealAlign, SCHEMA_HASH, Selection, Severity, ShapeRole, SpaceRole, TextAlign,
TextOverflow, Theme, TileMode, TypeRole, WidgetKind, WindowHeightClass, WindowSizeClass,
WordBreak,
};
pub use schema::{
AnimatedProperty, Animation, AnimationControl, AnimationEventKind, AnimationEvents,
ColorInterpolation, FillMode, Keyframe, KeyframeValue, PlayState, PlaybackDirection,
ReducedMotion, StepPosition, Timing, TransformFunction, TransformFunctionKind,
};
pub use schema::{Cursor, PointerKind, PointerType, UserSelect, WheelDeltaMode};
pub use theme::ThemeHandle;
pub use window::{NodeSize, WindowSize, node_size, window_size};
pub use zoom::{Zoom, ZoomHandle, zoom};
#[macro_export]
macro_rules! ios_main {
($launch:path) => {
#[cfg(target_os = "ios")]
#[unsafe(no_mangle)]
pub extern "C" fn compose_rust_ios_main() -> i32 {
$launch();
0
}
};
}
#[macro_export]
macro_rules! android_application {
($content:path) => {
$crate::android_application!($crate::LaunchBuilder::new(), $content);
};
($builder:expr, $content:path) => {
#[cfg(target_os = "android")]
#[unsafe(no_mangle)]
pub extern "C" fn compose_rust_android_main() {
let _ = $builder
.with_mode($crate::LoopMode::Platform)
.try_launch($content);
}
};
}
#[macro_export]
macro_rules! web_application {
($content:path) => {
$crate::web_application!($crate::LaunchBuilder::new(), $content);
};
($builder:expr, $content:path) => {
#[cfg(target_family = "wasm")]
#[unsafe(no_mangle)]
pub extern "C" fn compose_rust_host_web_start() -> u32 {
$crate::__web_start($builder, $crate::runtime::recomposer_for($content))
}
#[cfg(not(target_family = "wasm"))]
#[allow(dead_code)]
fn __compose_rust_web_start_unused() -> u32 {
let _: fn() = $content;
let _ = $builder;
0
}
};
}