Skip to main content

freya_core/
lib.rs

1pub mod accessibility;
2pub mod animation_clock;
3pub mod current_context;
4pub mod cursor;
5pub mod data;
6pub mod debug;
7pub mod diff_key;
8pub mod element;
9pub mod elements;
10pub mod event_handler;
11pub mod events;
12pub mod events_combos;
13pub mod extended_hashmap;
14pub mod fifo_cache;
15pub mod helpers;
16pub mod hooks;
17pub mod layers;
18pub mod lifecycle;
19pub mod lru_cache;
20pub mod node_id;
21pub mod notify;
22pub mod path_element;
23pub mod platform;
24pub mod reactive_context;
25pub mod render_pipeline;
26pub mod rendering_ticker;
27pub mod runner;
28pub mod scope;
29pub mod scope_id;
30pub mod style;
31pub mod text_cache;
32pub mod tree;
33pub mod tree_layout_adapter;
34pub mod user_event;
35
36/// Used by all end users.
37pub mod prelude {
38    pub use bytes::Bytes;
39    pub use cursor_icon::CursorIcon;
40    pub use keyboard_types::{
41        Code,
42        Key,
43        Modifiers,
44        NamedKey,
45    };
46
47    pub use crate::{
48        accessibility::{
49            focus::*,
50            focus_strategy::*,
51            focusable::*,
52            id::{
53                AccessibilityId,
54                AccessibilityRole,
55            },
56            screen_reader::*,
57        },
58        animation_clock::AnimationClock,
59        cursor::*,
60        data::*,
61        debug::*,
62        diff_key::DiffKey,
63        element::RenderContext,
64        element::{
65            App,
66            Component,
67            ComponentKey,
68            ComponentOwned,
69            Element,
70            IntoElement,
71        },
72        elements::{
73            extensions::*,
74            image::{
75                AspectRatio,
76                ImageCover,
77                // The image element is hidden on purpose as its a "low level" element, users should rather use the `ImageViewer` component.
78                SamplingMode,
79            },
80            label::{
81                Label,
82                TextWidth,
83                label,
84            },
85            paragraph::{
86                Paragraph,
87                ParagraphHolder,
88                Span,
89                paragraph,
90            },
91            rect::{
92                Rect,
93                rect,
94            },
95            svg::{
96                Svg,
97                SvgBytes,
98                svg,
99            },
100        },
101        event_handler::{
102            Callback,
103            EventHandler,
104            NoArgCallback,
105        },
106        events::data::*,
107        events::*,
108        events_combos::*,
109        hooks::previous_and_current::*,
110        hooks::use_id::*,
111        layers::Layer,
112        lifecycle::{
113            base::*,
114            context::*,
115            effect::*,
116            future_task::*,
117            memo::*,
118            reactive::*,
119            readable::*,
120            state::*,
121            task::*,
122            writable::*,
123        },
124        platform::*,
125        reactive_context::ReactiveContext,
126        rendering_ticker::RenderingTicker,
127        scope_id::ScopeId,
128        style::{
129            border::*,
130            color::*,
131            corner_radius::*,
132            cursor::*,
133            fill::*,
134            font_slant::*,
135            font_weight::*,
136            font_width::*,
137            gradient::*,
138            scale::*,
139            shadow::*,
140            text_align::*,
141            text_decoration::*,
142            text_height::*,
143            text_overflow::*,
144            text_shadow::*,
145            vertical_align::*,
146        },
147        user_event::UserEvent,
148    };
149}
150
151/// Used by renderers such as freya-testing, freya-winit or just integration crates.
152pub mod integration {
153    pub use rustc_hash::*;
154
155    pub use crate::{
156        accessibility::{
157            dirty_nodes::*,
158            focus_strategy::*,
159            id::*,
160            screen_reader::*,
161            tree::*,
162        },
163        animation_clock::AnimationClock,
164        data::*,
165        element::*,
166        elements::extensions::*,
167        events::{
168            data::*,
169            executor::*,
170            measurer::*,
171            name::*,
172            platform::*,
173        },
174        lifecycle::state::State,
175        node_id::NodeId,
176        platform::*,
177        render_pipeline::RenderPipeline,
178        rendering_ticker::*,
179        runner::Runner,
180        scope_id::ScopeId,
181        style::default_fonts::default_fonts,
182        tree::{
183            DiffModifies,
184            Tree,
185        },
186        user_event::*,
187    };
188}