Skip to main content

blockworx_editor/widget/
mod.rs

1pub mod alignment;
2pub mod auto_route;
3pub mod clipboard;
4pub mod display;
5pub mod drawing;
6pub mod edge;
7pub mod foreground;
8pub mod hit_target;
9pub mod movement;
10pub mod reconstruct;
11pub mod routing;
12pub mod scene;
13pub mod segmentkind;
14pub mod spatial;
15pub mod waypoint_router;
16
17pub use scene::DrawingPasses;
18
19#[cfg(test)]
20mod closed_router_tests;
21/// Scene builders the tool suites above this crate share with these modules,
22/// so both build their documents the same way.
23///
24/// A failed fold in a fixture *is* the assertion, so the panic lints are off
25/// here as they are inside a `#[cfg(test)]` module.
26#[cfg(any(test, feature = "test-support"))]
27#[expect(clippy::expect_used, clippy::missing_panics_doc)]
28pub mod test_fixtures;
29
30/// The frame's preview phase: the hypothetical geometry a drag implies,
31/// written before anything paints.
32///
33/// A value rather than a convention, because the ordering is invisible
34/// otherwise. A [`Drawing`](drawing::Drawing) re-derives the settled wires as
35/// it is built, so geometry previewed *after* the frame painted is wiped before
36/// anything can read it — which freezes the wires for the whole of a drag.
37/// `Drawing`'s preview writers require one of these, and the frame driver
38/// hands the one it mints only to `preview` — so "preview before you paint" is
39/// a data dependency rather than a convention.
40pub struct PreviewPhase(());
41
42impl PreviewPhase {
43    /// Minted once per frame by the driver that runs `preview` before
44    /// `widget` — `tools::tool::frame`, which lives above this crate.
45    pub fn frame() -> Self {
46        Self(())
47    }
48
49    /// A preview phase for a test driving a preview writer directly.
50    #[cfg(any(test, feature = "test-support"))]
51    pub fn testing() -> Self {
52        Self(())
53    }
54}