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 anchor;
13mod floating;
14mod hit_test;
15mod layout;
16mod mouse_coord;
17mod node;
18mod ordering;
19mod orientation;
20mod rect;
21mod region_map;
22mod scroll;
23mod snap;
24mod split;
25
26pub use anchor::{AnchorPlacement, place_anchored};
27pub use floating::{
28    DragHandle, FLOATING_MIN_HEIGHT, FLOATING_MIN_WIDTH, HeaderDrag, ResizeDrag, ResizeEdge,
29    ResizeHandle, apply_resize_drag_signed, clamp_floating_to_bounds, floating_header_for_region,
30    resize_handles_for_region,
31};
32pub use hit_test::{detect_quadrant, find_closest_region, hit_test_leaf, resolve_target};
33pub use layout::LayoutEngine;
34pub use mouse_coord::{CoordSpace, MousePosition};
35pub use node::{BspNode, NaryNode};
36pub use ordering::{FocusRing, ZOrder};
37pub use orientation::{LongestSide, OrientationHeuristic, Spiral};
38pub use rect::{
39    LayoutError, LayoutRect, Orientation, Quadrant, Ratio, RectSpec, SizeConstraints, gap_insert,
40    inset, rect_contains,
41};
42pub use region_map::RegionMap;
43pub use scroll::ScrollState;
44pub use snap::{
45    EdgeResistance, InsertPosition, SnapPreview, SnapTarget, corner_preview_rect,
46    detect_corner_snap, detect_edge_snap, edge_preview_rect, tiled_preview_rect,
47};
48pub use split::{
49    build_rects_from_sizes, gap_size, handle_thickness, split_rect_bsp, split_rects_nary,
50    split_rects_weighted, split_rects_with_gaps, split_sizes,
51};
52
53mod tiling;
54pub use tiling::{Direction, LayoutNode, SplitGap, split_area_for_path, split_at_path_mut};