tiny.ui.abi
Defined in tiny.ui.
Envelope namespace of extern records and closed vocabularies.
API (33)
Actions
Public operations.
active:activereports whether a state word has that state's bit set.flag:flagreturns the single bit for aFlag.holds:holdsreports whether a flags word has that flag's bit set.state:statereturns the single bit for aState.
Types and contracts
Public types and contracts.
AssetHandleAtom:Atom.offsetandAtom.lenlocate the atom's bytes in the string table.ColorDeclarationFlag:Flagnames bit positions inNode.flags.Header:Headeris the 152 byte prefix of every publish buffer.IRectKindNode:Nodeis one 64 byte record.PropertyIdRectRelation:Relationrows must be sorted bysubject, orerror.RelationsUnsorted.Role:Rolehas 46 values.SolvedRoot: A solved root names a node by itsnodearray index, and the admission survey rejects anodeindex at or past the node count witherror.SolvedRootNodeOutOfBounds.Span:bindchecks the ten header table spans and rejects the buffer with the first check that fails.State:Statenames bit positions inNode.state, in the same order ascss.selector.states.TextRecord:TextRecord.contentnames a UTF-8 atom.TextRun: ATextRunis checked in the admission survey.
Values and defaults
Public values and defaults.
abi_version:abi_versionis 1.atom_absent:atom_absentis 0.flag_countflag_mask:flag_maskhas every defined flag bit set, 0x07FF.header_byteskind_countmagic:magicis 0x31495554.role_countstate_countstate_mask:state_maskhas every defined state bit set, 0x03FF.text_absent:text_absentis 0.
Source
Source: lib/ui/src/abi/scalar.zig:36
pub const AssetHandle = extern struct { index: u32 = 0, generation: u32 = 0,};Source: lib/ui/src/abi/scalar.zig:29
pub const Color = extern struct { r: u8 = 0, g: u8 = 0, b: u8 = 0, a: u8 = 0,};Source: lib/ui/src/abi/scalar.zig:22
pub const IRect = extern struct { x: i32 = 0, y: i32 = 0, width: u32 = 0, height: u32 = 0,};Source: lib/ui/src/abi/vocabulary.zig:65
/// `Flag` names bit positions in `Node.flags`.pub const Flag = enum(u4) { focusable, scroll_x, scroll_y, clip, hidden, presentational, retained, modal, live, selectable_text, solved,};Source: lib/ui/src/abi/vocabulary.zig:81
/// `State` names bit positions in `Node.state`, in the same order as `css.selector.states`./// A test holds that order.pub const State = enum(u5) { selected, disabled, expanded, checked, mixed, pressed, busy, invalid, required, current,};Source: lib/ui/src/abi/envelope.zig:14
/// `abi_version` is 1. A publish whose header carries another value is rejected with/// `error.AbiVersionMismatch`.pub const abi_version: u32 = 1;Source: lib/ui/src/abi/envelope.zig:188
pub const header_bytes: u32 = @sizeOf(Header);Source: lib/ui/src/abi/envelope.zig:10
/// `magic` is 0x31495554. Its four bytes read "TUI1"./// A publish whose header carries another value is rejected with `error.MagicMismatch`.pub const magic: u32 = 0x31_49_55_54;Source: lib/ui/src/abi/envelope.zig:186
/// `text_absent` is 0. Entry 0 of the text table is reserved and never dereferenced./// `View.textOf` returns null for it, and the survey reads a text record only for a/// nonzero index.pub const text_absent: u32 = 0;Source: lib/ui/src/abi/scalar.zig:50
/// `atom_absent` is 0. Entry 0 of the atom table is reserved and never dereferenced. `View.text`/// returns an empty slice for it. The survey still bounds-checks its record like every other atom.pub const atom_absent: u32 = 0;Source: lib/ui/src/abi/vocabulary.zig:115
/// `active` reports whether a state word has that state's bit set.pub fn active(states: u32, value: State) bool { return states & state(value) != 0;}Source: lib/ui/src/abi/vocabulary.zig:100
/// `flag` returns the single bit for a `Flag`.pub fn flag(value: Flag) u16 { return @as(u16, 1) << @backingInt(value);}Source: lib/ui/src/abi/vocabulary.zig:96
pub const flag_count: usize = 11;Source: lib/ui/src/abi/vocabulary.zig:120
/// `flag_mask` has every defined flag bit set, 0x07FF.pub const flag_mask: u16 = (@as(u16, 1) << flag_count) - 1;Source: lib/ui/src/abi/vocabulary.zig:110
/// `holds` reports whether a flags word has that flag's bit set.pub fn holds(flags: u16, value: Flag) bool { return flags & flag(value) != 0;}Source: lib/ui/src/abi/vocabulary.zig:94
pub const kind_count: usize = 7;Source: lib/ui/src/abi/vocabulary.zig:95
pub const role_count: usize = 46;Source: lib/ui/src/abi/vocabulary.zig:105
/// `state` returns the single bit for a `State`.pub fn state(value: State) u32 { return @as(u32, 1) << @backingInt(value);}Source: lib/ui/src/abi/vocabulary.zig:97
pub const state_count: usize = 10;Source: lib/ui/src/abi/vocabulary.zig:122
/// `state_mask` has every defined state bit set, 0x03FF.pub const state_mask: u32 = (@as(u32, 1) << state_count) - 1;Source: lib/ui/src/abi/root.zig
//! Envelope namespace of extern records and closed vocabularies.//!//! Every record is an extern struct whose size and alignment are asserted at comptime.//! `Header` is 152 bytes. `Node` is 64 bytes. `magic` is 0x31495554. `abi_version` is 1.//! Closed vocabularies limit `Kind` to 7 values, `Role` to 46, `Flag` to 11, and `State` to 10.const css = @import("css");const envelope = @import("envelope.zig");const scalar = @import("scalar.zig");const vocabulary = @import("vocabulary.zig");pub const Declaration = css.value.Declaration;pub const PropertyId = css.property.Id;pub const Span = scalar.Span;pub const Rect = scalar.Rect;pub const IRect = scalar.IRect;pub const Color = scalar.Color;pub const AssetHandle = scalar.AssetHandle;pub const Atom = scalar.Atom;pub const atom_absent = scalar.atom_absent;pub const Header = envelope.Header;pub const Node = envelope.Node;pub const TextRecord = envelope.TextRecord;pub const TextRun = envelope.TextRun;pub const Relation = envelope.Relation;pub const SolvedRoot = envelope.SolvedRoot;pub const magic = envelope.magic;pub const abi_version = envelope.abi_version;pub const header_bytes = envelope.header_bytes;pub const text_absent = envelope.text_absent;pub const Kind = vocabulary.Kind;pub const Role = vocabulary.Role;pub const Flag = vocabulary.Flag;pub const State = vocabulary.State;pub const kind_count = vocabulary.kind_count;pub const role_count = vocabulary.role_count;pub const flag_count = vocabulary.flag_count;pub const state_count = vocabulary.state_count;pub const flag_mask = vocabulary.flag_mask;pub const state_mask = vocabulary.state_mask;pub const flag = vocabulary.flag;pub const state = vocabulary.state;pub const holds = vocabulary.holds;pub const active = vocabulary.active;Source: lib/ui/src/root.zig:8
pub const abi = @import("abi/root.zig");Audit
| Definitions | 21 |
|---|---|
| Public names | 22 |
| Members | 31 |
| Version | 26.7.0 |
| Revision | daab053ee433 |