Skip to main content

embedded_gui/
lib.rs

1#![no_std]
2
3#[cfg(feature = "std")]
4extern crate std;
5
6pub mod animation;
7pub mod animation_timeline;
8pub mod animation_timing;
9pub mod block;
10pub mod cinematic;
11pub mod completion;
12pub mod context;
13pub mod display_backend;
14#[cfg(feature = "embassy")]
15pub mod embassy;
16pub mod font;
17pub mod framebuffer;
18pub mod geometry;
19pub mod haptics;
20pub mod image;
21pub mod input;
22#[cfg(any(feature = "embedded-text", feature = "embedded-layout"))]
23pub mod interop;
24pub mod layout;
25mod math;
26pub mod palette;
27pub mod present;
28pub mod render;
29pub mod screen;
30pub mod screen_transition;
31pub mod state;
32pub mod style;
33pub mod swapchain;
34#[cfg(feature = "std")]
35pub mod test_buffer;
36pub mod text;
37pub mod transition_preset;
38pub mod visual_widgets;
39pub mod widget;
40pub mod widget_animation;
41pub mod widgets;
42
43pub use haptics::{HapticPattern, HapticSequencer};
44
45pub use visual_widgets::{BusyWheel, GaugeWidget};
46#[cfg(feature = "embedded-dsp")]
47pub use visual_widgets::{SpectrumAnalyzerWidget, TouchInputFilter};
48
49pub use animation::{
50    Animation, AnimationError, AnimationHandlers, AnimationId, AnimationManager,
51    AnimationManagerCallbacks, AnimationState, Easing, InertiaAnimator, PathAnimator, PathPoint,
52    RepeatMode, SpringAnimator, Timer, Tween, apply_easing,
53};
54pub use animation_timeline::{
55    AnimationGroup, AnimationSequence, ComposedAnimation, ComposedAnimationCallbacks,
56    ComposedAnimationPlayer, ComposedAnimationStatus, CompositionControls, CompositionMode,
57    Keyframe, KeyframeTrack, KeyframeTrackCallbacks, SequencePlayer, SequencePlayerStatus,
58    SequenceRepeatMode, TimelineError, TimelineStep,
59};
60pub use animation_timing::{
61    DEFAULT_DURATION_MS, FRAME_INTERVAL_MS, MOOOK_DURATION_MS, NORMALIZED_MAX,
62    PORT_HOLE_DURATION_MS, SHUTTER_DURATION_MS, interpolate_moook, moook_curve, moook_duration_ms,
63    timing_half_phase, timing_scaled, timing_shutter_phase,
64};
65pub use block::Block;
66pub use cinematic::{
67    CardDeckDirection, CardDeckState, CardStory, CardStoryTransition, CinematicPreset,
68    GlanceTileSpec, MotionTokens, PeekRevealSpec, TimelineMotionPreset, animate_glance_focus,
69    animate_peek_reveal, apply_carddeck_visibility, setup_card_story, setup_launcher_glance,
70    setup_launcher_glance_with_tokens, setup_peek_timeline, setup_peek_timeline_with_tokens,
71};
72pub use completion::{CompletionSlot, WaitTransfer, WaitTransferFuture};
73pub use context::{
74    GuiContext, GuiError, KeyBindingAction, PressTiming, WidgetKeyBindings, WidgetKeyInputPolicy,
75};
76pub use display_backend::{
77    AsyncDmaTransfer, DisplayBackend, DisplayError, DisplayRegion, DmaTransfer, SimulatorBackend,
78    TransferError,
79};
80#[cfg(feature = "embassy")]
81pub use embassy::{EmbassyWaitTransfer, EmbassyWaitTransferFuture, FrameClock};
82pub use embedded_graphics_framebuf::{
83    FrameBuf,
84    backends::{DMACapableFrameBufferBackend, EndianCorrectedBuffer, EndianCorrection},
85};
86pub use font::FontId;
87pub use framebuffer::{Framebuffer, FramebufferGray8, FramebufferRgba8888, Rgba8888};
88pub use geometry::{DirtyTracker, EdgeInsets, Rect};
89#[cfg(all(feature = "std", feature = "image-decode"))]
90pub use image::{
91    BasicImageDecoder, EncodedImageFormat, ImageDecodeError, ImageDecoder, decode_image_auto,
92    decode_image_with, decode_ppm_ascii,
93};
94pub use image::{
95    ImageAtlas, ImageAtlasEntry, ImageFit, ImageRef, ReelFrame, ReelPlayer, SpriteSheet, TileMode,
96    TileRef,
97};
98pub use input::{
99    EventPhaseMask, InputEvent, PointerButton, PointerState, UiEvent, UiEventFilter,
100    WidgetDispatchPolicy, WidgetEvent, WidgetEventFilter, WidgetEventKind,
101};
102pub use layout::{Align, Axis, Constraint, LayoutItem, Length, LinearLayout};
103pub use palette::{DisplayMode, DisplayPalette, InkRole, RoleColors};
104pub use present::PresentRegion;
105pub use render::{
106    AntiAliasMode, Blend, BlendMode, CHAR_HEIGHT, CHAR_WIDTH, ColorFormat, Compositor, Dither,
107    EllipsisMode, LayerState, PixelRead, RenderBackendCaps, RenderCtx, RenderQuality, StrokeCap,
108    StrokeJoin, StrokeStyle, TextAlign, TextMetrics, TextOverflow, TextOverflowPolicy, TextStyle,
109    TextWrap, Transform2D, VerticalAlign,
110};
111pub use screen::{
112    Screen, ScreenCommand, ScreenId, ScreenLifecycleEvent, ScreenStack, ScreenStackError,
113    ScreenTransition,
114};
115pub use screen_transition::{
116    ActiveScreenTransition, ScreenTransitionEffect, ScreenTransitionOrigin, ScreenTransitionRunner,
117    ScreenTransitionSample, ScreenTransitionSpec, composite_framebuffer_fade,
118    fade_outgoing_opacity, render_transition_pair,
119};
120pub use state::{FeedTimelineState, ListState, ScrollState, SliderState, TabsState};
121pub use style::{
122    AlphaLinearGradient, AlphaRadialGradient, Border, GradientDirection, LinearGradient, Shadow,
123    StateStyle, Style, StyleTransition, Theme, VisualState, WidgetStyle, lerp_style,
124};
125pub use swapchain::{StandardSwapChain, SwapChain};
126#[cfg(feature = "triple-buffering")]
127pub use swapchain::{StandardTripleSwapChain, TripleSwapChain};
128#[cfg(feature = "std")]
129pub use test_buffer::{LayerCanvas, TestBuffer};
130pub use text::{
131    BasicTextShaper, Line, ShapedGlyph, ShapingConfig, Span, Text, TextDirection, TextShaper,
132};
133pub use transition_preset::TransitionPreset;
134pub use widget::{
135    EventContext, EventPhase, EventPolicy, FocusGroupId, MenuContract, StatefulWidget,
136    StyleClassId, WidgetFlags, WidgetId,
137};
138pub use widget_animation::presets;
139pub use widget_animation::{
140    AnimatedProperty, AnimationConflictPolicy, BindingSnapshot, WidgetAnimationCallbacks,
141    WidgetAnimationError, WidgetAnimator, WidgetKeyframeState, WidgetPropertyKeyframe,
142};
143pub use widgets::{
144    ChartMode, KeyboardLayout, NotificationLevel, SurfaceState, WidgetKind, WidgetNode,
145};
146
147pub mod prelude {
148    pub use crate::{
149        ActiveScreenTransition, Align, AlphaLinearGradient, AlphaRadialGradient, AnimatedProperty,
150        Animation, AnimationConflictPolicy, AnimationError, AnimationGroup, AnimationHandlers,
151        AnimationId, AnimationManager, AnimationManagerCallbacks, AnimationSequence,
152        AnimationState, AntiAliasMode, Axis, BasicTextShaper, BindingSnapshot, Blend, BlendMode,
153        Block, Border, CardDeckDirection, CardDeckState, CardStory, CardStoryTransition, ChartMode,
154        CinematicPreset, ColorFormat, ComposedAnimation, ComposedAnimationCallbacks,
155        ComposedAnimationPlayer, ComposedAnimationStatus, CompositionControls, CompositionMode,
156        Compositor, Constraint, DirtyTracker, Dither, Easing, EdgeInsets, EllipsisMode,
157        EventContext, EventPhase, EventPhaseMask, EventPolicy, FeedTimelineState, FocusGroupId,
158        FontId, Framebuffer, FramebufferGray8, FramebufferRgba8888, GlanceTileSpec,
159        GradientDirection, GuiContext, GuiError, HapticPattern, HapticSequencer, ImageAtlas,
160        ImageAtlasEntry, ImageFit, ImageRef, InertiaAnimator, InputEvent, KeyBindingAction,
161        KeyboardLayout, Keyframe, KeyframeTrack, KeyframeTrackCallbacks, LayerState, LayoutItem,
162        Length, Line, LinearGradient, LinearLayout, ListState, MenuContract, MotionTokens,
163        NotificationLevel, PathAnimator, PathPoint, PeekRevealSpec, PixelRead, PointerButton,
164        PointerState, PresentRegion, PressTiming, Rect, ReelFrame, ReelPlayer, RenderBackendCaps,
165        RenderCtx, RenderQuality, RepeatMode, Rgba8888, Screen, ScreenCommand, ScreenId,
166        ScreenLifecycleEvent, ScreenStack, ScreenStackError, ScreenTransition,
167        ScreenTransitionEffect, ScreenTransitionOrigin, ScreenTransitionRunner,
168        ScreenTransitionSample, ScreenTransitionSpec, ScrollState, SequencePlayer,
169        SequencePlayerStatus, SequenceRepeatMode, Shadow, ShapedGlyph, ShapingConfig, SliderState,
170        Span, SpringAnimator, SpriteSheet, StateStyle, StatefulWidget, StrokeCap, StrokeJoin,
171        StrokeStyle, Style, StyleClassId, StyleTransition, SurfaceState, TabsState, Text,
172        TextAlign, TextDirection, TextMetrics, TextOverflow, TextOverflowPolicy, TextShaper,
173        TextStyle, TextWrap, Theme, TileMode, TileRef, TimelineError, TimelineMotionPreset,
174        TimelineStep, Timer, Transform2D, TransitionPreset, Tween, UiEvent, UiEventFilter,
175        VerticalAlign, VisualState, WidgetAnimationCallbacks, WidgetAnimationError, WidgetAnimator,
176        WidgetDispatchPolicy, WidgetEvent, WidgetEventFilter, WidgetEventKind, WidgetFlags,
177        WidgetId, WidgetKeyBindings, WidgetKeyInputPolicy, WidgetKeyframeState, WidgetKind,
178        WidgetNode, WidgetPropertyKeyframe, WidgetStyle, animate_glance_focus, animate_peek_reveal,
179        apply_carddeck_visibility, apply_easing, lerp_style, presets, render_transition_pair,
180        setup_card_story, setup_launcher_glance, setup_launcher_glance_with_tokens,
181        setup_peek_timeline, setup_peek_timeline_with_tokens,
182    };
183
184    #[cfg(all(feature = "std", feature = "image-decode"))]
185    pub use crate::{
186        BasicImageDecoder, EncodedImageFormat, ImageDecodeError, ImageDecoder, LayerCanvas,
187        TestBuffer, decode_image_auto, decode_image_with, decode_ppm_ascii,
188    };
189
190    #[cfg(all(feature = "std", not(feature = "image-decode")))]
191    pub use crate::{LayerCanvas, TestBuffer};
192}