Skip to main content

Module shell

Module shell 

Source
Expand description

The shell as one value, and the frame it runs.

a handler ──► batch.push(…) ──► one booking at a time (see `pacing`)
                                     │
the booked frame ───────────────────►│ view = kernel(session, Tick + batch, glyphs)
                                     │ the ground and the display list, onto the canvas
                                     │ the hand-offs, delivered
                                     │ the chrome model, into its signal if it moved
                                     │ whatever the answer asks for, booked

A handler does one thing: Shell::say (or Shell::sampled, for what the pointer and the keyboard did). The batch lives in a cell of its own, so a handler firing while a frame is in flight adds to the next one rather than re-entering the session.

Structs§

Batch 🔒
What handlers have said since the last frame.
Diagram 🔒
One call’s diagram, kept past the call: a resize clears the backing store, and the page would show nothing until the call it books had answered.
Dressed 🔒
How the diagram is dressed: the palette it is painted in, the face it is lettered in, and the scheme an export prints in.
Editor 🔒
The editor and everything it draws through: one borrow, taken by the frame and by nothing else.
Owed
How much the storage still owes the log — the journal’s depth. Zero for a session with no container to owe it to, and for one whose container is written to as it goes.
Reported
What the shell itself could not do — an export the browser refused, a clipboard that would not take the copy. The kernel knows nothing about these, so they reach the chrome here rather than through its notices.
Shell
The shell, held once behind Rcs so every handler carries a clone.
Surface 🔒
Where the diagram goes.

Enums§

Band
Which piece of glass is reporting its own bounds. One entry each, so a band that moves replaces its own reading rather than joining a pile.
Door 🔒
What the session’s document goes away for.
Edge 🔒
Which edge of the viewport a band hugs.
Escaped
Whether a keystroke was taken by a piece of glass before the canvas saw it.
Pasting
Where a paste event came from, which the browser does not say.
Picker
Which picker an effect opened, and on what. One value rather than two options, because opening one closes the other.
Stood 🔒
What a door leaves the session standing on.
Wanted
What an open file pick is for, which is the shell’s own record of the flow it is in — the artwork lands as a block’s icon, as an image of its own, or as whatever an import turns out to be.

Constants§

NO_CONTAINER 🔒
What the doors that need a container say to a session with none.

Functions§

after
Do then once delay has passed — the chrome’s own clock, for the two things that are a matter of time rather than of state: a confirmation’s dwell and the window a double click is told from a single one.
clear_of
The part of viewport the chrome leaves clear: each band taken off the edge it hugs, at the shallowest inset that clears it. A band that touches no edge — glass floating over the middle of the diagram — takes nothing off: a framing may pass under it, since glass is not a wall.
clock_of 🔒
How long the page has been open.
context_of 🔒
css_size 🔒
elapsed 🔒
How long since started, for a log line that times a write.
focus 🔒
Whose keyboard it is, as the canvas’s own reading of Escape, Delete and Shift is scoped by.
focus_of 🔒
Whose keyboard it is: a field’s while one is being typed into, and the canvas’s otherwise — a button a press left the focus on types nothing.
grounds_the_page 🔒
Stand the page on the diagram’s ground, which is what shows through while a resize has cleared the canvas.
measured
Where an element of the chrome sits over the diagram, in the canvas’s own coordinates — the two share a positioned parent, so the offsets are already those.
opened 🔒
What a door that opens a document leaves standing.
request_animation_frame 🔒
set_timeout 🔒
spawn
Run work on the page’s own task queue — where every door onto the origin is awaited, since the frame that shares the document cannot wait with it.
tick 🔒
The frame clock, monotonic since the page was opened. The interval the session animates over is its own to predict.
types_into
Whether element takes typing, and so keeps the keys it is given.
window
The page this shell is running in, or nothing where there is no page.