Skip to main content

Crate rdi_core

Crate rdi_core 

Source
Expand description

Platform-agnostic animation core for rusty-desktop-icons.

This crate defines the pure-Rust, cross-platform surface of the project:

The Windows Shell/COM backend, the worker thread, and the Python bindings live in sibling crates and depend on this one.

Everything in this crate is #![forbid(unsafe_code)] — the only place unsafe is allowed is inside rdi-platform-windows.

§Quick tour of curves

use rdi_core::{AnimationCurve, Curve, KeyframeInterp};

// Predefined easing.
let ease = Curve::ease_in_out();
assert!((ease.eval(0.5) - 0.5).abs() < 1e-3);

// Data-driven keyframes.
let keys = Curve::keyframes(
    vec![
        rdi_core::Keyframe::new(0.0, 0.0),
        rdi_core::Keyframe::new(0.5, 0.9),
        rdi_core::Keyframe::new(1.0, 1.0),
    ],
    KeyframeInterp::Linear,
).unwrap();
assert!(keys.eval(0.5) > 0.5);

// Function-generated curve — sampled once, then pure data at runtime.
let damped = Curve::from_curve_fn(
    |t| 1.0 - (1.0 - t).powi(3),
    32,
    KeyframeInterp::Linear,
).unwrap();
assert!(damped.eval(1.0) > 0.9);

Re-exports§

pub use backend::DesktopBackend;
pub use controller::DesktopController;
pub use controller::PreparedAnimation;
pub use curve::AnimationCurve;
pub use curve::BuiltinEasing;
pub use curve::Curve;
pub use curve::Keyframe;
pub use curve::KeyframeCurve;
pub use curve::KeyframeInterp;
pub use curve::MotionContext;
pub use duration::Duration;
pub use desktop::DesktopInfo;
pub use desktop::IconGrid;
pub use desktop::resolve_grid_targets;
pub use effect::Effect;
pub use effect::IconFrame;
pub use effect::ShaderPipeline;
pub use effect::ShaderProgram;
pub use effect_graph::DrawSpec;
pub use effect_graph::DrawTopology;
pub use effect_graph::EffectExecution;
pub use effect_graph::EffectParameter;
pub use effect_graph::EffectPass;
pub use effect_graph::EffectTarget;
pub use effect_graph::ParameterKind;
pub use effect_graph::PassBlend;
pub use error::CurveError;
pub use error::DesktopError;
pub use events::FinishReason;
pub use events::IconAnimationState;
pub use events::StartContext;
pub use events::StopMode;
pub use events::TickContext;
pub use geometry::Point;
pub use handle::AnimationHandle;
pub use handle::PreObservers;
pub use id::IconId;
pub use monitor::MonitorInfo;
pub use monitor::Rect;
pub use overlay_plan::FinalCommitOutcome;
pub use overlay_plan::IconBitmap;
pub use overlay_plan::IconLabel;
pub use overlay_plan::IconRenderPlan;
pub use overlay_plan::OverlayRenderOptions;
pub use overlay_plan::SnapshotFrame;
pub use overlay_plan::SnapshotIconGeometry;
pub use snapshot::IconSnapshot;
pub use scene::Canvas;
pub use scene::CapturedFrame;
pub use scene::RenderSession;
pub use scene::Scene;
pub use scene::SceneIcon;
pub use scene::SceneRenderer;
pub use spec::AnimationOptions;
pub use spec::AnimationPreset;
pub use spec::FolderFlagOp;
pub use spec::IconAnimationSpec;
pub use timeline::PlaybackHandle;
pub use timeline::PlaybackOutcome;
pub use timeline::TimelineCloseMode;
pub use timeline::TimelineSession;
pub use timeline::TimelineState;

Modules§

backend
The backend abstraction that the animation engine drives.
controller
Public DesktopController — the top-level entry point for the crate.
curve
Animation curves.
desktop
duration
Duration policies for a single icon’s animation.
effect
Device-independent shader bytecode and per-icon visual state.
effect_graph
Validated, stateless procedural render recipes.
error
Error types for the rdi-core crate.
events
Event and mode types passed to observer callbacks and returned from AnimationHandle queries.
fake
An in-memory DesktopBackend implementation for unit and integration tests.
geometry
Simple 2D integer geometry used throughout the crate.
handle
Public AnimationHandle and the shared state it exposes.
id
Opaque, backend-defined identifiers for desktop icons.
monitor
Monitor / display enumeration types.
overlay_plan
Animation-renderer-visible types.
procedural
Ready-made procedural curves.
scene
snapshot
Immutable snapshot of a single desktop icon’s observable state.
spec
Animation specification types.
timeline