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