1pub mod animation;
2pub mod app;
3pub mod assets;
4#[doc(hidden)]
5pub mod bindings;
6pub mod bitmap;
7#[doc(hidden)]
8pub mod bridge_callbacks;
9pub mod color;
10pub(crate) mod context_menu_manager;
11pub mod controls;
12pub mod debug;
13pub mod drag_drop;
14pub(crate) mod drag_gesture;
15pub mod drawing;
16pub mod event;
17pub mod external_drop;
18pub mod fetch;
19#[doc(hidden)]
20pub mod ffi;
21pub mod file;
22pub(crate) mod focus_adorner;
23mod focus_visibility;
24pub mod frame_scheduler;
25pub mod frame_signal;
26#[doc(hidden)]
27pub mod generated;
28pub mod host_events;
29pub mod host_services;
30pub mod image_sampling;
31pub(crate) mod keyboard_scroll;
32pub(crate) mod keyboard_scroll_tracker;
33pub mod logger;
34pub(crate) mod mobile_text_selection_toolbar;
35pub mod navigation;
36pub mod node;
37pub(crate) mod panic_hook;
38pub mod persisted;
39pub mod platform;
40#[doc(hidden)]
41pub mod popup_presenter;
42pub(crate) mod selection_handle_adorner;
43#[doc(hidden)]
44pub mod signal;
45pub mod text;
46mod text_indices;
47pub mod theme;
48pub mod timers;
49pub mod tool_tip;
50pub(crate) mod tool_tip_manager;
51pub mod transitions;
52pub mod typography;
53pub mod viewport;
54pub mod worker;
55#[cfg(feature = "worker-runtime")]
56pub mod worker_job;
57#[cfg(feature = "worker-runtime")]
58pub mod worker_runtime;
59
60#[macro_export]
61macro_rules! children {
62 ($($child:expr),* $(,)?) => {
63 vec![$($crate::Child::from_node(&$child)),*]
64 };
65}
66
67#[doc(hidden)]
68#[macro_export]
69macro_rules! __fui_rs_rich_text_spans {
70 (@collect [$($span:expr,)*]) => {
71 vec![$($span,)*]
72 };
73 (@collect [$($span:expr,)*] , $($rest:tt)*) => {
74 $crate::__fui_rs_rich_text_spans!(@collect [$($span,)*] $($rest)*)
75 };
76 (@collect [$($span:expr,)*] span => $value:expr, $($rest:tt)*) => {
77 $crate::__fui_rs_rich_text_spans!(@collect [$($span,)* $value,] $($rest)*)
78 };
79 (@collect [$($span:expr,)*] { $text:expr } $(.$method:ident($($argument:expr),* $(,)?))* , $($rest:tt)*) => {
80 $crate::__fui_rs_rich_text_spans!(@collect [
81 $($span,)*
82 $crate::text::span($text)$(.$method($($argument),*))*,
83 ] $($rest)*)
84 };
85 (@collect [$($span:expr,)*] $text:literal $(.$method:ident($($argument:expr),* $(,)?))* , $($rest:tt)*) => {
86 $crate::__fui_rs_rich_text_spans!(@collect [
87 $($span,)*
88 $crate::text::span($text)$(.$method($($argument),*))*,
89 ] $($rest)*)
90 };
91}
92
93#[macro_export]
98macro_rules! rich_text {
99 ($($span:tt)*) => {
100 $crate::text::RichText::new(
101 $crate::__fui_rs_rich_text_spans!(@collect [] $($span)* ,)
102 )
103 };
104}
105
106pub trait Configure: Sized {
107 fn configure(self, configure: impl FnOnce(&Self)) -> Self {
108 configure(&self);
109 self
110 }
111}
112
113impl<T> Configure for T {}
114
115#[macro_export]
116macro_rules! fui_app {
117 ($page_ty:ty, $build_page:expr) => {
118 $crate::fui_managed_app!($page_ty, $build_page, |page: &$page_ty| page.clone());
119 };
120}
121
122#[cfg(feature = "worker-runtime")]
123#[macro_export]
124macro_rules! fui_worker {
125 ($($entry:ident => $job:ty),+ $(,)?) => {
126 $(
127 #[doc = "Worker entrypoint generated by `fui_worker!`.\n\n# Safety\n`input_ptr` must reference `input_len` readable bytes when `input_len` is non-zero."]
128 #[no_mangle]
129 pub unsafe extern "C" fn $entry(input_ptr: usize, input_len: u32) {
130 ::std::thread_local! {
131 static ACTIVE_JOB: ::std::cell::RefCell<Option<$job>> =
132 const { ::std::cell::RefCell::new(None) };
133 }
134 let input = unsafe {
135 $crate::WorkerRuntime::entry_input(input_ptr, input_len)
136 };
137 ACTIVE_JOB.with(|slot| {
138 let mut active = slot.borrow_mut();
139 if active.is_none() {
140 $crate::worker_runtime::reset_worker_runtime();
141 }
142 let mut job = active.take().unwrap_or_default();
143 if $crate::WorkerJob::resume(&mut job, input) {
144 *active = Some(job);
145 }
146 });
147 }
148 )+
149
150 #[no_mangle]
151 pub extern "C" fn __fui_worker_text_buffer() -> usize {
152 $crate::worker_runtime::worker_text_buffer_ptr()
153 }
154
155 #[no_mangle]
156 pub extern "C" fn __fui_worker_text_buffer_size() -> u32 {
157 $crate::worker_runtime::worker_text_buffer_size()
158 }
159 };
160}
161
162#[macro_export]
163macro_rules! fui_managed_app {
164 ($page_ty:ty, $build_page:expr, $get_root:expr) => {
165 thread_local! {
166 static __FUI_RS_APP: ::std::cell::RefCell<Option<$crate::ManagedApplication<$page_ty>>> =
167 const { ::std::cell::RefCell::new(None) };
168 }
169
170 fn __fui_rs_with_app<T>(
171 callback: impl FnOnce(&$crate::ManagedApplication<$page_ty>) -> T,
172 ) -> T {
173 __FUI_RS_APP.with(|slot| {
174 if slot.borrow().is_none() {
175 slot.borrow_mut()
176 .replace($crate::ManagedApplication::new($build_page, $get_root));
177 }
178 let app = slot.borrow();
179 callback(app.as_ref().expect("FUI-RS managed app must be initialized"))
180 })
181 }
182
183 #[no_mangle]
184 pub extern "C" fn __runApp() {
185 __fui_rs_with_app(|app| app.run());
186 }
187
188 #[no_mangle]
189 pub extern "C" fn __disposeApp() {
190 __fui_rs_with_app(|app| app.dispose());
191 }
192 };
193 ($page_ty:ty, $build_page:expr, $get_root:expr, mount: $mount_page:expr) => {
194 thread_local! {
195 static __FUI_RS_APP: ::std::cell::RefCell<Option<$crate::ManagedApplication<$page_ty>>> =
196 const { ::std::cell::RefCell::new(None) };
197 }
198
199 fn __fui_rs_with_app<T>(
200 callback: impl FnOnce(&$crate::ManagedApplication<$page_ty>) -> T,
201 ) -> T {
202 __FUI_RS_APP.with(|slot| {
203 if slot.borrow().is_none() {
204 slot.borrow_mut().replace(
205 $crate::ManagedApplication::new($build_page, $get_root)
206 .mount_page($mount_page),
207 );
208 }
209 let app = slot.borrow();
210 callback(app.as_ref().expect("FUI-RS managed app must be initialized"))
211 })
212 }
213
214 #[no_mangle]
215 pub extern "C" fn __runApp() {
216 __fui_rs_with_app(|app| app.run());
217 }
218
219 #[no_mangle]
220 pub extern "C" fn __disposeApp() {
221 __fui_rs_with_app(|app| app.dispose());
222 }
223 };
224 ($page_ty:ty, $build_page:expr, $get_root:expr, dispose: $dispose_page:expr) => {
225 thread_local! {
226 static __FUI_RS_APP: ::std::cell::RefCell<Option<$crate::ManagedApplication<$page_ty>>> =
227 const { ::std::cell::RefCell::new(None) };
228 }
229
230 fn __fui_rs_with_app<T>(
231 callback: impl FnOnce(&$crate::ManagedApplication<$page_ty>) -> T,
232 ) -> T {
233 __FUI_RS_APP.with(|slot| {
234 if slot.borrow().is_none() {
235 slot.borrow_mut().replace(
236 $crate::ManagedApplication::new($build_page, $get_root)
237 .dispose_page($dispose_page),
238 );
239 }
240 let app = slot.borrow();
241 callback(app.as_ref().expect("FUI-RS managed app must be initialized"))
242 })
243 }
244
245 #[no_mangle]
246 pub extern "C" fn __runApp() {
247 __fui_rs_with_app(|app| app.run());
248 }
249
250 #[no_mangle]
251 pub extern "C" fn __disposeApp() {
252 __fui_rs_with_app(|app| app.dispose());
253 }
254 };
255 ($page_ty:ty, $build_page:expr, $get_root:expr, mount: $mount_page:expr, dispose: $dispose_page:expr) => {
256 thread_local! {
257 static __FUI_RS_APP: ::std::cell::RefCell<Option<$crate::ManagedApplication<$page_ty>>> =
258 const { ::std::cell::RefCell::new(None) };
259 }
260
261 fn __fui_rs_with_app<T>(
262 callback: impl FnOnce(&$crate::ManagedApplication<$page_ty>) -> T,
263 ) -> T {
264 __FUI_RS_APP.with(|slot| {
265 if slot.borrow().is_none() {
266 slot.borrow_mut().replace(
267 $crate::ManagedApplication::new($build_page, $get_root)
268 .mount_page($mount_page)
269 .dispose_page($dispose_page),
270 );
271 }
272 let app = slot.borrow();
273 callback(app.as_ref().expect("FUI-RS managed app must be initialized"))
274 })
275 }
276
277 #[no_mangle]
278 pub extern "C" fn __runApp() {
279 __fui_rs_with_app(|app| app.run());
280 }
281
282 #[no_mangle]
283 pub extern "C" fn __disposeApp() {
284 __fui_rs_with_app(|app| app.dispose());
285 }
286 };
287}
288
289#[doc(hidden)]
290#[macro_export]
291macro_rules! __fui_rs_ui_children {
292 ($parent:ident;) => {};
293 ($parent:ident; , $($rest:tt)*) => {
294 $crate::__fui_rs_ui_children!($parent; $($rest)*);
295 };
296 ($parent:ident; $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* { $($children:tt)* } , $($rest:tt)*) => {{
297 let __fui_child = $crate::ui! {
298 $ctor($($args)*) $( . $method($($method_args)*) )* { $($children)* }
299 };
300 $parent.child(&__fui_child);
301 $crate::__fui_rs_ui_children!($parent; $($rest)*);
302 }};
303 ($parent:ident; $type_name:ident :: $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* { $($children:tt)* } , $($rest:tt)*) => {{
304 let __fui_child = $crate::ui! {
305 $type_name::$ctor($($args)*) $( . $method($($method_args)*) )* { $($children)* }
306 };
307 $parent.child(&__fui_child);
308 $crate::__fui_rs_ui_children!($parent; $($rest)*);
309 }};
310 ($parent:ident; $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* { $($children:tt)* } $(,)?) => {{
311 let __fui_child = $crate::ui! {
312 $ctor($($args)*) $( . $method($($method_args)*) )* { $($children)* }
313 };
314 $parent.child(&__fui_child);
315 }};
316 ($parent:ident; $type_name:ident :: $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* { $($children:tt)* } $(,)?) => {{
317 let __fui_child = $crate::ui! {
318 $type_name::$ctor($($args)*) $( . $method($($method_args)*) )* { $($children)* }
319 };
320 $parent.child(&__fui_child);
321 }};
322 ($parent:ident; $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* , $($rest:tt)*) => {{
323 let __fui_child = $crate::ui! {
324 $ctor($($args)*) $( . $method($($method_args)*) )*
325 };
326 $parent.child(&__fui_child);
327 $crate::__fui_rs_ui_children!($parent; $($rest)*);
328 }};
329 ($parent:ident; $type_name:ident :: $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* , $($rest:tt)*) => {{
330 let __fui_child = $crate::ui! {
331 $type_name::$ctor($($args)*) $( . $method($($method_args)*) )*
332 };
333 $parent.child(&__fui_child);
334 $crate::__fui_rs_ui_children!($parent; $($rest)*);
335 }};
336 ($parent:ident; $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* $(,)?) => {{
337 let __fui_child = $crate::ui! {
338 $ctor($($args)*) $( . $method($($method_args)*) )*
339 };
340 $parent.child(&__fui_child);
341 }};
342 ($parent:ident; $type_name:ident :: $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* $(,)?) => {{
343 let __fui_child = $crate::ui! {
344 $type_name::$ctor($($args)*) $( . $method($($method_args)*) )*
345 };
346 $parent.child(&__fui_child);
347 }};
348 ($parent:ident; $child:expr, $($rest:tt)*) => {{
349 $parent.child(&$child);
350 $crate::__fui_rs_ui_children!($parent; $($rest)*);
351 }};
352 ($parent:ident; $child:expr $(,)?) => {{
353 $parent.child(&$child);
354 }};
355}
356
357#[macro_export]
358macro_rules! ui {
359 ($base:ident { $($children:tt)* }) => {{
360 let __fui_node = $base;
361 $crate::__fui_rs_ui_children!(__fui_node; $($children)*);
362 __fui_node
363 }};
364 ($type_name:ident :: $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* { $($children:tt)* }) => {{
365 let __fui_node = $type_name::$ctor($($args)*);
366 $(
367 __fui_node.$method($($method_args)*);
368 )*
369 $crate::__fui_rs_ui_children!(__fui_node; $($children)*);
370 __fui_node
371 }};
372 ($ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )* { $($children:tt)* }) => {{
373 let __fui_node = $ctor($($args)*);
374 $(
375 __fui_node.$method($($method_args)*);
376 )*
377 $crate::__fui_rs_ui_children!(__fui_node; $($children)*);
378 __fui_node
379 }};
380 ($ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )*) => {{
381 let __fui_node = $ctor($($args)*);
382 $(
383 __fui_node.$method($($method_args)*);
384 )*
385 __fui_node
386 }};
387 ($type_name:ident :: $ctor:ident ( $($args:tt)* ) $( . $method:ident ( $($method_args:tt)* ) )*) => {{
388 let __fui_node = $type_name::$ctor($($args)*);
389 $(
390 __fui_node.$method($($method_args)*);
391 )*
392 __fui_node
393 }};
394 ($expr:expr) => {
395 $expr
396 };
397}
398
399#[macro_export]
400macro_rules! fui_component {
401 ($component:ty => $root:ident) => {
402 $crate::fui_component!(@impl $component => $root, [root]);
403 };
404 ($component:ty => $root:ident, owner: $owner:ident) => {
405 $crate::fui_component!(@impl $component => $root, [owner $owner]);
406 };
407 ($component:ty => $root:ident, owners: [$($owner:ident),+ $(,)?]) => {
408 $crate::fui_component!(@impl $component => $root, [owners $($owner),+]);
409 };
410 (@impl $component:ty => $root:ident, $owner_spec:tt) => {
411 impl $crate::Node for $component {
412 fn retained_node_ref(&self) -> $crate::node::NodeRef {
413 $crate::Node::retained_node_ref(&self.$root)
414 }
415
416 fn retained_owner_attachment(&self) -> Option<std::rc::Rc<dyn std::any::Any>> {
417 $crate::fui_component!(@owner_attachment self, $root, $owner_spec)
418 }
419
420 fn build_self(&self) {
421 $crate::Node::build_self(&self.$root);
422 }
423 }
424
425 impl $crate::HasFlexBoxRoot for $component {
426 fn flex_box_root(&self) -> &$crate::FlexBox {
427 $crate::HasFlexBoxRoot::flex_box_root(&self.$root)
428 }
429 }
430 };
431 (@owner_attachment $this:ident, $root:ident, [root]) => {
432 $crate::Node::retained_owner_attachment(&$this.$root)
433 };
434 (@owner_attachment $this:ident, $root:ident, [owner $owner:ident]) => {{
435 let owner: std::rc::Rc<dyn std::any::Any> = $this.$owner.clone();
436 Some(owner)
437 }};
438 (@owner_attachment $this:ident, $root:ident, [owners $($owner:ident),+]) => {
439 Some(std::rc::Rc::new(($($this.$owner.clone(),)+)))
440 };
441}
442
443pub mod prelude {
444 pub use crate::animation::{
445 animate_color, animate_color_with, animate_float, animate_float_with,
446 get_animation_manager, reset_animations, tick_animations, Animation, AnimationManager,
447 AnimationTiming, Easing, Easings,
448 };
449 pub use crate::app::{Application, ApplicationRegistration, ManagedApplication};
450 pub use crate::bitmap::{Bitmap, BitmapTextReadyEventArgs};
451 pub use crate::bridge_callbacks::current_route;
452 pub use crate::color::{hsl_to_color, mix_color, rgb, rgba, with_alpha};
453 pub use crate::controls::{
454 anti_selection_area, button, checkbox, clear_control_templates, combo_box, context_menu,
455 create_default_button_presenter, create_default_checkbox_indicator_presenter,
456 create_default_dropdown_chevron_presenter, create_default_dropdown_field_presenter,
457 create_default_dropdown_option_row_presenter, create_default_radio_indicator_presenter,
458 create_default_slider_presenter, create_default_switch_indicator_presenter,
459 create_default_text_input_presenter, dialog, dropdown, form, get_control_templates,
460 nav_link, popup, progress_bar, radio_button, radio_group, selection_area, slider, switch,
461 text_area, text_input, use_control_templates, AntiSelectionArea, Button, ButtonColors,
462 ButtonPresenter, ButtonTemplate, ButtonVisualState, CheckState, Checkbox,
463 CheckboxChangedEventArgs, CheckboxIndicatorPresenter, CheckboxIndicatorTemplate,
464 CheckboxIndicatorVisualState, ClickEventArgs, Clickable, ComboBox,
465 ComboBoxChangedEventArgs, ComboBoxCommitMode, ComboBoxFilterMode, ComboBoxItem,
466 ContextMenu, ContextMenuAction, ContextMenuAppearance, ContextMenuItemAppearance,
467 ContextMenuVisibilityChangedEventArgs, ControlTemplateSet, DefaultButtonTemplate,
468 DefaultCheckboxIndicatorTemplate, DefaultDropdownChevronTemplate,
469 DefaultDropdownFieldTemplate, DefaultDropdownOptionRowTemplate,
470 DefaultRadioIndicatorTemplate, DefaultSliderTemplate, DefaultSwitchIndicatorTemplate,
471 DefaultTextInputTemplate, Dialog, DialogAppearance, DialogShownEventArgs, Dropdown,
472 DropdownChangedEventArgs, DropdownChevronMetrics, DropdownChevronPresenter,
473 DropdownChevronTemplate, DropdownChevronVisualState, DropdownColors, DropdownFieldMetrics,
474 DropdownFieldPresenter, DropdownFieldTemplate, DropdownFieldVisualState, DropdownItem,
475 DropdownOptionRowMetrics, DropdownOptionRowPresenter, DropdownOptionRowTemplate,
476 DropdownOptionRowVisualState, DropdownSizing, Form, LabeledControlColors,
477 LabeledControlSizing, LabeledControlTextStyle, MenuItem, NavLink, NavigateEventArgs,
478 OverlayBackdropAppearance, Popup, PopupAppearance, PressableIndicatorMetrics,
479 PressableIndicatorPresenter, PressableIndicatorVisualState, ProgressBar, ProgressBarColors,
480 ProgressBarSizing, RadioButton, RadioButtonChangedEventArgs, RadioGroup,
481 RadioGroupChangedEventArgs, RadioIndicatorPresenter, RadioIndicatorTemplate,
482 RadioIndicatorVisualState, SelectionArea, Slider, SliderChangedEventArgs, SliderColors,
483 SliderPresenter, SliderPresenterMetrics, SliderSizing, SliderTemplate, SliderVisualState,
484 SurfaceAppearance, Switch, SwitchChangedEventArgs, SwitchIndicatorPresenter,
485 SwitchIndicatorTemplate, SwitchIndicatorVisualState, TextArea, TextEditorSurface,
486 TextInput, TextInputColors, TextInputPresenter, TextInputTemplate, TextInputVisualState,
487 DEFAULT_BUTTON_TEMPLATE, DEFAULT_CHECKBOX_INDICATOR_TEMPLATE,
488 DEFAULT_DROPDOWN_CHEVRON_TEMPLATE, DEFAULT_DROPDOWN_FIELD_TEMPLATE,
489 DEFAULT_DROPDOWN_OPTION_ROW_TEMPLATE, DEFAULT_RADIO_INDICATOR_TEMPLATE,
490 DEFAULT_SLIDER_TEMPLATE, DEFAULT_SWITCH_INDICATOR_TEMPLATE, DEFAULT_TEXT_INPUT_TEMPLATE,
491 };
492 pub use crate::drag_drop::{
493 DragCompletedEventArgs, DragDataObject, DragDropEffects, DragEventArgs, DragSession,
494 DropProposal,
495 };
496 pub use crate::drawing::{DrawContext, Paint, Path};
497 pub use crate::event::{
498 FocusChangedEventArgs, GestureEventArgs, GestureEventKind, GestureEventPhase,
499 GestureIntent, KeyEventArgs, LongPressEventArgs, PointerButton, PointerButtons,
500 PointerEventArgs, PointerType, SelectionChangedEventArgs, TextChangedEventArgs,
501 WheelEventArgs,
502 };
503 pub use crate::external_drop::{
504 ExternalDropEventArgs, ExternalDropItemInfo, ExternalDropItemKind,
505 };
506 pub use crate::fetch::{Fetch, FetchErrorEventArgs, FetchRequest, FetchResponse};
507 pub use crate::ffi::{
508 AlignItems, AlignSelf, BorderStyle, CursorStyle, FlexDirection, FlexWrap, GridUnit,
509 JustifyContent, KeyEventType, KeyModifier, ObjectFit, Orientation, PointerEventType,
510 PositionType, SemanticCheckedState, SemanticRole, TextAlign, TextOverflow,
511 TextVerticalAlign, Unit, Visibility,
512 };
513 pub use crate::file::{
514 BrowserFile, BrowserFileWriter, File, FileCapabilities, FileErrorEventArgs,
515 FileOpenEventArgs, FileOpenRequest, FileReadChunk, FileRequestGuard, FileSaveMode,
516 FileSaveRequest, FileSaveResult, FileWorkerProcessProgress, FileWorkerProcessRequest,
517 FileWorkerProcessResult, FileWriteProgress,
518 };
519 pub use crate::focus_visibility::show_keyboard_focus_for_key_event;
520 pub use crate::frame_scheduler::{mark_needs_commit, on_loaded, LoadedEventArgs};
521 pub use crate::fui_component;
522 #[cfg(feature = "worker-runtime")]
523 pub use crate::fui_worker;
524 pub use crate::host_events::HostEventSubscription;
525 pub use crate::image_sampling::{ImageSampling, ImageSamplingMode};
526 pub use crate::logger;
527 pub use crate::navigation;
528 pub use crate::node::{
529 auto, column, custom_drawable, fill, flex_box, grid, image, pct, portal, px, row,
530 scroll_box, scroll_view, svg, text, viewport_height, viewport_width, virtual_list, Border,
531 BoxStyleSurface, Child, ChildContainerSurface, ContextMenuEventArgs, Corners,
532 CustomDrawable, DrawableInvalidator, EdgeInsets, FlexBox, FlexBoxSurface,
533 FlexLayoutSurface, GradientStop, Grid, GridTrack, HasFlexBoxRoot, HasTextNode, Image,
534 ImageNode, LayoutSurface, Length, Node, Portal, PresenterHostStyle, ScrollBar,
535 ScrollBarStyle, ScrollBarVisibility, ScrollBox, ScrollState, ScrollView, Shadow, Svg,
536 SvgNode, Text, TextContentSurface, TextEditingSurface, TextEventSurface, TextLayoutSurface,
537 TextNode, TextSelectionSurface, TextSurface, TextTypographySurface, ThemeBindable,
538 VirtualList,
539 };
540 pub use crate::persisted;
541 pub use crate::platform;
542 pub use crate::popup_presenter::PopupPlacement;
543 pub use crate::signal::Subscription;
544 pub use crate::text::{
545 span, DynamicTextLayout, DynamicTextOverflow, RichText, RichTextSpan, TextLayout,
546 TextLayoutReadyEventArgs, TextMetrics,
547 };
548 pub use crate::theme::{
549 bind_theme, current_theme, default_dark_theme, default_light_theme, generate_theme,
550 is_dark_mode, is_using_system_theme, set_accent_color, subscribe, use_custom_theme,
551 use_system_theme, Colors, ContextMenuItemTheme, ContextMenuTheme, Fonts, Spacing, Theme,
552 ToolTipTheme,
553 };
554 pub use crate::timers::{cancel_timeout, set_timeout, TimerHandle};
555 pub use crate::tool_tip::ToolTip;
556 pub use crate::transitions::NodeTransitions;
557 pub use crate::typography::{
558 FontFace, FontFaceLoadedEventArgs, FontFamily, FontStack, FontStackLoadedEventArgs,
559 FontStyle, FontWeight, FontsLoadedEventArgs,
560 };
561 pub use crate::viewport::{
562 viewport_height_signal, viewport_width_signal, ViewportSignalHandle,
563 };
564 pub use crate::worker::{
565 Worker, WorkerCompletedEventArgs, WorkerErrorEventArgs, WorkerProgressEventArgs,
566 };
567 #[cfg(feature = "worker-runtime")]
568 pub use crate::worker_job::{WorkerJob, WorkerJobState};
569 #[cfg(feature = "worker-runtime")]
570 pub use crate::worker_runtime::{file_read_chunk, file_worker_write_chunk, WorkerRuntime};
571 pub use crate::{children, fui_app, fui_managed_app, rich_text, ui, Configure};
572}
573
574pub use animation::{
575 animate_color, animate_color_with, animate_float, animate_float_with, get_animation_manager,
576 reset_animations, tick_animations, Animation, AnimationManager, AnimationTiming, Easing,
577 Easings,
578};
579pub use app::{Application, ApplicationRegistration, ManagedApplication};
580pub use assets::*;
581pub use bitmap::{Bitmap, BitmapTextReadyEventArgs};
582pub use bridge_callbacks::current_route;
583pub use color::{hsl_to_color, mix_color, rgb, rgba, with_alpha};
584pub use controls::{
585 anti_selection_area, button, checkbox, clear_control_templates, combo_box, context_menu,
586 create_default_button_presenter, create_default_checkbox_indicator_presenter,
587 create_default_dropdown_chevron_presenter, create_default_dropdown_field_presenter,
588 create_default_dropdown_option_row_presenter, create_default_radio_indicator_presenter,
589 create_default_slider_presenter, create_default_switch_indicator_presenter,
590 create_default_text_input_presenter, dialog, dropdown, form, get_control_templates, nav_link,
591 popup, progress_bar, radio_button, radio_group, selection_area, slider, switch, text_area,
592 text_input, use_control_templates, AntiSelectionArea, Button, ButtonColors, ButtonPresenter,
593 ButtonTemplate, ButtonVisualState, CheckState, Checkbox, CheckboxChangedEventArgs,
594 CheckboxIndicatorPresenter, CheckboxIndicatorTemplate, CheckboxIndicatorVisualState,
595 ClickEventArgs, ComboBox, ComboBoxChangedEventArgs, ComboBoxCommitMode, ComboBoxFilterMode,
596 ComboBoxItem, ContextMenu, ContextMenuAction, ContextMenuAppearance, ContextMenuItemAppearance,
597 ContextMenuVisibilityChangedEventArgs, ControlTemplateSet, DefaultButtonTemplate,
598 DefaultCheckboxIndicatorTemplate, DefaultDropdownChevronTemplate, DefaultDropdownFieldTemplate,
599 DefaultDropdownOptionRowTemplate, DefaultRadioIndicatorTemplate, DefaultSliderTemplate,
600 DefaultSwitchIndicatorTemplate, DefaultTextInputTemplate, Dialog, DialogAppearance,
601 DialogShownEventArgs, Dropdown, DropdownChangedEventArgs, DropdownChevronMetrics,
602 DropdownChevronPresenter, DropdownChevronTemplate, DropdownChevronVisualState, DropdownColors,
603 DropdownFieldMetrics, DropdownFieldPresenter, DropdownFieldTemplate, DropdownFieldVisualState,
604 DropdownItem, DropdownOptionRowMetrics, DropdownOptionRowPresenter, DropdownOptionRowTemplate,
605 DropdownOptionRowVisualState, DropdownSizing, Form, LabeledControlColors, LabeledControlSizing,
606 MenuItem, NavLink, NavigateEventArgs, OverlayBackdropAppearance, Popup, PopupAppearance,
607 PressableIndicatorMetrics, PressableIndicatorPresenter, PressableIndicatorVisualState,
608 ProgressBar, ProgressBarColors, ProgressBarSizing, RadioButton, RadioButtonChangedEventArgs,
609 RadioGroup, RadioGroupChangedEventArgs, RadioIndicatorPresenter, RadioIndicatorTemplate,
610 RadioIndicatorVisualState, SelectionArea, Slider, SliderChangedEventArgs, SliderColors,
611 SliderPresenter, SliderPresenterMetrics, SliderSizing, SliderTemplate, SliderVisualState,
612 SurfaceAppearance, Switch, SwitchChangedEventArgs, SwitchIndicatorPresenter,
613 SwitchIndicatorTemplate, SwitchIndicatorVisualState, TextArea, TextEditorSurface, TextInput,
614 TextInputColors, TextInputPresenter, TextInputTemplate, TextInputVisualState,
615 DEFAULT_BUTTON_TEMPLATE, DEFAULT_CHECKBOX_INDICATOR_TEMPLATE,
616 DEFAULT_DROPDOWN_CHEVRON_TEMPLATE, DEFAULT_DROPDOWN_FIELD_TEMPLATE,
617 DEFAULT_DROPDOWN_OPTION_ROW_TEMPLATE, DEFAULT_RADIO_INDICATOR_TEMPLATE,
618 DEFAULT_SLIDER_TEMPLATE, DEFAULT_SWITCH_INDICATOR_TEMPLATE, DEFAULT_TEXT_INPUT_TEMPLATE,
619};
620pub use debug::*;
621pub use drag_drop::{
622 DragCompletedEventArgs, DragDataObject, DragDropEffects, DragEventArgs, DragSession,
623 DropProposal,
624};
625pub use drawing::{DrawContext, Paint, Path};
626pub use event::{
627 FocusChangedEventArgs, GestureEventArgs, GestureEventKind, GestureEventPhase, GestureIntent,
628 KeyEventArgs, LongPressEventArgs, PointerButton, PointerButtons, PointerEventArgs, PointerType,
629 SelectionChangedEventArgs, TextChangedEventArgs, WheelEventArgs,
630};
631pub use external_drop::{ExternalDropEventArgs, ExternalDropItemInfo, ExternalDropItemKind};
632pub use fetch::{Fetch, FetchErrorEventArgs, FetchRequest, FetchResponse};
633pub use ffi::{
634 AlignItems, AlignSelf, BorderStyle, CursorStyle, FlexDirection, FlexWrap, GridUnit,
635 JustifyContent, KeyEventType, KeyModifier, ObjectFit, Orientation, PointerEventType,
636 PositionType, SemanticCheckedState, SemanticRole, TextAlign, TextOverflow, TextVerticalAlign,
637 Unit, Visibility,
638};
639pub use file::{
640 BrowserFile, BrowserFileWriter, File, FileCapabilities, FileErrorEventArgs, FileOpenEventArgs,
641 FileOpenRequest, FileReadChunk, FileRequestGuard, FileSaveMode, FileSaveRequest,
642 FileSaveResult, FileWorkerProcessProgress, FileWorkerProcessRequest, FileWorkerProcessResult,
643 FileWriteProgress,
644};
645pub use focus_visibility::show_keyboard_focus_for_key_event;
646pub use frame_scheduler::{mark_needs_commit, on_loaded, LoadedEventArgs};
647pub use frame_signal::{frame_time_signal, FrameTimeSignalHandle};
648pub use host_events::HostEventSubscription;
649pub use image_sampling::{ImageSampling, ImageSamplingMode};
650pub use logger::*;
651pub use navigation::*;
652pub use node::{
653 auto, column, custom_drawable, fill, flex_box, grid, image, pct, portal, px, row, scroll_box,
654 scroll_view, svg, text, viewport_height, viewport_width, virtual_list, Border, BoxStyleSurface,
655 Child, ChildContainerSurface, ContextMenuEventArgs, Corners, CustomDrawable,
656 DrawableInvalidator, EdgeInsets, FlexBox, FlexBoxSurface, FlexLayoutSurface, GradientStop,
657 Grid, GridTrack, HasFlexBoxRoot, HasTextNode, Image, ImageNode, LayoutSurface, Length, Node,
658 Portal, PresenterHostStyle, ScrollBar, ScrollBarStyle, ScrollBarVisibility, ScrollBox,
659 ScrollState, ScrollView, Shadow, Svg, SvgNode, Text, TextContentSurface, TextEditingSurface,
660 TextEventSurface, TextLayoutSurface, TextNode, TextSelectionSurface, TextSurface,
661 TextTypographySurface, ThemeBindable, VirtualList,
662};
663pub use persisted::*;
664pub use platform::*;
665#[doc(hidden)]
666pub use popup_presenter::{PopupPlacement, PopupPresenter};
667pub use signal::Subscription;
668pub use text::{
669 span, DynamicTextLayout, DynamicTextOverflow, RichText, RichTextSpan, TextLayout,
670 TextLayoutReadyEventArgs, TextMetrics,
671};
672pub use theme::{
673 bind_theme, current_theme, default_dark_theme, default_light_theme, generate_theme,
674 is_dark_mode, is_using_system_theme, set_accent_color, subscribe, use_custom_theme,
675 use_system_theme, Colors, ContextMenuItemTheme, ContextMenuTheme, Fonts, Spacing, Theme,
676 ToolTipTheme,
677};
678pub use timers::{cancel_timeout, set_timeout, TimerHandle};
679pub use tool_tip::ToolTip;
680pub use transitions::NodeTransitions;
681pub use typography::{
682 FontFace, FontFaceLoadedEventArgs, FontFamily, FontStack, FontStackLoadedEventArgs, FontStyle,
683 FontWeight, FontsLoadedEventArgs,
684};
685pub use viewport::{viewport_height_signal, viewport_width_signal, ViewportSignalHandle};
686pub use worker::{Worker, WorkerCompletedEventArgs, WorkerErrorEventArgs, WorkerProgressEventArgs};
687#[cfg(feature = "worker-runtime")]
688pub use worker_job::{WorkerJob, WorkerJobState};
689#[cfg(feature = "worker-runtime")]
690pub use worker_runtime::{
691 file_read_chunk, file_worker_write_chunk, reset_worker_runtime, WorkerRuntime,
692};