Expand description
The create family: the emitters that mint entities. Every one takes its new ids pre-minted — ops land with concrete ids, so a compound gesture (a wire and the pin it lands on) is one commit.
Structs§
- NewBlock
- The block a drag drew: where it lands, and the two corners it spans.
A struct like
NewPinandNewPort, because the emitter also needs the document to name it and seven loose arguments say nothing. - NewPin
- A pin the gesture stamped on a block edge:
pin’s parameters, and the riderroutecarries when a wire lands on a free slot. - NewPort
- A boundary port the gesture stamped: the block whose boundary it joins, and the two corners of the body box drawn for it. Its slot is searched, not given.
- NewRoute
- One wire the gesture drew.
- Path
Ordinal - Where a grabbed corner lands in a route’s polyline — the arc-length ordinal the gesture classified against solved geometry the emitter cannot see. Past the end clamps to the end.
Enums§
- Route
End - Where a drawn wire landed: on a pin that already exists, or on a free slot marker, which stamps the destination pin in the same commit.
Constants§
- BLOCK_
PREFIX 🔒 - The auto-name a freshly drawn block carries, numbered across the whole document, so blocks the user declines to name still tell each other apart — which a shared “Untitled” does not.
- PORT_
PREFIX 🔒 - The auto-name every stamped pin takes, numbered per owner.
- STAMPED_
AREA 🔒 - STAMPED_
PORT_ WIDTH - TOP_
BLOCK_ 🔒DEFAULT_ HEIGHT - TOP_
BLOCK_ 🔒DEFAULT_ RECT - The rect a top block is born with: deliberately small and fixed rather than derived from what it holds.
- TOP_
BLOCK_ 🔒DEFAULT_ WIDTH - TOP_
PREFIX 🔒 - The auto-name a wrapped level takes.
- UNTITLED 🔒
- The name a freshly drawn area carries into its rename editor. A block
gets a numbered one instead (
BLOCK_PREFIX) — an area never appears in a breadcrumb, a hierarchy row or a PDF outline, which is where same-named neighbours were confusing.
Functions§
- area
- Inventory row “New Area”: a drag stamps a boundary annotation box. Unlike a block, an area holds no pins, so its height is whatever the drag drew.
- block
- Inventory row “New Block”: a drag stamps a child block on
scope— the document root is a scope like any other. The parent’s child list is derived, soparentis the whole structural write. - block_
title - A label at a block title’s resting side, for a caller naming one itself.
- block_
value - The block
blockstamps, as a value — for a caller that needs it in hand as well as in the commit. An embed does: the boundary its ports slot onto is this block’s, and the index has no row for it yet (clipboard::paste_into_fresh). - default_
port_ 🔒rect - Where a stamped pin’s port body sits inside its owner’s own interior
view: the owner’s rect magnified by
DEFAULT_SCALE_FOR_NEW_VIEWso the expanded view has room for child blocks, the body hugging the edge its slot sits on and tracking the slot down that edge. A body landing on an existing one steps outward by its own width until clear — bounded, so a pathological interior cannot spin. - demoted_
rect 🔒 - The rect the old root shows as once demoted: the one it already has, made tall enough that its lowest pin slot still fits. Its size is not derived from what it contains — a block as large as the whole drawing is unwieldy — and a degenerate rect (a root written before tops were born with a size) falls back to the default rather than demoting to an invisible sliver.
- first_
free_ 🔒slot - The first slot the owner’s pins leave free, scanning top-down and West
before East. Total: each offset offers two slots, so some slot at an
offset in
0..=nescapesnoccupants. - grown_
to_ 🔒fit - The growth rider: a block too short for
slotgrows two cells at a time until it fits.Nonewhen it already fits. - height_
for_ 🔒slot - The shortest block, in cells, that still offers slot
slot: the slot’s own row plus the clearancemax_pin_slotkeeps below it. - label 🔒
- A fresh label at its kind’s resting side: a block title sits at the bottom, a type label and an area title at the top.
- next_
free_ 🔒title - The lowest
{prefix}<n>from 1 up that no live block titles itself, so two blocks the user has not named are still told apart wherever their titles are listed — the nav breadcrumb, the hierarchy, the PDF outline. - next_
pin_ 🔒ordinal - The auto-name a stamped pin takes (
"Port N", tag"N"—Drawing::add_port_auto_named,add_named_pin). Ids count per document, not per block, so the number is read back off the owner’s pins: one past the highest they already carry. - owner_
pins 🔒 - pin
- Inventory row “Add Pin (block edge)”: a click on a slot marker — or a wire pulled out of one — stamps a pin there.
- pin_
init 🔒 - The pin a stamp lands as.
- port
- Inventory row “Add Port (boundary)”: stamp a port on the scope’s own boundary at the first free slot, growing the block until that slot fits.
- route
- Inventory row “New Route (wire)”: connect two pins along the solved path. A wire landing on a free slot carries its destination pin, and a destination the owner refuses takes the wire with it — a rejected route must never leave an orphan pin.
- stamped 🔒
- A default extent hung off a grid-snapped drop point — the arithmetic the
stamped_*defaults share. - stamped_
area - The box an area dropped on the canvas takes, on
stamped_block’s terms. Wider than a block and free of its pin ladder: an area’s job is to enclose a few of them. - stamped_
block - The box a block dropped on the canvas takes, anchored top-left at the
drop point. A drop names one corner and a block needs two, so the extent
is the one the document already gives a block nobody sized
(
TOP_BLOCK_DEFAULT_RECT) — deliberately small and fixed. - stamped_
port - The body box a port stamped on the canvas takes, on
stamped_block’s terms. Only the width is a default: the height isPORT_HEIGHT, whichportforces on whatever box it is handed anyway. - text_
box - Inventory row “New Text Box”: a click places an empty text annotation
and opens its editor; emptying it there is what deletes it
(
naming::edit_text). - wire_
label - Inventory row “Add Wire Label”: drop a name label on a wire, at the arc length the click projected onto its polyline.
- wrap_
top - Inventory row “Wrap Top”: add a level above the whole document — a
fresh root whose sole child is the old one, which demotes to a child
rect. A document with no root yet (
topisNULL) has nothing to demote, so the wrap is just the new root.