git.lucas.co / cce-window-manager
window management library
git clone https://git.lucas.co/cce-window-manager.git

src/lib.rs (3.1K)

 1 // cce-window-manager — the window-management policy layer of the cce
 2 // desktop, split out of the compositor crate (`cce-fx`).
 3 //
 4 // Everything here is pure Rust — no FFI, no raw wlroots pointers. The
 5 // mechanism side (scene graph, seats, shells, sockets) lives in the `cce`
 6 // compositor crate, which depends on this one and talks to policy code only
 7 // through the types in `api`.
 8 //
 9 // Modules:
10 //   - `api`: the `Policy` / `Compositor` trait boundary and the plain-data
11 //     vocabulary (WindowId, WindowRole, Action, ActionCtx, Command, …).
12 //     Snapshot-style: policy methods take mechanism-built snapshots and
13 //     return command lists; the compositor applies them.
14 //   - `actions`: `DefaultPolicy` — the live `Policy` impl; camera actions
15 //     (zoom/pan/view/overview) are decided here.
16 //   - `arrange`: the whole arrange pass as pure functions
17 //     (snapshot → plan → apply instructions).
18 //   - `bindings`: keybinding vocabulary — action names, chord grammar,
19 //     `BindingTable`, stock defaults. The compositor feeds it plain data
20 //     parsed from `input.kdl`; keysym name→code lookup stays mechanism-side.
21 //   - `background`: per-frame desktop-grid geometry (`grid_frame`) —
22 //     modulo tree shift, density fade, cell lattice with safety caps.
23 //   - `camera`: viewport pan/zoom math — keyed/wheel zoom about an anchor,
24 //     centering, overview fit, focus-follow visibility.
25 //   - `ramp`: speed-ramp evaluation for duration-based camera
26 //     transitions — parses the DE-wide ramp spec cce-ui's Ramp widget
27 //     writes, integrating it into a normalized progress curve.
28 //   - `focus`: directional focus selection (which window is "up/left/…"
29 //     of the focused one) over virtual-surface center points.
30 //   - `tiling`: `TilingMode` — `Tiled`/`Floating` plus the internal roles.
31 //   - `overview`: overview-mode move rules — displacing windows a drag
32 //     covers to the vacated side.
33 //   - `pan`: cell-aligned viewport panning (the PanLeft/… step targets).
34 //   - `query`: window-query resolution (ccectl focus-window etc.) — numeric
35 //     id first, then app_id with exact-beats-substring.
36 //   - `snap`: magnetic grid snapping for interactive move/resize.
37 //   - `cells`: chess-style addressing for desktop-grid squares (A1, -B3)
38 //     — labels, parsing, square/block rects, and re-tiling a block across
39 //     a grid-geometry change. Its geometry must agree with `snap`'s.
40 //   - `spawn`: where a window launched AT a square should land — the block
41 //     grows away from whatever already occupies the square, then steps to
42 //     the nearest free spot.
43 //   - `state`: persisted session state (serialization/matching only; the
44 //     save/load I/O stays in the compositor).
45 //   - `slotmap`: generational-index map (river-derived, 0BSD); `api::WindowId`
46 //     wraps its `Key`.
47 
48 pub mod actions;
49 pub mod api;
50 pub mod arrange;
51 pub mod background;
52 pub mod bindings;
53 pub mod camera;
54 pub mod cells;
55 pub mod focus;
56 pub mod overview;
57 pub mod pan;
58 pub mod query;
59 pub mod ramp;
60 pub mod slotmap;
61 pub mod snap;
62 pub mod spawn;
63 pub mod state;
64 pub mod tiling;