Skip to main content

drmkit_csd/
lib.rs

1// SPDX-FileCopyrightText: (c) 2026 Joel Winarske
2// SPDX-License-Identifier: MIT
3
4//! Client-side window decorations.
5//!
6//! Port of `src/csd/`. Title bars, shadows, rounded corners and the buttons
7//! on them — drawn by the client rather than by a compositor, which is what
8//! makes them *client-side*.
9//!
10//! Drawing is CPU work over a pixel buffer. The one part that touches a DRM
11//! device is [`Surface`], which allocates, maps and exports the dumb buffer a
12//! decoration is drawn into. The presenters only compute the property writes
13//! that put those pixels on screen; committing them is the caller's business.
14
15mod animator;
16mod color;
17mod damage;
18mod geometry;
19mod load;
20mod presenter;
21mod presenter_composite;
22mod presenter_fb;
23mod presenter_plane;
24mod renderer;
25mod reservation;
26mod shadow;
27mod state;
28mod surface;
29mod theme;
30
31pub use animator::{WindowAnim, ease_out_cubic};
32pub use color::{Color, ColorError};
33pub use damage::{DamageRect, DamageSlot, compute_damage, intersect_rect, union_rect};
34pub use geometry::{DecorationGeometry, decoration_geometry};
35pub use load::{ThemeError, load_theme_file, load_theme_str};
36pub use presenter::{PropertyWrite, SurfaceRef, Tier, choose_presenter_tier};
37pub use presenter_composite::compute_canvas_writes;
38pub use presenter_fb::{BlitItem, FbTarget, compose_into_framebuffer, fb_fourcc_for};
39pub use presenter_plane::{PlaneError, PlaneSlot, compute_writes};
40pub use renderer::{Canvas, DrawError, Renderer, RendererConfig};
41pub use reservation::{OverlayReservation, ReserveError};
42pub use shadow::{DEFAULT_CAPACITY, Elevation, ShadowCache, ShadowDest, ShadowKey, theme_id};
43pub use state::{Dirty, HoverButton, PROGRESS_UNSET, WindowState};
44pub use surface::{SURFACE_FOURCC, Surface, SurfaceConfig, SurfaceError};
45pub use theme::{
46    Button, Buttons, Colors, Theme, TitleBar, glass_default, glass_lite, glass_minimal,
47};
48
49#[cfg(test)]
50mod tests;