Skip to main content

Module custom

Module custom 

Source
Expand description

The mod’s .yui components in the designer. Markup-only ones are expanded in place (components); compiled ones — whose bindings call the code-behind — are drawn for real by the mod’s code: a designer host process (host) per mod loads the mod’s library built for this machine (yog designer-lib) and draws them on request.

This side supervises it — rebuilds the library and restarts the host when the mod’s sources change (debounced), restarts nothing while they don’t — and fits the components into the designer’s picture: each compiled instance is laid out by yog-ui as a spacer of the component’s (measured) size, painted with a marker color; the marker’s fill in the recorded display list is then replaced by the host’s drawing of the component. While the library builds, or when it can’t be built or loaded, the element is a labelled placeholder box instead (“designer could not load”), never an IDE crash.

Structs§

Prepared
The document with custom elements replaced by marked spacers.
Snapshot

Enums§

Status
The designer library’s state, as the toolbox shows it.

Functions§

is_component
placeholder
The box shown for a component that can’t be drawn: its name and why.
prepare
The document as yog-ui should draw it: a <Component> document as a screen of its design size; markup-only component instances expanded; each compiled one (or unknown) measured through the host (its natural size, when the element doesn’t size it in px) and swapped for a marked spacer.
splice
Replaces each marker fill in ops with the component drawn at its element’s laid-out rect (rects: uid → x y w h), clipped to the part that was visible (the marker fill, already cut to scroll views).
status
The mod’s components and the library’s state; starts a rebuild (and host restart) when the sources changed and have been quiet a moment — only if some component is compiled. Cheap enough to poll.