Skip to main content

fui/
lib.rs

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