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, NavigateEventArgs,
539        OverlayBackdropAppearance, Popup, PopupAppearance, PressableIndicatorMetrics,
540        PressableIndicatorPresenter, PressableIndicatorVisualState, ProgressBar, ProgressBarColors,
541        ProgressBarSizing, RadioButton, RadioButtonChangedEventArgs, RadioGroup,
542        RadioGroupChangedEventArgs, RadioIndicatorPresenter, RadioIndicatorTemplate,
543        RadioIndicatorVisualState, SelectionArea, Slider, SliderChangedEventArgs, SliderColors,
544        SliderPresenter, SliderPresenterMetrics, SliderSizing, SliderTemplate, SliderVisualState,
545        SurfaceAppearance, Switch, SwitchChangedEventArgs, SwitchIndicatorPresenter,
546        SwitchIndicatorTemplate, SwitchIndicatorVisualState, TabContentFactory, TabItem,
547        TabSelectionChangedEventArgs, TabView, TextArea, TextEditorSurface, TextInput,
548        TextInputColors, TextInputPresenter, TextInputTemplate, TextInputVisualState,
549        DEFAULT_BUTTON_TEMPLATE, DEFAULT_CHECKBOX_INDICATOR_TEMPLATE,
550        DEFAULT_DROPDOWN_CHEVRON_TEMPLATE, DEFAULT_DROPDOWN_FIELD_TEMPLATE,
551        DEFAULT_DROPDOWN_OPTION_ROW_TEMPLATE, DEFAULT_RADIO_INDICATOR_TEMPLATE,
552        DEFAULT_SLIDER_TEMPLATE, DEFAULT_SWITCH_INDICATOR_TEMPLATE, DEFAULT_TEXT_INPUT_TEMPLATE,
553    };
554    pub use crate::drag_drop::{
555        DragCompletedEventArgs, DragDataObject, DragDropEffects, DragEventArgs, DragSession,
556        DropProposal,
557    };
558    pub use crate::drawing::{DrawContext, Paint, Path};
559    pub use crate::event::{
560        FocusChangedEventArgs, GestureEventArgs, GestureEventKind, GestureEventPhase,
561        GestureIntent, KeyEventArgs, LongPressEventArgs, PointerButton, PointerButtons,
562        PointerEventArgs, PointerType, SelectionChangedEventArgs, TextChangedEventArgs,
563        WheelEventArgs,
564    };
565    pub use crate::external_drop::{
566        ExternalDropEventArgs, ExternalDropItemInfo, ExternalDropItemKind,
567    };
568    pub use crate::fetch::{Fetch, FetchErrorEventArgs, FetchRequest, FetchResponse};
569    pub use crate::ffi::{
570        AlignItems, AlignSelf, BorderStyle, CursorStyle, FlexDirection, FlexWrap, GridUnit,
571        JustifyContent, KeyEventType, KeyModifier, ObjectFit, Orientation, PointerEventType,
572        PositionType, SemanticCheckedState, SemanticRole, TextAlign, TextOverflow,
573        TextVerticalAlign, Unit, Visibility,
574    };
575    pub use crate::file::{
576        BrowserFile, BrowserFileWriter, File, FileCapabilities, FileErrorEventArgs,
577        FileOpenEventArgs, FileOpenRequest, FileReadChunk, FileRequestGuard, FileSaveMode,
578        FileSaveRequest, FileSaveResult, FileWorkerProcessProgress, FileWorkerProcessRequest,
579        FileWorkerProcessResult, FileWriteProgress,
580    };
581    pub use crate::focus_visibility::show_keyboard_focus_for_key_event;
582    pub use crate::frame_scheduler::{mark_needs_commit, on_loaded, LoadedEventArgs};
583    pub use crate::fui_component;
584    #[cfg(feature = "worker-runtime")]
585    pub use crate::fui_worker;
586    pub use crate::host_events::HostEventSubscription;
587    pub use crate::image_sampling::{ImageSampling, ImageSamplingMode};
588    pub use crate::logger;
589    pub use crate::navigation;
590    pub use crate::node::{
591        auto, column, custom_drawable, fill, flex_box, grid, image, pct, portal, px, row,
592        scroll_box, scroll_view, svg, text, viewport_height, viewport_width, virtual_list, Border,
593        BoxStyleSurface, Child, ChildContainerSurface, ContextMenuEventArgs, Corners,
594        CustomDrawable, DrawableInvalidator, EdgeInsets, FlexBox, FlexBoxSurface,
595        FlexLayoutSurface, GradientStop, Grid, GridTrack, HasFlexBoxRoot, HasTextNode, Image,
596        ImageNode, LayoutSurface, Length, Node, Portal, PresenterHostStyle, ScrollBar,
597        ScrollBarStyle, ScrollBarVisibility, ScrollBox, ScrollState, ScrollView, Shadow, Svg,
598        SvgNode, Text, TextContentSurface, TextEditingSurface, TextEventSurface, TextLayoutSurface,
599        TextNode, TextSelectionSurface, TextSurface, TextTypographySurface, ThemeBindable,
600        VirtualList,
601    };
602    pub use crate::persisted;
603    pub use crate::platform;
604    pub use crate::popup_presenter::PopupPlacement;
605    pub use crate::retained_view::{retained_view, RetainedView};
606    pub use crate::signal::Subscription;
607    pub use crate::text::{
608        span, DynamicTextLayout, DynamicTextOverflow, RichText, RichTextSpan, TextLayout,
609        TextLayoutReadyEventArgs, TextMetrics,
610    };
611    pub use crate::theme::{
612        bind_theme, current_theme, default_dark_theme, default_light_theme, generate_theme,
613        is_dark_mode, is_using_system_theme, set_accent_color, subscribe, use_custom_theme,
614        use_system_theme, Colors, ContextMenuItemTheme, ContextMenuTheme, Fonts, Spacing, Theme,
615        ToolTipTheme,
616    };
617    pub use crate::timers::{cancel_timeout, set_timeout, TimerHandle};
618    pub use crate::tool_tip::ToolTip;
619    pub use crate::transitions::NodeTransitions;
620    pub use crate::typography::{
621        FontFace, FontFaceLoadedEventArgs, FontFamily, FontStack, FontStackLoadedEventArgs,
622        FontStyle, FontWeight, FontsLoadedEventArgs,
623    };
624    pub use crate::viewport::{
625        viewport_height_signal, viewport_width_signal, ViewportSignalHandle,
626    };
627    pub use crate::worker::{
628        Worker, WorkerCompletedEventArgs, WorkerErrorEventArgs, WorkerProgressEventArgs,
629    };
630    #[cfg(feature = "worker-runtime")]
631    pub use crate::worker_job::{WorkerJob, WorkerJobState};
632    #[cfg(feature = "worker-runtime")]
633    pub use crate::worker_runtime::{file_read_chunk, file_worker_write_chunk, WorkerRuntime};
634    pub use crate::{children, fui_app, fui_managed_app, rich_text, tab_items, ui, Configure};
635}
636
637pub use animation::{
638    animate_color, animate_color_with, animate_float, animate_float_with, get_animation_manager,
639    reset_animations, tick_animations, Animation, AnimationManager, AnimationTiming, Easing,
640    Easings,
641};
642pub use app::{Application, ApplicationRegistration, ManagedApplication, PageZoomMode};
643pub use assets::*;
644pub use bitmap::{Bitmap, BitmapTextReadyEventArgs};
645pub use bridge_callbacks::current_route;
646pub use color::{hsl_to_color, mix_color, rgb, rgba, with_alpha};
647pub use controls::{
648    anti_selection_area, button, checkbox, combo_box, context_menu,
649    create_default_button_presenter, create_default_checkbox_indicator_presenter,
650    create_default_dropdown_chevron_presenter, create_default_dropdown_field_presenter,
651    create_default_dropdown_option_row_presenter, create_default_radio_indicator_presenter,
652    create_default_slider_presenter, create_default_switch_indicator_presenter,
653    create_default_text_input_presenter, dialog, dropdown, form, nav_link, popup, progress_bar,
654    radio_button, radio_group, selection_area, slider, switch, tab_item, tab_view, text_area,
655    text_input, AntiSelectionArea, Button, ButtonColors, ButtonPresenter, ButtonTemplate,
656    ButtonVisualState, CheckState, Checkbox, CheckboxChangedEventArgs, CheckboxIndicatorPresenter,
657    CheckboxIndicatorTemplate, CheckboxIndicatorVisualState, ClickEventArgs, ComboBox,
658    ComboBoxChangedEventArgs, ComboBoxCommitMode, ComboBoxFilterMode, ComboBoxItem, ContextMenu,
659    ContextMenuAction, ContextMenuAppearance, ContextMenuItemAppearance,
660    ContextMenuVisibilityChangedEventArgs, DefaultButtonTemplate, DefaultCheckboxIndicatorTemplate,
661    DefaultDropdownChevronTemplate, DefaultDropdownFieldTemplate, DefaultDropdownOptionRowTemplate,
662    DefaultRadioIndicatorTemplate, DefaultSliderTemplate, DefaultSwitchIndicatorTemplate,
663    DefaultTextInputTemplate, Dialog, DialogAppearance, DialogShownEventArgs, Dropdown,
664    DropdownChangedEventArgs, DropdownChevronMetrics, DropdownChevronPresenter,
665    DropdownChevronTemplate, DropdownChevronVisualState, DropdownColors, DropdownFieldMetrics,
666    DropdownFieldPresenter, DropdownFieldTemplate, DropdownFieldVisualState, DropdownItem,
667    DropdownOptionRowMetrics, DropdownOptionRowPresenter, DropdownOptionRowTemplate,
668    DropdownOptionRowVisualState, DropdownSizing, Form, LabeledControlColors, LabeledControlSizing,
669    MenuItem, NavLink, NavigateEventArgs, OverlayBackdropAppearance, Popup, PopupAppearance,
670    PressableIndicatorMetrics, PressableIndicatorPresenter, PressableIndicatorVisualState,
671    ProgressBar, ProgressBarColors, ProgressBarSizing, RadioButton, RadioButtonChangedEventArgs,
672    RadioGroup, RadioGroupChangedEventArgs, RadioIndicatorPresenter, RadioIndicatorTemplate,
673    RadioIndicatorVisualState, SelectionArea, Slider, SliderChangedEventArgs, SliderColors,
674    SliderPresenter, SliderPresenterMetrics, SliderSizing, SliderTemplate, SliderVisualState,
675    SurfaceAppearance, Switch, SwitchChangedEventArgs, SwitchIndicatorPresenter,
676    SwitchIndicatorTemplate, SwitchIndicatorVisualState, TabContentFactory, TabItem,
677    TabSelectionChangedEventArgs, TabView, TextArea, TextEditorSurface, TextInput, TextInputColors,
678    TextInputPresenter, TextInputTemplate, TextInputVisualState, DEFAULT_BUTTON_TEMPLATE,
679    DEFAULT_CHECKBOX_INDICATOR_TEMPLATE, DEFAULT_DROPDOWN_CHEVRON_TEMPLATE,
680    DEFAULT_DROPDOWN_FIELD_TEMPLATE, DEFAULT_DROPDOWN_OPTION_ROW_TEMPLATE,
681    DEFAULT_RADIO_INDICATOR_TEMPLATE, DEFAULT_SLIDER_TEMPLATE, DEFAULT_SWITCH_INDICATOR_TEMPLATE,
682    DEFAULT_TEXT_INPUT_TEMPLATE,
683};
684pub use debug::*;
685pub use drag_drop::{
686    DragCompletedEventArgs, DragDataObject, DragDropEffects, DragEventArgs, DragSession,
687    DropProposal,
688};
689pub use drawing::{DrawContext, Paint, Path};
690pub use event::{
691    FocusChangedEventArgs, GestureEventArgs, GestureEventKind, GestureEventPhase, GestureIntent,
692    KeyEventArgs, LongPressEventArgs, PointerButton, PointerButtons, PointerEventArgs, PointerType,
693    SelectionChangedEventArgs, TextChangedEventArgs, WheelEventArgs,
694};
695pub use external_drop::{ExternalDropEventArgs, ExternalDropItemInfo, ExternalDropItemKind};
696pub use fetch::{Fetch, FetchErrorEventArgs, FetchRequest, FetchResponse};
697pub use ffi::{
698    AlignItems, AlignSelf, BorderStyle, CursorStyle, FlexDirection, FlexWrap, GridUnit,
699    JustifyContent, KeyEventType, KeyModifier, ObjectFit, Orientation, PointerEventType,
700    PositionType, SemanticCheckedState, SemanticRole, TextAlign, TextOverflow, TextVerticalAlign,
701    Unit, Visibility,
702};
703pub use file::{
704    BrowserFile, BrowserFileWriter, File, FileCapabilities, FileErrorEventArgs, FileOpenEventArgs,
705    FileOpenRequest, FileReadChunk, FileRequestGuard, FileSaveMode, FileSaveRequest,
706    FileSaveResult, FileWorkerProcessProgress, FileWorkerProcessRequest, FileWorkerProcessResult,
707    FileWriteProgress,
708};
709pub use focus_visibility::show_keyboard_focus_for_key_event;
710pub use frame_scheduler::{mark_needs_commit, on_loaded, LoadedEventArgs};
711pub use frame_signal::{frame_time_signal, FrameTimeSignalHandle};
712pub use host_events::HostEventSubscription;
713pub use image_sampling::{ImageSampling, ImageSamplingMode};
714pub use logger::*;
715pub use navigation::*;
716pub use node::{
717    auto, column, custom_drawable, fill, flex_box, grid, image, pct, portal, px, row, scroll_box,
718    scroll_view, svg, text, viewport_height, viewport_width, virtual_list, Border, BoxStyleSurface,
719    Child, ChildContainerSurface, ContextMenuEventArgs, Corners, CustomDrawable,
720    DrawableInvalidator, EdgeInsets, FlexBox, FlexBoxSurface, FlexLayoutSurface, GradientStop,
721    Grid, GridTrack, HasFlexBoxRoot, HasTextNode, Image, ImageNode, LayoutSurface, Length, Node,
722    Portal, PresenterHostStyle, ScrollBar, ScrollBarStyle, ScrollBarVisibility, ScrollBox,
723    ScrollState, ScrollView, Shadow, Svg, SvgNode, Text, TextContentSurface, TextEditingSurface,
724    TextEventSurface, TextLayoutSurface, TextNode, TextSelectionSurface, TextSurface,
725    TextTypographySurface, ThemeBindable, VirtualList,
726};
727pub use persisted::*;
728pub use platform::*;
729#[doc(hidden)]
730pub use popup_presenter::{PopupPlacement, PopupPresenter};
731pub use retained_view::{retained_view, RetainedView};
732pub use signal::Subscription;
733pub use text::{
734    span, DynamicTextLayout, DynamicTextOverflow, RichText, RichTextSpan, TextLayout,
735    TextLayoutReadyEventArgs, TextMetrics,
736};
737pub use theme::{
738    bind_theme, current_theme, default_dark_theme, default_light_theme, generate_theme,
739    is_dark_mode, is_using_system_theme, set_accent_color, subscribe, use_custom_theme,
740    use_system_theme, Colors, ContextMenuItemTheme, ContextMenuTheme, Fonts, Spacing, Theme,
741    ToolTipTheme,
742};
743pub use timers::{cancel_timeout, set_timeout, TimerHandle};
744pub use tool_tip::ToolTip;
745pub use transitions::NodeTransitions;
746pub use typography::{
747    FontFace, FontFaceLoadedEventArgs, FontFamily, FontStack, FontStackLoadedEventArgs, FontStyle,
748    FontWeight, FontsLoadedEventArgs,
749};
750pub use viewport::{viewport_height_signal, viewport_width_signal, ViewportSignalHandle};
751pub use worker::{Worker, WorkerCompletedEventArgs, WorkerErrorEventArgs, WorkerProgressEventArgs};
752#[cfg(feature = "worker-runtime")]
753pub use worker_job::{WorkerJob, WorkerJobState};
754#[cfg(feature = "worker-runtime")]
755pub use worker_runtime::{
756    file_read_chunk, file_worker_write_chunk, reset_worker_runtime, WorkerRuntime,
757};