Skip to main content

rdi_platform_windows/
lib.rs

1//! Windows Shell/COM backend for `rusty-desktop-icons`.
2//!
3//! This crate provides [`WindowsBackend`], the concrete
4//! [`rdi_core::DesktopBackend`] driving the real Windows desktop through
5//! `IFolderView2`. Everything unsafe lives here — `rdi-core` itself
6//! `forbid`s `unsafe_code`.
7//!
8//! # Usage
9//!
10//! ```no_run
11//! use rdi_core::DesktopController;
12//! use rdi_platform_windows::WindowsBackend;
13//!
14//! let ctrl = DesktopController::new(WindowsBackend::new())?;
15//! let icons = ctrl.list_icons()?;
16//! println!("{} icons on the desktop", icons.len());
17//! # Ok::<(), rdi_core::DesktopError>(())
18//! ```
19//!
20//! # Threading
21//!
22//! `WindowsBackend` initialises COM (STA) lazily on the thread that
23//! first calls a `DesktopBackend` method, which — under normal use — is
24//! the engine's dedicated worker thread. Do not construct two backends
25//! on the same thread.
26//!
27//! # Modules
28//!
29//! * [`ids`] — hex-encoded UTF-16 identifier scheme (compatible with
30//!   the legacy Python extension).
31//! * `com` — `IFolderView2` acquisition and caching (crate-private).
32//! * `pidl` — RAII wrappers for shell-allocated memory (crate-private).
33//! * `backend` — [`WindowsBackend`] itself (crate-private module, type re-exported).
34
35#![cfg(windows)]
36#![deny(unsafe_op_in_unsafe_fn)]
37
38mod backend;
39mod com;
40mod folder_flags;
41pub mod ids;
42mod imaging;
43mod layout;
44mod monitors;
45mod overlay;
46mod pidl;
47pub mod shader;
48pub mod shader_library;
49mod sprites;
50mod text;
51
52pub use backend::WindowsBackend;
53pub use folder_flags::FolderFlag;