Skip to main content

Crate blockworx_tools

Crate blockworx_tools 

Source
Expand description

The tools: one per gesture the canvas offers, plus the vocabulary that drives them.

A tool is a per-frame function from state, interaction and document to preview paints and an optional tool::Transition — see tool::frame, which is the only door the drivers use. Around them: the commands registry (what can be invoked right now, and the chords that invoke it), the history stack a press of undo walks, and the spotlight ring that points at what a step changed.

Nothing here names a UI toolkit. Drawing goes through blockworx_paint::Renderer, interaction arrives as blockworx_paint::Interaction, and the on-screen conveniences — the cursor, the clock, the in-place editor, a repaint — are blockworx_paint::Canvas.

Re-exports§

pub use add_pin::AddPin;
pub use add_port::AddPort;
pub use add_route_label::AddRouteLabel;
pub use add_text::AddText;
pub use edit_route::EditRoute;
pub use edit_text_box::EditTextBox;
pub use move_block::MoveBlock;
pub use move_block_type::MoveBlockType;
pub use move_label::MoveLabel;
pub use move_multi_pin::MoveMultiPin;
pub use move_pin::MovePin;
pub use move_title::MoveTitle;
pub use multi_pin_select::MultiPinSelect;
pub use multi_select::MultiSelect;
pub use new_area::NewArea;
pub use new_block::NewBlock;
pub use rename_block_type::RenameBlockType;
pub use rename_pin::RenamePin;
pub use rename_route::RenameRoute;
pub use rename_title::RenameTitle;
pub use retype_pin::RetypePin;
pub use route_tool::RouteTool;
pub use select_tool::SelectTool;

Modules§

add_pin
add_port
add_route_label
add_text
block_edit
The block-edit tab cycle.
commands
The command registry: every invocable operation as a Command — a stable CommandId, a user-facing label, and the Act invoking it performs — computed against the current selection and mode by CommandSet::available. The overlays render the set instead of re-deriving availability, so “what can the user do right now” is encoded exactly once; the planned command palette, keyboard shortcuts, and the script command step consume the same set.
content_path
The content path: the chain of block names from the document root down to the level being drawn, as a plain string — top/Thing 1/Core.
edit_route
edit_text_box
file
What a dialog picks and where a save goes — the shell-typed payloads tool::Action carries. What a path means is one crate down, in blockworx_store::file; opening the dialog is one crate up, in the shell. What the File flow asks for, and what comes back.
history
The editor’s undo stack: two kinds of entry on one stack.
move_block
move_block_type
move_label
move_multi_pin
move_pin
move_title
multi_pin_select
multi_select
names
new_area
new_block
new_pin
The free-slot markers: where a pin can be added to a block.
rename_block_type
rename_pin
rename_route
rename_title
resize_block
retype_pin
route_start
Route-start / route-end hover targets.
route_tool
select_pin
select_tool
selection_bounds
World-space bounding boxes for the current selection. Shared by the selection frames (drawn on the canvas) and the selection overlay (placed in screen space), so both agree on what region a selection occupies.
spotlight
Where a document step worked: the scope it happened in and the grid region that contains its subjects.
stamp
What a tool stamped on the canvas creates.
title_block
The drawing’s title block: what a printed sheet states about the drawing it carries, and how that statement is arranged.
tool