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, floating_header_for_region, resize_handles_for_region,
30};
31pub use hit_test::{detect_quadrant, find_closest_region, hit_test_leaf, resolve_target};
32pub use layout::LayoutEngine;
33pub use mouse_coord::{CoordSpace, MousePosition};
34pub use node::{BspNode, NaryNode};
35pub use ordering::{FocusRing, ZOrder};
36pub use orientation::{LongestSide, OrientationHeuristic, Spiral};
37pub use rect::{
38    LayoutError, LayoutRect, Orientation, Quadrant, Ratio, RectSpec, SizeConstraints, gap_insert,
39    inset, rect_contains,
40};
41pub use region_map::RegionMap;
42pub use scroll::ScrollState;
43pub use snap::{
44    EdgeResistance, InsertPosition, SnapPreview, SnapTarget, corner_preview_rect,
45    detect_corner_snap, detect_edge_snap, edge_preview_rect, tiled_preview_rect,
46};
47pub use split::{
48    build_rects_from_sizes, gap_size, handle_thickness, split_rect_bsp, split_rects_nary,
49    split_rects_weighted, split_rects_with_gaps, split_sizes,
50};
51
52mod tiling;
53pub use tiling::{Direction, LayoutNode, SplitGap, split_area_for_path, split_at_path_mut};