Skip to main content

Crate day_spec

Crate day_spec 

Source
Expand description

day-spec: the toolkit specification (DESIGN.md §8).

Backends depend only on this crate (never on day-core). One backend is linked per binary; day-core is monomorphized over the concrete Toolkit.

Re-exports§

pub use controls::datetime::DayDate;
pub use controls::datetime::DayTime;
pub use resource::AssetDir;
pub use resource::AssetName;
pub use resource::FontFamily;
pub use resource::ImageName;
pub use resource::Resource;
pub use resource::ResourceOpener;
pub use resource::VectorName;
pub use resource::resolve_asset_dir;
pub use resource::resolve_image_file;
pub use resource::resource;
pub use resource::set_resource_opener;
pub use styled::ListStyle;
pub use styled::ParagraphAlign;
pub use styled::ParagraphRun;
pub use styled::ParagraphStyle;
pub use styled::RunStyle;
pub use styled::StyledText;
pub use styled::Underline;
pub use styled::coalesce_runs;
pub use styled::paragraph_bounds;
pub use styled::paragraphs_are_valid;
pub use styled_codec::DocStyle;
pub use styled_codec::html_to_styled;
pub use styled_codec::markdown_to_styled;
pub use styled_codec::rtf_to_styled;
pub use styled_codec::styled_to_html;
pub use styled_codec::styled_to_markdown;
pub use styled_codec::styled_to_rtf;
pub use day_fonts as fonts;

Modules§

applications
System application associations. Identifiers are opaque, platform-owned values.
bridge
The wire table for backends whose native side reaches Rust through one numeric-kind trampoline (Android’s JNI nativeOnEvent, ArkUI’s day_arkui_on_event). This enum defines those kind numbers; the Java and C++ sides carry mirrored constants that parity tests check against these discriminants (so a collision or drift fails cargo test on the host instead of silently mis-decoding events on a device). AppKit/UIKit/GTK/Qt emit Event values directly and never use these numbers; XAML uses per-event callbacks with its own small local codes.
capture
Screenshot checkpoints. A revision identifies one ordered request, not a timer or an image hash. Completion of an older request cannot release a newer checkpoint.
controls
Shared protocols for the standard controls.
ffi_guard
Containment for FFI entry points: native callbacks, JNI up-calls, posted-closure trampolines. A Rust panic unwinding out of an extern "C" frame is undefined behavior (an abort), so every backend trampoline runs its body through ffi_guard::contain: a caught panic is reported, the installed recovery hook restores runtime coherence (day-core installs the reactive runtime’s recover_from_panic at boot), and the given default is returned.
keys
Which nodes handle the non-text keys (docs/menus.md). Keys follow focus (the focused piece hears them and nobody else), so a backend whose focused view would have to claim a key from the platform’s own dispatch (AppKit’s responder chain, the DOM’s default action) has to know whether the app wants it before swallowing it. An unclaimed arrow has to keep traveling, or a canvas inside a scroll view would silently eat the keys that scroll it.
kinds
The built-in piece keys as plain strings, for the registry and the PieceKind API.
markdown
Inline markdown → styled runs (docs/markdown.md). Lives here rather than in day-pieces because it produces TextRuns, and every format codec beside it reads the same model. Inline markdown → styled runs, parsed at RUNTIME (docs/markdown.md).
placeholder
Placeholder leaves: the one hole in Day’s rendering that is invisible to a screenshot.
present
props
resource
Bundled-resource random-access API + the per-backend ResourceOpener hook (§18.3). Bundled resources: efficient random read-only access to app-declared data, backed by each toolkit’s native resource mechanism (DESIGN.md §18.3).
sidetable
Pointer-keyed per-view side tables with an automatic release sweep.
styled
Styled text: the document model label().runs(…) renders and day-piece-text-editor edits, with the Markdown / HTML / RTF codecs over it (docs/texteditor.md). Styled text: the document label().runs(…) renders and day-piece-text-editor edits (docs/texteditor.md).
styled_codec
Import and export for StyledText: Markdown, HTML and RTF (docs/texteditor.md). Import and export for StyledText: Markdown, HTML, and RTF (docs/texteditor.md).
transfer
Native drag data and synchronous destination policy. No clipboard or process-local transport.

Structs§

A11yProps
Affine
A 2-D affine transform (CoreGraphics row-vector convention): a point p maps to (a·p.x + c·p.y + tx, b·p.x + d·p.y + ty). Used by canvas transform ops for shape rotate/scale/offset; every native 2-D context concatenates it onto its CTM identically.
AnimSpec
Animation intent (§8.4). Native-widget backends map it onto their own animator (Core Animation, ViewPropertyAnimator, XAML Composition, OH_ArkUI_AnimateTo, …); the canvas/self-driven path samples curve via Curve::fraction. Threaded through Toolkit::update/set_frame/ set_opacity/set_transform.
BitmapId
A decoded image the toolkit holds, addressed by an id day-core mints.
BitmapInfo
What a decoded image is, in the terms every backend can answer (Toolkit::image_info, docs/images.md).
CanvasFont
What canvas text is drawn with beyond its size (docs/canvas.md “Text”): a family, a weight and a slant. The default is the platform’s own UI face, regular, upright, which is what every backend drew before the field existed, so a default font encodes to nothing on the wire.
Color
sRGB color, 0.0–1.0 components. Semantic theme tokens (§6.3) resolve to these in the backend.
CornerRadii
A radius for each corner of a rectangle, clockwise from the top left (docs/canvas.md “Rounded corners”). The shape a bar in a chart wants (rounded at its value end, square against its axis), a tab (rounded on top), or a card joined to its neighbor.
Edges
A set of screen edges, for the defers_system_gestures modifier (docs/cover.md). Mirrors SwiftUI’s Edge.Set: on iOS these map to UIRectEdge for preferredScreenEdgesDeferringSystemGestures; on Android any non-empty set enters swipe-to-reveal immersive mode (the closest platform analogue).
EditState
What the app’s edit bridge can currently do, mirrored into the toolkit (Toolkit::set_edit_state) so native menu validation enables the stock items. can_paste is the app’s half (“a paste handler is installed”); the toolkit combines it with its own clipboard-has-text check where one exists.
EncodeSpec
What Toolkit::encode_image should produce (docs/images.md).
FontFace
One face a font family ships (docs/fonts.md): its display name (“Bold Italic”), weight and slant. What FontFamilyInfo::faces lists and what a font menu’s style picker offers.
FontFamilyInfo
A platform (or bundled) font family and the faces it can draw canvas text in (Toolkit::font_families, docs/fonts.md).
FontSpec
The full font descriptor a label carries: a semantic (or custom) Font style plus an optional weight override, an italic flag, and the tabular-figures request. Backends resolve this to one native font.
FrameStamp
Timing supplied by a native display scheduler. Seconds on a monotonic clock; its epoch is platform-specific. target_timestamp is absent when the platform cannot predict presentation.
ImageProperties
The metadata an image file carries beyond its pixels (Toolkit::image_properties).
InputTraits
How a text field takes its text (docs/textfield.md): the whole set travels together through Toolkit::set_input_traits, so a backend that has to rebuild the widget for one member has every other member in hand to dress the replacement.
Insets
Logical insets: leading/trailing resolve against the layout direction at place time (§7.8).
KeyEvent
LauncherShortcut
A launcher shortcut the app sets while it runs (docs/deep-links.md “Launcher shortcuts”): a route to open and the label the launcher shows, already localized.
LinearGradient
A linear gradient (docs/shapes.md §3.2 / §7): color stops along the line from start to end, both in the unit space of the filled shape’s bounding box. Stops are (offset 0..=1, color), ascending.
ListDelete
The synchronous swipe-to-delete half of ListSource (docs/list.md), shaped exactly like ListReorder: both closures are called on the UI thread from inside native swipe callbacks, outside any day-core borrow, and run to completion synchronously.
ListReorder
The synchronous drag-to-reorder half of ListSource (docs/list.md). Both closures follow bind_row’s discipline: called on the UI thread from inside native drag callbacks, outside any day-core borrow, and they run to completion synchronously.
ListSource
The synchronous row-pull closures for recycling lists (docs/list.md, §10). day-core injects one per LIST host via Toolkit::attach_list; a recycling backend stores it and calls it from its native data-source (on the UI thread, outside any day-core borrow). Each closure re-enters day-core, so, unlike EventSink, these run to completion synchronously (bind_row even flushes + lays out the row before returning, so the host can measure the cell immediately).
ListSwipe
The synchronous swipe-actions half of ListSource (docs/list.md), the generalized sibling of ListDelete: reveal-as-you-swipe buttons on either row edge. The offer is pulled per row at gesture time, so labels follow row state (“Mark Read” on an unread row, “Mark Unread” on a read one); the commit defers to the event drain like every closure here.
ListSwipeAction
One offered swipe action (docs/list.md): pure data. The pieces layer keeps the handlers; the backend answers a tap through ListSwipe::perform by index into the offer.
Modifiers
The keyboard modifiers held at an interaction, queryable ambiently (Toolkit::modifiers): primary is the platform’s command key (⌘ on Apple platforms, Ctrl elsewhere, the same convention Shortcut::primary uses). Touch-only backends answer all-false.
Monitor
One display (docs/windows.md “Monitors”), in points on the desktop’s coordinate space: top-left origin at the primary display’s top-left corner.
NativeSnapshot
A widget’s actual native state, read back from the platform by Toolkit::read_native (docs/testing.md): what the widget itself shows and reports, independently of Day’s tree, so a11y_audit and assert_native (§14.2) can diff it against Day’s expectation.
NodeId
Realized-node identity as seen by backends (day-core’s slotmap key, FFI-encoded).
Path
An arbitrary 2-D path: any number of contours, straight or curved, with a fill rule.
PdfInfo
The document information a PDF carries. A backend whose writer has no metadata API (Android’s PdfDocument) ignores it.
PdfPage
One page of a PDF Toolkit::render_pdf writes: the page size in PDF points (1/72 inch, the same unit as canvas points) and the ops to replay onto it, origin top-left.
Point
PointerEvent
Proposal
The layout proposal: None = unconstrained on that axis (§7.2).
RadialGradient
A radial gradient (docs/shapes.md §3.2 / §7): color stops from center outward. Both the center and the radius live in the unit space of the filled shape’s bounding box, so the gradient stretches into an ellipse when the bounds aren’t square (the XAML relative-brush behavior; the other backends reproduce it with a local matrix on a circular gradient). A radius of 0.5 from the default center touches the edge midpoints of the bounds.
Rect
Registry
Renderer
A third-party piece’s per-toolkit implementation. make receives the concrete backend (public helper surface) and returns a native handle the backend then owns like any built-in.
RowMetrics
The margins and minimum height a native list gives each row (Toolkit::list_row_metrics, docs/list.md “Row metrics”): a UITableView cell’s layout margins, a Material list item’s 16dp sides and 56dp height.
Shortcut
A keyboard shortcut for a menu item. primary is the platform’s command modifier (⌘ on Apple, Ctrl on GTK/Qt/XAML) so one declaration reads correctly everywhere. key is a single character ("s", ".") or a named key ("Return", "Delete", "Left", "F1").
Size
SizeClass
A window’s size class (docs/size-classes.md), reported by the backend and read by apps through day::size_class().
Stamp
The payload of DrawOp::Stamp: one shape drawn at every position in at.
StatusImage
A small runtime RGBA image for a status item: charts, meters, or a grid of results.
StatusItemSpec
One status item: an icon in the menu bar (macOS), the notification area (Windows) or a StatusNotifierItem host’s tray (Linux), with a menu (docs/status-item.md).
StrokeStyle
Everything about a stroke except its paint.
TextAnchor
How canvas text hangs on its at point: one placement per axis (docs/canvas.md “Text”).
TextMetrics
Single-line text measurement in canvas points (Toolkit::measure_text, docs/fonts.md).
TextRun
One styled span of a label’s text (docs/text-runs.md).
ToolbarItem
One item in a window’s toolbar (docs/toolbars.md).
ToolbarMirror
A backend’s copy of one window’s toolbar, kept in step with the ToolbarOps and ToolbarPatches that reach it, and the one place a backend works out where a new item goes (docs/toolbars.md).
ToolbarSegment
One choice inside a ToolbarItemKind::Segmented control.
Transform
A cheap per-node visual transform (§8.4 animation): translation, uniform/non-uniform scale, and rotation about a unit anchor (0.0..1.0 within the node’s bounds; default center). Distinct from the layout frame: animating a Transform never triggers relayout, so it is the vehicle for movement/scaling animation. Each backend composes it onto the node’s laid-out frame via its native transform channel (CALayer/GskTransform/RenderTransform/NODE_TRANSFORM/…).
TreeMoves
The synchronous drag half of TreeSource (docs/tree.md). Both closures follow bind_row’s discipline: called on the UI thread from inside native drag callbacks.
TreeSource
The synchronous row-pull closures for hierarchical trees (docs/tree.md): ListSource’s shape, addressed by token instead of row index, because expanding a row renumbers every index below it while tokens hold still. day-core injects one per TREE host via Toolkit::attach_tree; the backend answers its native data-source from it. The same synchronous discipline as ListSource: UI thread, outside any day-core borrow; bind_row flushes and lays the row out before returning.
UndoState
The undo stack’s face, as a native front mirrors it (Toolkit::set_undo_state): what is possible and what the menu titles should say. Labels arrive already localized: a toolkit cannot invent translated text, the same rule as every other label in this file.
UnitPoint
A point in the unit space of a shape’s bounding box: (0,0) = top-leading, (1,1) = bottom-trailing. Gradient geometry is expressed in unit points so one paint value works for any shape size (docs/shapes.md §3.2).
WindowOptions

Enums§

AppBadge
What to show on the app’s icon in the Dock, launcher, home screen, or taskbar (docs/badge.md).
AppProgress
A progress indicator on the app’s Dock or taskbar icon (Toolkit::set_app_progress, docs/status-item.md).
Attention
How strongly a window asks for the user’s attention (WindowChange::RequestAttention).
Builtin
Every piece kind Day itself defines (§5.3). Backends match on this exhaustively in realize; anything outside it is an extension piece resolved through the Registry by its string PieceKind.
Cap
Cursor
The pointer’s shape over a piece (the .cursor() decorator, docs/cursor.md).
Curve
The timing curve of an animation (§8.4). Native backends map each variant onto their own easing (CAMediaTimingFunction, QEasingCurve, ArkUI ARKUI_CURVE_*, spring animators); the canvas/self-driven path samples it via Curve::fraction. Spring matches SwiftUI’s .spring(response:dampingFraction:).
DragPhase
The phase of a drag gesture (docs/shapes.md).
DrawOp
EditOp
A standard edit command a platform route delivered (Event::Edit).
Event
ExportError
Why a canvas export could not answer (docs/canvas.md “Exporting”).
FillRule
Which points count as inside when a path’s contours overlap (docs/canvas.md).
Font
A semantic (logical) text style. Each maps to the platform’s native text style where the toolkit has one: UIFont/NSFont.preferredFont(forTextStyle:) on Apple (Dynamic Type), the *TextBlockStyle resources on XAML. A Day app thus matches the OS’s own typography and inherits its accessibility text scaling with no extra work. Backends without semantic styles (GTK/Qt/Android) approximate with sizes that still track the platform’s text-scale / font-scale accessibility setting.
FontWeight
Font weight, matching UIFont.Weight / SwiftUI Font.Weight (lightest → heaviest). Ordered by heaviness, so backends can e.g. map >= Semibold to a synthesized bold face.
GestureKind
A gesture a node wants delivered. Backends attach the matching native recognizer when day-core calls Toolkit::enable_gesture; the default is no gesture (recognizers cost, so opt-in).
HeightClass
How tall a window is (docs/size-classes.md). Consulted far less than WidthClass: it is what tells a phone in landscape (wide enough for two panes, too short for a tall list) that it should not grow vertical chrome.
Icon
A button or toolbar item’s picture: a standard Symbol (drawn with the platform’s own icon set) or a bundled image from resource/images for something only this app has.
ImageError
Why an image operation could not answer.
ImageFormat
An encoded image format: what BitmapInfo::format reports and EncodeSpec::format asks for. Not every backend encodes every one: ask Toolkit::encode_formats (the Cap::ImageEncode pair of Toolkit::font_families/Cap::FontList) rather than assuming.
ImageSource
Where a raster image’s pixels come from (docs/images.md).
InputPurpose
What a text field collects (text_field(..).input_purpose(_), docs/textfield.md).
LabelStyle
Which halves of an item’s label a platform draws, where it can draw more than one.
LayoutDirection
Lifecycle
An app-lifecycle phase (docs/lifecycle.md). Each backend maps these onto its OS’s native app / activity delegate. Some phases only exist on some platforms (a mobile app enters the background and can be low on memory, a desktop app cannot), so Lifecycle::is_universal marks the ones every backend delivers, and Toolkit::supports_lifecycle reports per-backend truth.
LineCap
How a stroked line ends (docs/canvas.md). Names match PDF’s J, SVG’s stroke-linecap, and every native 2-D API.
LineJoin
How two stroked segments meet (docs/canvas.md). Matches PDF’s j and SVG’s stroke-linejoin.
MarkupDialect
Which markup dialect runs_to_markup should emit.
MenuBarRole
A standard menu-bar slot (macOS’s File/Edit/View/Window/Help, and their counterparts elsewhere). A backend that has a house style for the menu bar fills every slot an app did not claim with its own stock menu, so an app never has to restate the platform’s furniture, and can still replace any of it by tagging its own submenu with the matching role.
MenuItem
One entry in a menu (recursive: a Submenu nests).
MenuRole
A standard/system command. The backend supplies the native item, a selector on AppKit/UIKit (cut:/copy:/paste:…) or a stock action on GTK/Qt/XAML, so it targets the focused control, gets the platform’s default label + shortcut, and enables/disables itself automatically. This is how default items (Edit ▸ Cut/Copy/Paste, the app’s Quit/About) are accommodated without the app re-implementing them.
MoveVerdict
A tree move guard’s verdict (docs/tree.md). No Retarget yet: the drop vocabulary is already positional, so a guard that wants a different target denies and the user drops where it is allowed.
OpCode
The canvas wire op codes (§11, §15.3): slot 0 of every 9-number record in encode_ops’s output. The numeric values are the frozen wire contract: the JNI, C++, and JS decoders each hand-write these as constants, so a value here may never be reused or renumbered; new ops append. ALL drives the density test that keeps this enum and the encoder in step.
Paint
A fill source: a solid color, or a linear/radial gradient (docs/shapes.md §3.2; angular and semantic tokens are later phases). From<Color> keeps every existing fill(shape, color) call site compiling unchanged.
PathSeg
One step of a Path. Points are absolute, in the canvas’s coordinate space.
Role
Shape
Subcontrol
One addressable widget within a composite native backing (docs/tree.md, docs/tweaks.md), Qt’s name for the concept (QStyle::SubControl). A list’s or tree’s node handle is its scroller; Subcontrol::Content is the widget inside it. Backends resolve an unknown subcontrol to None, never to the host.
SubmitLabel
The on-screen keyboard’s action key (text_field(..).submit_label(_), docs/textfield.md).
Support
SurfaceRole
Default navigation sidebar width (split presentation) until the pane reports its size. Semantic container surfaces (see ContainerProps::role): each backend maps a role to its own theme-adaptive material so the fill tracks light/dark mode without app code.
SwipeEdge
Which edge of a row a swipe action rides (docs/list.md). Semantic, not geometric: Leading follows the reading direction (the left edge in LTR, the right in RTL), the mapping every platform’s swipe API already makes.
Symbol
A standard icon, named by what it means rather than by how it looks, so each backend can draw the platform’s own glyph for it: an SF Symbol on macOS, a freedesktop icon name on GTK and Qt, a Fluent glyph on Windows. This is the only way an icon looks native on every desktop at once; a bundled PNG cannot, because it is one artist’s take on all four.
TextVAlign
Where at sits vertically. Top, Middle and Bottom are edges of the line box (ascent + descent at the font’s size, the box Toolkit::measure_text reports); Baseline is the typographic baseline itself.
ToolbarColumn
Which pane of a window’s navigation a toolbar item was declared in (docs/toolbars.md).
ToolbarItemKind
What a toolbar item is. The variants are the vocabulary every desktop toolbar shares; each backend realizes one with its native control, never with a drawn imitation.
ToolbarOp
One step of an edit to a window’s toolbar (docs/toolbars.md).
ToolbarPatch
A targeted update to one live toolbar item: the path that keeps a bound signal in sync without rebuilding the bar (which would drop the search field’s focus mid-keystroke).
ToolbarPlacement
Where an item sits on the chrome that carries it (docs/toolbars.md).
ToolbarValue
A value a toolbar item produced.
WidthClass
How wide a window is, in coarse buckets (docs/size-classes.md).
WindowBackground
What shows behind a window’s content (docs/window-chrome.md).
WindowChange
One change to one window (docs/windows.md “Window properties”), carried by Toolkit::apply_window. Each variant names the Cap that reports whether the running toolkit makes it.
WindowChrome
The frame a window wears (docs/window-chrome.md), set once when it opens.
WindowKind
What a secondary window is, so backends can apply platform conventions (docs/windows.md).
WindowLevel
How a window stacks against other apps’ windows (WindowChange::Level, Cap::WindowLevel).
WindowMaterial
The system materials a window background can use (WindowBackground::Material).
WindowOpenReply
A backend’s answer to Toolkit::open_window (docs/windows.md).
WindowPlacement
Where a window opens (WindowOptions::placement).
WindowRole
Whether a window keeps the app alive (docs/windows.md close policy).
WindowState
How a window is shown (docs/windows.md “Window properties”): what the window’s state() signal holds and what WindowChange::State asks for.
WindowTabbing
Whether and how a window joins macOS window tabs (WindowOptions::tabbing, Cap::WindowTabbing). Other platforms have no system window tabs and ignore it.

Constants§

EXPORT_MAX_PIXELS
The most pixels a rendered bitmap may hold in total: 64 megapixels, 256 MB at four bytes a pixel, which is already more than the tightest per-app heap (Android’s) comfortably holds.
EXPORT_MAX_SIDE
The largest side, in pixels, a rendered bitmap may have (docs/canvas.md “Exporting”). day-core answers ExportError::TooLarge above it before any toolkit allocates.
FONT_LIST_FAMILY
Family separator of the shim-side font list (parse_font_list).
FONT_LIST_FIELD
Field separator inside one family of the shim-side font list (parse_font_list).
NAV_LIST_MAX_W
NAV_LIST_MIN_W
Drag limits for the content-list pane, around the app’s preferred width; the same split of duties as the sidebar’s.
NAV_LIST_WIDTH
Default preferred width of a navigation host’s content-list pane (props::NavProps::list_width, docs/navigation.md), Mail’s message-list proportion.
NAV_SIDEBAR_MAX_W
NAV_SIDEBAR_MIN_W
Drag limits for a navigation host’s sidebar pane, around NAV_SIDEBAR_WIDTH. Shared by the desktops whose divider the user can drag (docs/navigation.md): AppKit enforces both through its NSSplitViewItem; Qt honors the minimum through the pane’s own minimum size and leaves the maximum to the user.
NAV_SIDEBAR_WIDTH
SEARCH_ITEM_ID
The reserved id of a .searchable() surface’s field (docs/search.md): the ToolbarItem a desktop bar draws for it, and the name dayscript’s toolbar: step drives it by wherever the platform put it — on the bar, or inline on the navigation surface where the bar holds no field, in which case day-core resolves the id to that host instead.
SIDEBAR_TOGGLE_ID
The reserved id of the sidebar affordance a nav(Sidebar) supplies for itself (docs/toolbars.md). Backends with a system item for the job (AppKit’s NSToolbarToggleSidebarItem) recognize it by this id and draw theirs instead; dayscript recognizes it to drive the toolkit’s own duty rather than an app closure.
WINDOW_NODE
Reserved id for window-level events (resize, lifecycle): day-core routes it to the root.

Traits§

Animatable
Linear interpolation of animatable values (t in 0.0..1.0). This drives the canvas / self-driven animation path (docs/shapes.md §5) and Qt’s sampled spring; native-widget animation does not use it; the toolkit interpolates on its own compositor.
Platform
A platform backend: owns the native main loop and exactly one window in v1 (§8.1).
Toolkit

Functions§

arc_cubics
A circular arc as cubic beziers: sweep_deg of a circle of radius about center, from start_deg (arc_point’s convention). The segments start from the arc’s first point, which the caller reaches itself (a move or a line); nothing for a zero or non-finite radius or sweep.
arc_point
The point angle_deg round a circle: degrees, 0 = the +x axis, positive clockwise in device space (y down), the convention Shape::Arc and every arc helper here use.
capture_scale
The scale a window snapshot is rendered at, when a scripted run states one (DAY_CAPTURE_SCALE=2, set by day launch --script from Day.toml [screenshots]).
encode_ops
encode_path
export_pixels
The pixel size a drawing of size points renders to at scale pixels per point: each side rounded up, so a drawing never loses its last partial pixel. Shared by day-core’s limit check and every backend, so the bitmap a backend allocates is the one day-core approved.
frame_timestamp
Seconds on a monotonic clock since the first call: the frame timestamp for a backend that does not expose a native timestamp (§8.4). The origin is arbitrary. Not for the web build, where Instant is unavailable and requestAnimationFrame stamps the frame itself.
geometry_key
Flat numeric encoding of a display list for shim/JNI boundaries (§11, §15.3): per op 9 numbers [kind, a, b, c, d, e, f, g, rgba-bits]; text payloads ride separately in order. The kind slot carries an OpCode; its doc comments are the per-slot contract.
kind_has_baseline
Whether a kind is worth asking Toolkit::first_baseline about (docs/baseline.md).
parse_font_list
Decode the text a non-Rust font enumerator hands back (the Qt, XAML and ArkUI shims, the Android bridge, the web shim all produce this one format): families separated by U+001E; inside a family, U+001F-separated fields: the family name, then one (name, CSS weight, italic 0/1) triple per face. Tolerant: a malformed face or family is skipped, an empty face name is synthesized from its weight and slant, and a family with no faces is kept with none (the caller decides what a face-less family means).
posix_locale_hints
The user’s language preference from the POSIX environment, newest-first, as BCP-47 tags.
props_of
Downcast a realize/update payload to the props/patch type a backend arm expects, warning (once per kind, via placeholder::report) instead of panicking on a mismatch. A mismatch means a piece registered under a builtin key or a day-core regression; degrade to the placeholder path, never abort: most backend arms run inside native up-calls, where a panic is a process kill.
rounded_rect_segs
The closed contour of a rectangle rounded corner by corner, clockwise from the top left, with the radii fitted first. A square corner is a sharp point, not a zero-length curve.
route_of_url
The route inside a deep-link URL (docs/deep-links.md): everything after scheme://, query included (notes://mail/inbox?hint=x ⇒ mail/inbox?hint=x). A string with no scheme passes through unchanged (it is already a route). One definition, shared by every platform’s intake and the dayscript deep_link step, so a URL maps to the same route bytes everywhere; percent-decoding stays with the route parser (docs/navigation.md).
runs_are_valid
Are these runs well formed for text: ascending, non-overlapping, inside the string, and on character boundaries?
runs_to_markup
Serialize a label’s text + runs as markup, for the two backends whose text widgets take a string in their own dialect rather than a structured attributed string: GTK (Pango markup) and Qt (its HTML subset). Shared so the escaping is written and tested once: a translated string containing & or < corrupts the whole label otherwise, and it will be a translated string that finds the bug.
sf_symbol_name
The SF Symbol each standard symbol draws as. The system’s own glyphs match the user’s device: weight, optical size, accent color and all. Shared by both Apple backends (toolbars on macOS, menus on both).

Type Aliases§

AppLocales
An app’s generated locale catalog: (DEFAULT, CATALOG), exactly what day-build emits as res::locales::{DEFAULT, CATALOG} (§18.5). Carried in WindowOptions::locales so the framework can install it at the one moment that is correct.
CancelFrame
Cancels a pending callback and releases its native registration. UI-thread only, idempotent in effect, and safe during/after delivery. Dropping without calling is allowed after delivery.
ContextMenuFn
A summon-time context-menu provider (docs/menus.md): local-point in, menu out.
EventSink
The event sink: enqueue-only. It may be invoked re-entrantly from inside any Toolkit method; day-core drains queued events at safe points, each as a fresh batch (§3.3).
FrameCallback
A one-shot native frame callback, always delivered asynchronously on the UI thread.
MeasureFn
Optional custom measure for a third-party piece (§8.2).
PieceKind
Interned piece-kind key, e.g. "day.label" or "acme.combobox".
RawHandle
Raw foreign native handle for polyglot adoption (§15.3).