Skip to main content

embedded_gui/
lib.rs

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