Skip to main content

freya_core/
lib.rs

1pub mod accessibility;
2pub mod animation_clock;
3pub mod current_context;
4pub mod data;
5pub mod debug;
6pub mod diff_key;
7pub mod element;
8pub mod elements;
9pub mod event_handler;
10pub mod events;
11pub mod events_combos;
12pub mod extended_hashmap;
13pub mod helpers;
14pub mod hooks;
15pub mod io;
16pub mod layers;
17pub mod lifecycle;
18pub mod metrics;
19pub mod node_id;
20pub mod path_element;
21pub mod platform;
22pub mod reactive_context;
23pub mod render_pipeline;
24pub mod rendering_ticker;
25pub mod runner;
26pub mod scope;
27pub mod scope_id;
28pub mod style;
29pub mod text_cache;
30pub mod tree;
31pub mod tree_layout_adapter;
32pub mod user_event;
33
34pub use tiny_cache::{
35    fifo_cache,
36    lru_cache,
37};
38
39#[cfg(feature = "hotreload")]
40pub mod hotreload {
41    pub use dioxus_devtools::*;
42}
43
44/// Used by all end users.
45pub mod prelude {
46    pub use bytes::Bytes;
47    pub use cursor_icon::CursorIcon;
48    pub use keyboard_types::{
49        Code,
50        Key,
51        Modifiers,
52        NamedKey,
53    };
54
55    pub use crate::{
56        accessibility::{
57            focus::*,
58            focus_strategy::*,
59            focusable::*,
60            id::{
61                AccessibilityId,
62                AccessibilityRole,
63            },
64            screen_reader::*,
65        },
66        animation_clock::AnimationClock,
67        data::*,
68        debug::*,
69        diff_key::DiffKey,
70        element::{
71            App,
72            Component,
73            ComponentKey,
74            ComponentOwned,
75            Element,
76            EventHandlers,
77            IntoElement,
78            RenderContext,
79        },
80        elements::{
81            extensions::*,
82            image::{
83                AspectRatio,
84                ImageCover,
85                SamplingMode,
86                image,
87            },
88            label::{
89                Label,
90                TextWidth,
91                label,
92            },
93            paragraph::{
94                Paragraph,
95                ParagraphHolder,
96                Span,
97                paragraph,
98            },
99            rect::{
100                Rect,
101                rect,
102            },
103        },
104        event_handler::{
105            Callback,
106            EventHandler,
107            NoArgCallback,
108        },
109        events::{
110            data::*,
111            modifiers::*,
112            *,
113        },
114        events_combos::*,
115        hooks::{
116            previous_and_current::*,
117            use_id::*,
118        },
119        io::{
120            thread::thread,
121            timer::timer,
122        },
123        layers::Layer,
124        lifecycle::{
125            base::*,
126            context::*,
127            effect::*,
128            future_task::*,
129            global_context::*,
130            memo::*,
131            reactive::*,
132            readable::*,
133            state::*,
134            task::*,
135            writable::*,
136            writable_setter::*,
137            writable_utils::*,
138        },
139        platform::*,
140        reactive_context::ReactiveContext,
141        rendering_ticker::RenderingTicker,
142        scope_id::ScopeId,
143        style::{
144            border::*,
145            color::*,
146            corner_radius::*,
147            cursor::*,
148            fill::*,
149            font_feature::*,
150            font_size::*,
151            font_slant::*,
152            font_weight::*,
153            font_width::*,
154            gradient::*,
155            letter_spacing::*,
156            render_callback::{
157                RenderCallback,
158                RenderContext as FillRenderContext,
159                RenderTarget,
160            },
161            scale::*,
162            shader::*,
163            shadow::*,
164            text_align::*,
165            text_decoration::*,
166            text_height::*,
167            text_overflow::*,
168            text_shadow::*,
169            transform_origin::*,
170            vertical_align::*,
171        },
172        user_event::{
173            GlobalUserEvent,
174            UserEvent,
175        },
176    };
177}
178
179/// Used by renderers such as freya-testing, freya-winit or just integration crates.
180pub mod integration {
181    pub use ragnarok::NodesState;
182    pub use rustc_hash::*;
183
184    pub use crate::{
185        accessibility::{
186            dirty_nodes::*,
187            focus_strategy::*,
188            id::*,
189            ime::*,
190            screen_reader::*,
191            tree::*,
192        },
193        animation_clock::{
194            AnimationClock,
195            New,
196        },
197        data::*,
198        element::*,
199        elements::extensions::*,
200        events::{
201            data::*,
202            executor::*,
203            measurer::*,
204            modifiers::*,
205            name::*,
206            platform::*,
207        },
208        lifecycle::{
209            global_context::GlobalContexts,
210            state::State,
211            writable_utils::WritableUtils,
212        },
213        node_id::NodeId,
214        platform::*,
215        render_pipeline::RenderPipeline,
216        rendering_ticker::*,
217        runner::{
218            Runner,
219            TasksPollStage,
220        },
221        scope_id::ScopeId,
222        style::default_fonts::{
223            default_fonts,
224            default_monospace_fonts,
225        },
226        tree::{
227            DiffModifies,
228            Tree,
229        },
230        user_event::*,
231    };
232}