Skip to main content

term_wm_layout_engine/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2
3//! Pure-math window layout engine for term-wm.
4//!
5//! Provides tiling (BSP/N-ary tree) and floating window layout math with
6//! zero runtime dependencies. Supports `no_std` via the `std` feature
7//! (enabled by default).
8
9#[cfg(not(feature = "std"))]
10extern crate alloc;
11
12mod floating;
13mod hit_test;
14mod layout;
15mod node;
16mod ordering;
17mod orientation;
18mod rect;
19mod region_map;
20mod scroll;
21mod snap;
22mod split;
23
24pub use floating::{
25    DragHandle, FLOATING_MIN_HEIGHT, FLOATING_MIN_WIDTH, HeaderDrag, ResizeDrag, ResizeEdge,
26    ResizeHandle, apply_resize_drag_signed, floating_header_for_region, resize_handles_for_region,
27};
28pub use hit_test::{detect_quadrant, hit_test_leaf};
29pub use layout::LayoutEngine;
30pub use node::{BspNode, NaryNode};
31pub use ordering::{FocusRing, ZOrder};
32pub use orientation::{LongestSide, OrientationHeuristic, Spiral};
33pub use rect::{
34    LayoutError, LayoutRect, Orientation, Quadrant, Ratio, RectSpec, SizeConstraints, gap_insert,
35    inset, rect_contains,
36};
37pub use region_map::RegionMap;
38pub use scroll::ScrollState;
39pub use snap::{
40    EdgeResistance, InsertPosition, SnapPreview, SnapTarget, detect_edge_snap, edge_preview_rect,
41    tiled_preview_rect,
42};
43pub use split::{
44    build_rects_from_sizes, gap_size, handle_thickness, split_rect_bsp, split_rects_nary,
45    split_rects_weighted, split_rects_with_gaps, split_sizes,
46};