Kleidos API Search

In development. It changes without notice.

Topic

Interface Components

Buttons, lists, dialogs, steppers, keyboards and the rest, each drawn from the values it is given.

A component is a function of a record of values and a layout. It draws into the canvas and keeps nothing between calls: who is focused, pressed or selected is a value its caller passes. One whose gesture spans several frames keeps that in a companion type beside it. Each one has a form for a panel of two tones, with outlines and ink and no fill.

  • Frame of a screen: header, action bar, key hints, tabs, rules.
  • Lists and values: menu list, dropdown, stepper, fields for text, a date or an address, character wheel, touch keyboard.
  • What a record is: identity, brand mark, chips, the card of a one-time code, the ring of its countdown.
  • Feedback: dialog, toast, notice stack, progress, battery gauge, PIN dial, tutorial hints.
  • Icons: drawn from lines and shapes, with no glyph font.
  • QR codes, for joining the portal's network and opening its page.
See also
Canvas, Theme & Layout, Buttons & Gestures

Files

file src/ui/components/action_bar_component.h
Affordance-driven footer hint bar — the showcase of the input axis.
file src/ui/components/battery_gauge.h
The battery gauge every header shows: the step its fill is drawn at and the low-battery mark, each moved with hysteresis.
file src/ui/components/brand_mark_component.h
Credential brand badge — registry logo with a letter fallback.
file src/ui/components/button_component.h
Pressable button with explicit visual states (normal / focused / …).
file src/ui/components/char_wheel_component.h
Horizontal, center-locked, paged character wheel for button-board text entry.
file src/ui/components/code_offer_component.h
The body of the screen that offers a record's 2FA code once its user and password have been typed.
file src/ui/components/countdown_ring_component.h
Depleting annulus-sector countdown indicator (TOTP validity ring).
file src/ui/components/cred_identity_component.h
The identity block of a credential card: who the record is for.
file src/ui/components/datetime_field_component.h
Field-by-field date-time editor: a pure edit model + a renderer.
file src/ui/components/dialog_component.h
Modal / confirm box — title, body, and 1–2 action labels.
file src/ui/components/dropdown_component.h
Single-select list popover for an enum setting (language, layout, …).
file src/ui/components/field_focus.h
The focus mark of a segmented field editor (date-time, IPv4 address).
file src/ui/components/header_component.h
Top status/header bar — title + optional status icons.
file src/ui/components/header_gauge_watch.h
The watch on the battery gauge of the header the glass shows.
file src/ui/components/hold_rim_component.h
The rim that fills around a row while a key is held to open it.
file src/ui/components/icon_chip_component.h
Quiet icon-only touch control (reveal, back): one size, two looks.
file src/ui/components/icon_component.h
Primitive-drawn UI icons — a curated affordance / status glyph set.
file src/ui/components/ipv4_field_component.h
Octet-by-octet literal-IPv4 editor: a pure edit model + a renderer.
file src/ui/components/key_hint_shelf_component.h
The keyboard boards' one key-hint shelf: key, then what it does.
file src/ui/components/kleidos_mark_component.h
The Kleidos mark at the official geometry, with a keyhole that turns.
file src/ui/components/live_battery_level.h
The battery level every header shows: the one gauge of the firmware, moved by the board's reading.
file src/ui/components/live_header_status.h
The live status cluster a screen header shows: battery, charge and the Bluetooth link.
file src/ui/components/menu_list_component.h
Scrollable vertical list: a single ListRow + the MenuList window.
file src/ui/components/notice_stack.h
A column of centered text blocks set whole inside a box: the layout of a screen that only says something.
file src/ui/components/pin_dial_component.h
Timing-arc PIN dial — the two-concentric-circle annulus primitive.
file src/ui/components/popup_card_component.h
The card every popup that asks for something is drawn on: a tinted title bar over the card's own surface.
file src/ui/components/progress_component.h
Linear progress bar + circular progress arc (general-purpose).
file src/ui/components/qr/qr_card_layout.h
Pure solver for a scan card: the largest crisp symbol a band holds.
file src/ui/components/qr/qr_component.h
Scalable QR-code UI component drawn through kleidos::ui::Canvas.
file src/ui/components/qr/qr_encoder.h
In-house QR Code (ISO/IEC 18004) byte-mode encoder.
file src/ui/components/qr/qr_payload.h
Typed QR payload builders (heap-free), starting with WiFi join strings.
file src/ui/components/rule_component.h
The hairline that separates one row of content from the next.
file src/ui/components/status_chip_component.h
Small status pill (a.k.a. Badge) — e.g. "TOTP", severity tags.
file src/ui/components/stepper_component.h
− value + numeric stepper control with min / max / step clamping.
file src/ui/components/tab_bar_component.h
Horizontal tab strip with one selected tab.
file src/ui/components/text_box_component.h
Multi-line text drawn inside a rectangle, wrapped to width, clipped to height.
file src/ui/components/text_field_component.h
Single-line text display / entry field with caret + password masking.
file src/ui/components/text_wrap.h
Greedy word-wrap and single-line fitting shared by the components.
file src/ui/components/toast_component.h
Transient toast overlay + full-width banner strip.
file src/ui/components/totp_code_card_component.h
TOTP code card: space-grouped mono code + countdown ring + expiry text.
file src/ui/components/touch_key_variants.h
The open variant strip of an on-screen keyboard: which key, which cell.
file src/ui/components/touch_keyboard_component.h
One layered on-screen keyboard for masked secret entry on touch boards.
file src/ui/components/tutorial_hint_component.h
Centered "try it" goal pill shared by the onboarding component tutorials.

Namespaces

namespace kleidos::ui::mark_detail
Integer helpers of the mark's geometry: rounding and the sine of an angle in tenths of a degree.

Classes

struct kleidos::ui::ActionSlot
One semantic action slot of the hint bar. More about kleidos::ui::ActionSlot
struct kleidos::ui::ActionBarProps
Stateless props for drawActionBar. More about kleidos::ui::ActionBarProps
class kleidos::ui::DrawnActionBar
A screen's claim on the action bar on the glass, so a hold-gauge step repaints only what moved (repaintActionBar). More about kleidos::ui::DrawnActionBar
struct kleidos::ui::BatteryLevel
What a battery gauge shows: a fill step and the low-battery mark. More about kleidos::ui::BatteryLevel
class kleidos::ui::BatteryGauge
The shown battery level, moved by readings with hysteresis. More about kleidos::ui::BatteryGauge
struct kleidos::ui::BrandMarkProps
Stateless props for drawBrandMark. More about kleidos::ui::BrandMarkProps
struct kleidos::ui::ButtonProps
Stateless props for drawButton. More about kleidos::ui::ButtonProps
struct kleidos::ui::CharWheelProps
Stateless props for drawCharWheel — the host-owned current state. More about kleidos::ui::CharWheelProps
struct kleidos::ui::CodeOfferProps
Stateless props for drawCodeOffer. More about kleidos::ui::CodeOfferProps
struct kleidos::ui::CountdownRingProps
Stateless props for drawCountdownRing. More about kleidos::ui::CountdownRingProps
struct kleidos::ui::CredIdentityProps
What the block draws for one credential. More about kleidos::ui::CredIdentityProps
struct kleidos::ui::IdentityRowPlan
How many rows fit a column, and the gap they spread with. More about kleidos::ui::IdentityRowPlan
struct kleidos::ui::DateTimeFieldModel
The mutable edit state: the six field values plus the active cursor. More about kleidos::ui::DateTimeFieldModel
struct kleidos::ui::DateTimeFieldProps
Stateless props for drawDateTimeField. More about kleidos::ui::DateTimeFieldProps
struct kleidos::ui::DialogProps
Stateless props for drawDialog. More about kleidos::ui::DialogProps
struct kleidos::ui::DropdownProps
Stateless props for drawDropdown. More about kleidos::ui::DropdownProps
struct kleidos::ui::DropdownScroll
The scroll a dropdown's host keeps while a finger moves its options. More about kleidos::ui::DropdownScroll
struct kleidos::ui::HeaderStatus
Connectivity / lock indicator state for the header status cluster. More about kleidos::ui::HeaderStatus
struct kleidos::ui::HeaderProps
Stateless props for drawHeader. More about kleidos::ui::HeaderProps
struct kleidos::ui::HeaderDrawn
What drawHeaderBeside laid down: where the status cluster starts, and which of the two reserves the title was clamped against. More about kleidos::ui::HeaderDrawn
struct kleidos::ui::KleidosMarkPixels
The Kleidos mark's parts on whole pixels at one edge. More about kleidos::ui::KleidosMarkPixels
struct kleidos::ui::HeaderGaugeShown
What a header's battery gauge shows. More about kleidos::ui::HeaderGaugeShown
struct kleidos::ui::HeaderGaugeSlot
Where a header (or a screen with no header) drew its battery gauge: what a repaint of the gauge alone needs. More about kleidos::ui::HeaderGaugeSlot
struct kleidos::ui::GaugeOverlays
The overlays on the glass, as far as the gauge's watch needs them. More about kleidos::ui::GaugeOverlays
class kleidos::ui::HeaderGaugeWatch
The record of the battery gauge the glass shows, and what it needs. More about kleidos::ui::HeaderGaugeWatch
struct kleidos::ui::HoldRimState
How much of a rim has been painted. One per surface that draws a rim. More about kleidos::ui::HoldRimState
struct kleidos::ui::BackChipRects
A back chip as drawn, and the box a tap on it answers in: the band it sits in, from the screen edge to one small gap past the chip, so the target clears the tap floor even where the drawn chip does not. More about kleidos::ui::BackChipRects
struct kleidos::ui::IconChipProps
Stateless props for drawIconChip. More about kleidos::ui::IconChipProps
struct kleidos::ui::Ipv4FieldModel
The mutable edit state: the four octet values plus the active cursor. More about kleidos::ui::Ipv4FieldModel
struct kleidos::ui::Ipv4FieldProps
Stateless props for drawIpv4Field. More about kleidos::ui::Ipv4FieldProps
struct kleidos::ui::KeyHint
One key and what it does. More about kleidos::ui::KeyHint
struct kleidos::ui::KeyHintShelfProps
The shelf's three slots. More about kleidos::ui::KeyHintShelfProps
struct kleidos::ui::KleidosMarkGeo
Where a mark is and how large: the ring's mid-band radius and band. More about kleidos::ui::KleidosMarkGeo
struct kleidos::ui::KleidosMarkParts
The parts of the mark inside its ring, on whole pixels: the 1-bit panel's mark. More about kleidos::ui::KleidosMarkParts
struct kleidos::ui::StemSegment
The stem's two endpoints in 1/kStemSubPx px (pixel centers on whole multiples), from the pivot to the tip. More about kleidos::ui::StemSegment
struct kleidos::ui::KleidosMarkView
How one mark is drawn. More about kleidos::ui::KleidosMarkView
struct kleidos::ui::ListRowProps
Stateless props for drawListRow. More about kleidos::ui::ListRowProps
struct kleidos::ui::MenuItemDesc
One item descriptor for drawMenuList. More about kleidos::ui::MenuItemDesc
struct kleidos::ui::MenuListProps
Stateless props for drawMenuList. More about kleidos::ui::MenuListProps
struct kleidos::ui::notice_stack::Part
One block of the column, as its screen asks for it. More about kleidos::ui::notice_stack::Part
struct kleidos::ui::notice_stack::Block
One block of the column, placed on the panel. More about kleidos::ui::notice_stack::Block
struct kleidos::ui::notice_stack::Stack
The column set for one box. More about kleidos::ui::notice_stack::Stack
struct kleidos::ui::PinDialProps
Stateless props for drawPinDial. More about kleidos::ui::PinDialProps
struct kleidos::ui::PopupCardProps
Stateless props for drawPopupCard. More about kleidos::ui::PopupCardProps
struct kleidos::ui::ProgressBarProps
Stateless props for drawProgressBar. More about kleidos::ui::ProgressBarProps
struct kleidos::ui::ProgressArcProps
Stateless props for drawProgressArc. More about kleidos::ui::ProgressArcProps
struct kleidos::ui::QrBand
The band a scan card is laid out in (the content box, already inset). More about kleidos::ui::QrBand
struct kleidos::ui::QrCaptionBox
What the caption needs from the band. More about kleidos::ui::QrCaptionBox
struct kleidos::ui::QrCardPlan
The solved geometry (see planQrCard). More about kleidos::ui::QrCardPlan
struct kleidos::ui::QrColors
Dark / light module colors for drawQr. More about kleidos::ui::QrColors
struct kleidos::ui::QrFit
The integer module grid a box holds for a symbol (see fitQr). More about kleidos::ui::QrFit
struct kleidos::ui::StatusChipProps
Stateless props for drawStatusChip. More about kleidos::ui::StatusChipProps
struct kleidos::ui::StepperProps
Stateless props for drawStepper. More about kleidos::ui::StepperProps
struct kleidos::ui::StepperChips
Where drawStepper puts its two chips. More about kleidos::ui::StepperChips
struct kleidos::ui::TabBarProps
Stateless props for drawTabBar. More about kleidos::ui::TabBarProps
struct kleidos::ui::TextBoxProps
Stateless styling props for drawTextBox. More about kleidos::ui::TextBoxProps
struct kleidos::ui::TextFieldProps
Stateless props for drawTextField. More about kleidos::ui::TextFieldProps
struct kleidos::ui::text_wrap::WholeWrap
What wrapWhole reports of one wrapped text. More about kleidos::ui::text_wrap::WholeWrap
struct kleidos::ui::text_wrap::LabelLines
How fitLabel sets a label in its box. More about kleidos::ui::text_wrap::LabelLines
struct kleidos::ui::ToastProps
Stateless props for drawToast. More about kleidos::ui::ToastProps
struct kleidos::ui::BannerProps
Stateless props for drawBanner. More about kleidos::ui::BannerProps
struct kleidos::ui::TotpCodeCardProps
Stateless props for drawTotpCodeCard. More about kleidos::ui::TotpCodeCardProps
class kleidos::ui::TouchKeyVariantPicker
The open variant strip of one keyboard. More about kleidos::ui::TouchKeyVariantPicker
struct kleidos::ui::TouchKeyboardSheet
One keyboard as drawn: the layer, its letter rows, and the field's charset. More about kleidos::ui::TouchKeyboardSheet
struct kleidos::ui::TouchKeyboardProps
Stateless props for drawTouchKeyboard — host-owned current state. More about kleidos::ui::TouchKeyboardProps
struct kleidos::ui::TouchKeyboardVariants
The variants one key offers, as Unicode code points (Latin-1). More about kleidos::ui::TouchKeyboardVariants
struct kleidos::ui::TutorialHintProps
Stateless props for drawTutorialHint. More about kleidos::ui::TutorialHintProps

Typedefs

usingkleidos::ui::qr::Matrix
Caller-owned, malloc-free module matrix sized for kMaxVersion.
usingkleidos::ui::qr::WifiPayload
Convenience alias for the WiFi payload buffer type.
usingkleidos::ui::text_wrap::WrapLine
One fixed-capacity wrapped line (NUL-terminated).

Enumerations

enum class kleidos::ui::ButtonState : uint8_t { kleidos::ui::ButtonState::Normal, kleidos::ui::ButtonState::Focused, kleidos::ui::ButtonState::Pressed, kleidos::ui::ButtonState::Disabled, kleidos::ui::ButtonState::Danger }
Visual interaction state of a button. More about kleidos::ui::ButtonState
enum class kleidos::ui::CharGroup : uint8_t { kleidos::ui::CharGroup::Upper , kleidos::ui::CharGroup::Lower , kleidos::ui::CharGroup::Digits , kleidos::ui::CharGroup::Separators }
One character group of the wheel (frequency-ordered). More about kleidos::ui::CharGroup
enum class kleidos::ui::CharWheelChip : uint8_t { kleidos::ui::CharWheelChip::GroupUpper, kleidos::ui::CharWheelChip::GroupLower, kleidos::ui::CharWheelChip::GroupDigits, kleidos::ui::CharWheelChip::GroupSeparators, kleidos::ui::CharWheelChip::Backspace, kleidos::ui::CharWheelChip::Commit }
A cell in the tool / chip row (ABC abc 123 -_. DEL OK). More about kleidos::ui::CharWheelChip
enum class kleidos::ui::CharWheelMode : uint8_t { kleidos::ui::CharWheelMode::GroupSelect , kleidos::ui::CharWheelMode::CharScroll }
The two host-owned interaction regions the wheel renders. More about kleidos::ui::CharWheelMode
enum class kleidos::ui::DtField : uint8_t { kleidos::ui::DtField::Year, kleidos::ui::DtField::Month, kleidos::ui::DtField::Day, kleidos::ui::DtField::Hour, kleidos::ui::DtField::Minute, kleidos::ui::DtField::Zone, kleidos::ui::DtField::Count }
Editable fields of a date-time, in left-to-right edit order. More about kleidos::ui::DtField
enum class kleidos::ui::DialogSeverity : uint8_t { kleidos::ui::DialogSeverity::Info , kleidos::ui::DialogSeverity::Success , kleidos::ui::DialogSeverity::Caution , kleidos::ui::DialogSeverity::Danger }
Severity tone of a dialog (drives the title accent). More about kleidos::ui::DialogSeverity
enum class kleidos::ui::DropdownTouch : uint8_t { kleidos::ui::DropdownTouch::None , kleidos::ui::DropdownTouch::Moved , kleidos::ui::DropdownTouch::Commit , kleidos::ui::DropdownTouch::Cancel }
What one pointer gesture did to a dropdown. More about kleidos::ui::DropdownTouch
enum class kleidos::ui::KleidosMarkStyle : uint8_t { kleidos::ui::KleidosMarkStyle::Outlined , kleidos::ui::KleidosMarkStyle::SolidBody }
How the pixel-fit mark draws its body. More about kleidos::ui::KleidosMarkStyle
enum class kleidos::ui::HeaderGaugeRepaint : uint8_t { kleidos::ui::HeaderGaugeRepaint::None , kleidos::ui::HeaderGaugeRepaint::Wait , kleidos::ui::HeaderGaugeRepaint::Gauge }
What the gauge on the glass needs on a tick at rest. More about kleidos::ui::HeaderGaugeRepaint
enum class kleidos::ui::IconId : uint8_t { kleidos::ui::IconId::DialUp, kleidos::ui::IconId::DialSelect, kleidos::ui::IconId::DialDown, kleidos::ui::IconId::DialUpDown, kleidos::ui::IconId::ChevronUp, kleidos::ui::IconId::ChevronDown, kleidos::ui::IconId::ChevronLeft, kleidos::ui::IconId::ChevronRight, kleidos::ui::IconId::Lock, kleidos::ui::IconId::Unlock, kleidos::ui::IconId::Wifi, kleidos::ui::IconId::Ble, kleidos::ui::IconId::Battery, kleidos::ui::IconId::BatteryCharging, kleidos::ui::IconId::Check, kleidos::ui::IconId::Cross, kleidos::ui::IconId::Back, kleidos::ui::IconId::Key, kleidos::ui::IconId::Credential, kleidos::ui::IconId::Clock, kleidos::ui::IconId::Totp, kleidos::ui::IconId::Settings, kleidos::ui::IconId::Warning, kleidos::ui::IconId::Keyboard, kleidos::ui::IconId::Trash, kleidos::ui::IconId::Card, kleidos::ui::IconId::Menu, kleidos::ui::IconId::Eye, kleidos::ui::IconId::EyeOff, kleidos::ui::IconId::Shift, kleidos::ui::IconId::Backspace, kleidos::ui::IconId::Plus, kleidos::ui::IconId::Enter, kleidos::ui::IconId::Tap, kleidos::ui::IconId::SwipeVertical, kleidos::ui::IconId::SwipeHorizontal, kleidos::ui::IconId::Person, kleidos::ui::IconId::Globe, kleidos::ui::IconId::Info }
Identifier of a primitive-drawn icon. More about kleidos::ui::IconId
enum class kleidos::ui::MarkTone : uint8_t { kleidos::ui::MarkTone::Idle , kleidos::ui::MarkTone::Success , kleidos::ui::MarkTone::Failure }
The tone a mark is drawn in. More about kleidos::ui::MarkTone
enum class kleidos::ui::ListRowState : uint8_t { kleidos::ui::ListRowState::Normal, kleidos::ui::ListRowState::Selected, kleidos::ui::ListRowState::Disabled, kleidos::ui::ListRowState::Back, kleidos::ui::ListRowState::Peek, kleidos::ui::ListRowState::Note }
Visual interaction state of a list row. More about kleidos::ui::ListRowState
enum class kleidos::ui::ListRowSize : uint8_t { kleidos::ui::ListRowSize::Compact , kleidos::ui::ListRowSize::Comfortable , kleidos::ui::ListRowSize::Cozy }
Vertical density of a list row. More about kleidos::ui::ListRowSize
enum class kleidos::ui::ListRowTrailing : uint8_t { kleidos::ui::ListRowTrailing::None, kleidos::ui::ListRowTrailing::Value, kleidos::ui::ListRowTrailing::ToggleOn, kleidos::ui::ListRowTrailing::ToggleOff, kleidos::ui::ListRowTrailing::Chevron, kleidos::ui::ListRowTrailing::Chip }
Kind of trailing accessory drawn on the right of a row. More about kleidos::ui::ListRowTrailing
enum class kleidos::ui::ProgressTone : uint8_t { kleidos::ui::ProgressTone::Primary , kleidos::ui::ProgressTone::Success , kleidos::ui::ProgressTone::Warning , kleidos::ui::ProgressTone::Caution }
Semantic color tone of a progress indicator. More about kleidos::ui::ProgressTone
enum class kleidos::ui::QrCaptionSide : uint8_t { kleidos::ui::QrCaptionSide::Below , kleidos::ui::QrCaptionSide::Right }
Where a scan card's caption sits relative to the symbol. More about kleidos::ui::QrCaptionSide
enum class kleidos::ui::qr::QrEcc : uint8_t { QrEcc::Low , QrEcc::Medium , QrEcc::Quartile , QrEcc::High }
Error-correction level (ISO/IEC 18004 §7.5). More about kleidos::ui::qr::QrEcc
enum class kleidos::ui::qr::WifiAuth : uint8_t { WifiAuth::Wpa , WifiAuth::Wep , WifiAuth::Nopass }
WiFi authentication type for wifi. More about kleidos::ui::qr::WifiAuth
enum class kleidos::ui::ChipStyle : uint8_t { kleidos::ui::ChipStyle::Neutral, kleidos::ui::ChipStyle::Primary, kleidos::ui::ChipStyle::Success, kleidos::ui::ChipStyle::Warning, kleidos::ui::ChipStyle::Caution, kleidos::ui::ChipStyle::Info }
Semantic color/role of a status chip. More about kleidos::ui::ChipStyle
enum class kleidos::ui::StepperFocus : uint8_t { kleidos::ui::StepperFocus::None , kleidos::ui::StepperFocus::Decrement , kleidos::ui::StepperFocus::Increment }
Which stepper affordance currently carries focus. More about kleidos::ui::StepperFocus
enum class kleidos::ui::TextFieldState : uint8_t { kleidos::ui::TextFieldState::Normal , kleidos::ui::TextFieldState::Focused , kleidos::ui::TextFieldState::Error }
Visual interaction state of a text field. More about kleidos::ui::TextFieldState
enum class kleidos::ui::text_wrap::Weight : uint8_t { kleidos::ui::text_wrap::Weight::Regular , kleidos::ui::text_wrap::Weight::Bold }
The face a run is drawn in, and so the face it is measured in. More about kleidos::ui::text_wrap::Weight
enum class kleidos::ui::ToastSeverity : uint8_t { kleidos::ui::ToastSeverity::Info, kleidos::ui::ToastSeverity::Success, kleidos::ui::ToastSeverity::Caution, kleidos::ui::ToastSeverity::Warning, kleidos::ui::ToastSeverity::Admin }
Severity tone of a toast / banner (mirrors popup::Severity). More about kleidos::ui::ToastSeverity
enum class kleidos::ui::BannerPlacement : uint8_t { kleidos::ui::BannerPlacement::Top , kleidos::ui::BannerPlacement::Bottom }
Where a banner attaches. More about kleidos::ui::BannerPlacement
enum class kleidos::ui::TotpCardStyle : uint8_t { kleidos::ui::TotpCardStyle::Hero , kleidos::ui::TotpCardStyle::Row , kleidos::ui::TotpCardStyle::Compact }
Composition of the TOTP code card. More about kleidos::ui::TotpCardStyle
enum class kleidos::ui::TouchKeyboardLayer : uint8_t { kleidos::ui::TouchKeyboardLayer::Numeric , kleidos::ui::TouchKeyboardLayer::Lower , kleidos::ui::TouchKeyboardLayer::Upper , kleidos::ui::TouchKeyboardLayer::Symbols }
Which glyph table the keyboard is showing. More about kleidos::ui::TouchKeyboardLayer
enum class kleidos::ui::TouchKeyboardLetters : uint8_t { kleidos::ui::TouchKeyboardLetters::Qwerty, kleidos::ui::TouchKeyboardLetters::Spanish, kleidos::ui::TouchKeyboardLetters::Portuguese, kleidos::ui::TouchKeyboardLetters::German, kleidos::ui::TouchKeyboardLetters::French }
The letter rows of the passphrase layers, one per keyboard layout. More about kleidos::ui::TouchKeyboardLetters
enum class kleidos::ui::TouchKeyboardKeyKind : uint8_t { kleidos::ui::TouchKeyboardKeyKind::Char, kleidos::ui::TouchKeyboardKeyKind::Shift, kleidos::ui::TouchKeyboardKeyKind::Backspace, kleidos::ui::TouchKeyboardKeyKind::LayerToggle, kleidos::ui::TouchKeyboardKeyKind::Space, kleidos::ui::TouchKeyboardKeyKind::Confirm }
What a keyboard cell does when activated. More about kleidos::ui::TouchKeyboardKeyKind

Functions

int16_tkleidos::ui::actionBarHeight (Canvas &canvas, const LayoutContext &layout, const ActionBarProps &props)
Height the bar for props takes from the bottom edge.
boolkleidos::ui::actionBarCutsCaption (Canvas &canvas, const LayoutContext &layout, const ActionBarProps &props)
Whether the bar for props would cut a caption, one size down included.
voidkleidos::ui::drawActionBar (Canvas &canvas, const LayoutContext &layout, const ActionBarProps &props)
Draw the affordance-driven hint bar into the reserved footer shelf.
voidkleidos::ui::drawActionBar (Canvas &canvas, const LayoutContext &layout, const ActionBarProps &props, DrawnActionBar &drawn)
Draw the hint bar, as drawActionBar does, and record it in drawn.
voidkleidos::ui::repaintActionBar (Canvas &canvas, const LayoutContext &layout, const ActionBarProps &props, DrawnActionBar &drawn)
Repaint the hint bar for props, touching only what changed since drawn.
voidkleidos::ui::repaintActionBar (const ActionBarProps &props, DrawnActionBar &drawn)
Repaint the hint bar on the display, in a frame of its own.
uint8_tkleidos::ui::batteryGaugeSteps (int16_t iconSize)
Steps a gauge drawn in a status slot of iconSize can show: one per pixel column of its fill.
int16_tkleidos::ui::batteryGaugeBodyWidth (int16_t iconSize)
Width of the gauge's body outline for a status slot of iconSize.
int16_tkleidos::ui::batteryGaugeFillWidth (int16_t iconSize, const BatteryLevel &level)
Width of the fill a gauge in a status slot of iconSize draws for level.
uint8_tkleidos::ui::batteryStepFor (int16_t pct, uint8_t steps)
A reading's own step: the fill level nearest to pct.
BatteryLevelkleidos::ui::batteryLevelFor (int16_t pct, uint8_t steps)
The level a gauge shows for pct with no history: its own step and the red mark at kBatteryLowPct. A first reading, or a gauge drawn for a fixed percent (the component gallery).
constexpr const char *kleidos::ui::brandToken (const char *listDomain, const char *name)
The string a credential's brand mark is keyed by: its brand token.
constexpr const char *kleidos::ui::brandLogoKey (const BrandMarkProps &props)
The string drawBrandMark looks the registry logo up in.
boolkleidos::ui::drawBrandMark (Canvas &canvas, const LayoutContext &layout, const Rect &box, const BrandMarkProps &props)
Draw the brand badge within box, returning true if drawn.
voidkleidos::ui::drawBrandKeyMark (Canvas &canvas, const LayoutContext &layout, int16_t centerX, int16_t centerY, int16_t radius)
Draw the Kleidos mark (a keyhole in a ring) at the official geometry.
int16_tkleidos::ui::buttonHeight (const LayoutContext &layout)
Compute the natural (preferred) button height for a layout.
voidkleidos::ui::drawButton (Canvas &canvas, const LayoutContext &layout, const Rect &box, const ButtonProps &props)
Draw a pressable button filling the supplied rectangle.
uint8_tkleidos::ui::charWheelRingLen (CharGroup group)
Number of cells in a group's ring.
charkleidos::ui::charWheelGlyphAt (CharGroup group, uint8_t index)
The appendable glyph at index in a character group's ring.
const char *kleidos::ui::charWheelChipLabel (CharGroup group)
Short chip label for a group (drawn in the tool row).
CharWheelChipkleidos::ui::charWheelChipAt (uint8_t col)
The chip at tool-row column col (ABC abc 123 -_. DEL OK).
CharGroupkleidos::ui::charWheelChipGroup (CharWheelChip chip)
Map a group chip to the group it enters.
const char *kleidos::ui::charWheelChipLabelFor (CharWheelChip chip)
Short ASCII label for a chip-row cell.
CharWheelChipkleidos::ui::charWheelNextChip (CharWheelChip chip)
Advance the group-chip selector by one, wrapping at the chip count.
uint8_tkleidos::ui::charWheelNextIndex (CharGroup group, uint8_t index)
Advance a wheel ring index by one, wrapping at the ring length.
uint8_tkleidos::ui::charWheelPrevIndex (CharGroup group, uint8_t index)
Step a wheel ring index back by one, wrapping at the ring length.
voidkleidos::ui::drawCharWheel (Canvas &canvas, const LayoutContext &layout, const Rect &area, const CharWheelProps &props)
Draw the paged character wheel into area.
Rectkleidos::ui::charWheelBandRect (const LayoutContext &layout, const Rect &area)
The wheel-band sub-rect of area (the horizontal glyph-ring strip).
voidkleidos::ui::drawCharWheelBand (Canvas &canvas, const LayoutContext &layout, const Rect &area, const CharWheelProps &props)
Draw ONLY the wheel band (sliding glyph ring + center box + position dots) of area — not the chips or the label.
int16_tkleidos::ui::codeOfferHeight (const LayoutContext &layout)
Natural height of the offer's stack, for a caller that centers it.
voidkleidos::ui::drawCodeOffer (Canvas &canvas, const LayoutContext &layout, const Rect &body, const CodeOfferProps &props)
Draw the offer, centered vertically in body.
int16_tkleidos::ui::countdownRingSweepDeg (float fraction)
Swept angle (degrees, clockwise from the top) for a remaining fraction.
int16_tkleidos::ui::countdownRingSweepDeg (uint16_t remainingSeconds, uint16_t periodSeconds)
Swept angle for a seconds-remaining / period pair (integer-exact).
voidkleidos::ui::drawCountdownRing (Canvas &canvas, const CountdownRingProps &props)
Draw the countdown ring: dim track + linear remaining-fraction sector.
IdentityRowPlankleidos::ui::planIdentityRows (const std::array< int16_t, kIdentityRowMax > &heights, uint8_t count, int16_t room, int16_t minGap, int16_t maxGap)
Decide how many rows fit room and how far apart they sit. Pure.
voidkleidos::ui::drawCredIdentity (Canvas &canvas, const LayoutContext &layout, const Rect &column, const CredIdentityProps &props)
Draw the identity block into column.
constexpr uint8_tkleidos::ui::daysInMonth (uint16_t year, uint8_t month)
Days in month of year, accounting for leap-year February.
constexpr voidkleidos::ui::clampDay (DateTimeFieldModel &m)
Re-clamp DateTimeFieldModel::day to the current month's length.
constexpr voidkleidos::ui::dtIncrement (DateTimeFieldModel &m)
Increment the active field by one, wrapping at its upper bound.
constexpr voidkleidos::ui::dtDecrement (DateTimeFieldModel &m)
Decrement the active field by one, wrapping at its lower bound.
constexpr boolkleidos::ui::dtAdvanceOrCommit (DateTimeFieldModel &m)
Advance to the next field, or signal commit when past the last field.
voidkleidos::ui::drawDateTimeField (Canvas &canvas, const LayoutContext &layout, const Rect &box, const DateTimeFieldProps &props)
Draw the YYYY-MM-DD HH:MM timestamp + a zone line into a rectangle.
Rectkleidos::ui::drawDialog (Canvas &canvas, const LayoutContext &layout, const DialogProps &props)
Draw a centered modal dialog over the screen.
int16_tkleidos::ui::dropdownRowHeight (const LayoutContext &layout)
Height of a single dropdown option row for a layout.
int16_tkleidos::ui::dropdownVisibleRows (const LayoutContext &layout, int16_t bodyH)
Number of option rows that fit in a panel body of bodyH pixels.
uint8_tkleidos::ui::dropdownScrollTop (uint8_t focus, uint8_t count, uint8_t visible, uint8_t prevTop)
Clamp / advance the scroll window so the focused option is visible.
Rectkleidos::ui::dropdownBodyRect (const LayoutContext &layout, const Rect &box, const char *title)
The rect drawDropdown lays its option rows in: the popover minus its title band.
BackChipRectskleidos::ui::dropdownBackRects (const LayoutContext &layout, const Rect &box, const DropdownProps &props)
Geometry of the title band's back chip — the one definition the draw and the hit test share.
Rectkleidos::ui::dropdownPopoverBox (const LayoutContext &layout, uint8_t optionCount=0, const char *title=nullptr)
The popover rect of a picker: the screen less a small margin that frames it, ending above the first row the pointer does not own (on a board whose A/B/C zones are a band of the screen) and above the action bar where the picker keeps one.
boolkleidos::ui::dropdownKeepsActionBar (const LayoutContext &layout)
Whether dropdownPopoverBox stops above the action bar.
DropdownTouchkleidos::ui::resolveDropdownTouch (const TouchGestureEvent &ev, const LayoutContext &layout, const Rect &box, const DropdownProps &props, uint8_t &focus, uint8_t &scrollTop)
Resolve a gesture against a dropdown drawn in box with props — the one touch grammar every picker shares.
DropdownTouchkleidos::ui::updateDropdownTouch (const TouchGestureRecognizer &gestures, const TouchGestureEvent &ev, uint32_t nowMs, const LayoutContext &layout, const Rect &box, const DropdownProps &props, DropdownScroll &scroll, uint8_t &focus, uint8_t &scrollTop)
resolveDropdownTouch for a host that scrolls its options by touch.
voidkleidos::ui::drawDropdown (Canvas &canvas, const LayoutContext &layout, const Rect &box, const DropdownProps &props)
Draw a single-select dropdown popover filling the supplied rectangle.
voidkleidos::ui::drawMonoFieldFocus (Canvas &canvas, const char *text, int16_t left, int16_t centerY, hal::display::Font font, int16_t bandH)
Draw the field in focus on a 1-bit panel: paper text on an ink band, with an ink rule under the band.
voidkleidos::ui::drawColorFieldFocus (Canvas &canvas, int16_t left, int16_t width, int16_t centerY, int16_t lineH)
Draw the accent rule under the field in focus on a color panel.
int16_tkleidos::ui::headerHeight (const LayoutContext &layout, bool subtitle)
Compute the header bar height for a layout (title-only vs title+subtitle).
int16_tkleidos::ui::headerHeight (const LayoutContext &layout, const HeaderProps &props)
Header bar height for props: headerHeight(const LayoutContext&, bool) raised to the tap-target floor when HeaderProps::showBack is set (and always on the Core2 v1.3 and the CoreS3 SE).
int16_tkleidos::ui::headerHeight (const LayoutContext &layout, bool subtitle, bool showBack)
Header bar height from the two props that size it, for a caller that lays out before it has the title (or whose title varies).
int16_tkleidos::ui::headerStatusCy (const LayoutContext &layout, const HeaderProps &props)
Center line of the header's title row and status cluster for props, where the bar draws its battery gauge.
int16_tkleidos::ui::headerMarkEdge (const LayoutContext &layout)
Edge of the square the header's brand mark fills.
int16_tkleidos::ui::headerMarkInset (const LayoutContext &layout)
Clearance between the header's brand mark and the bar's top edge.
KleidosMarkPixelskleidos::ui::kleidosMarkPixels (int16_t edge)
The pixel-fit parts of the Kleidos mark at edge.
voidkleidos::ui::drawKleidosMarkPrimitive (Canvas &canvas, int16_t left, int16_t top, int16_t edge, bool mono, uint16_t background)
Draw the pixel-fit Kleidos mark from canvas primitives.
BackChipRectskleidos::ui::headerBackRects (const LayoutContext &layout, const HeaderProps &props)
Geometry of the header back chip — the one definition the draw and the hit test share.
voidkleidos::ui::drawBackKeyCap (Canvas &canvas, const LayoutContext &layout, const Rect &chip)
Draw the mark of a dedicated back key (the CoreInk side key).
int16_tkleidos::ui::drawHeader (Canvas &canvas, const LayoutContext &layout, const HeaderProps &props)
Draw the header / status bar across the top edge.
HeaderDrawnkleidos::ui::drawHeaderBeside (Canvas &canvas, const LayoutContext &layout, const HeaderProps &props)
Draw the header as drawHeader does, and say which reserve the title kept for the trailing element the caller draws next.
int16_tkleidos::ui::headerStatusIconSize (const LayoutContext &layout)
Side of the square slot each status token is drawn in, the battery gauge's included.
Rectkleidos::ui::headerGaugeRect (const HeaderGaugeSlot &slot)
The footprint of the battery gauge a header drew in slot: its body and its terminal.
voidkleidos::ui::drawStatusBattery (Canvas &canvas, const LayoutContext &layout, int16_t rightX, int16_t cy, const HeaderGaugeShown &live)
Draw the header's battery gauge outside a header, right-aligned on rightX and centered on cy, over the background already there.
voidkleidos::ui::drawBodyBattery (Canvas &canvas, const LayoutContext &layout, int16_t rightX, int16_t cy, const HeaderGaugeShown &live)
Draw the battery gauge on a screen that has no header bar, on the screen's background, and record it so it stays live at rest.
voidkleidos::ui::repaintHeaderGauge (Canvas &canvas, const HeaderGaugeSlot &slot, const HeaderGaugeShown &live)
Repaint a header's battery gauge alone, in place, showing live.
boolkleidos::ui::keepHeaderGaugeLive (Canvas &canvas, HeaderGaugeWatch &watch, const HeaderGaugeShown &live, uint32_t screen, const GaugeOverlays &overlays)
Keep the gauge on the glass live on a tick at rest.
constexpr boolkleidos::ui::overlayCoversGauge (const Rect &gauge, const GaugeOverlays &overlays)
Whether an overlay covers the gauge drawn in gauge.
HeaderGaugeWatch &kleidos::ui::glassHeaderGauge ()
The record of the gauge on the glass: the one every header draw writes and the main loop's watch reads. UI task only.
voidkleidos::ui::drawHoldRim (Canvas &canvas, const Rect &row, float progress01, HoldRimState &state, uint8_t stepPct=kHoldRimStepPct)
Paint the rim around row for a hold that is progress01 charged.
voidkleidos::ui::drawIconChip (Canvas &canvas, const LayoutContext &layout, const Rect &box, const IconChipProps &props)
Draw an icon chip filling box.
voidkleidos::ui::drawIcon (Canvas &canvas, const Rect &box, IconId id, uint16_t color)
Draw an icon centered inside a box.
voidkleidos::ui::drawIcon (Canvas &canvas, int16_t cx, int16_t cy, int16_t size, IconId id, uint16_t color)
Convenience overload: draw an icon from a center point and size.
voidkleidos::ui::drawIcon (Canvas &canvas, int16_t cx, int16_t cy, int16_t size, IconId id, uint16_t color, int16_t minStroke)
Draw an icon centered on a point, with a stroke of at least minStroke.
voidkleidos::ui::drawKeyCap (Canvas &canvas, int16_t cx, int16_t cy, int16_t size, const char *key, uint16_t color)
Draw a letter key as its key cap: the letter, bold, in a rounded box.
constexpr voidkleidos::ui::ipv4Increment (Ipv4FieldModel &m)
Increment the active octet by one, wrapping 255 → 0.
constexpr voidkleidos::ui::ipv4Decrement (Ipv4FieldModel &m)
Decrement the active octet by one, wrapping 0 → 255.
constexpr boolkleidos::ui::ipv4AdvanceOrCommit (Ipv4FieldModel &m)
Advance to the next octet, or signal commit when past the last one.
constexpr boolkleidos::ui::ipv4FromText (const char *text, Ipv4FieldModel &m)
Prefill the model's octets from a literal dotted-quad string.
constexpr boolkleidos::ui::ipv4ToText (const Ipv4FieldModel &m, char *out, size_t cap)
Format the model as an unpadded dotted quad ("10.0.0.1").
voidkleidos::ui::drawIpv4Field (Canvas &canvas, const LayoutContext &layout, const Rect &box, const Ipv4FieldProps &props)
Draw the NNN.NNN.NNN.NNN address + an optional caption into a rect.
constexpr KeyHintkleidos::ui::glyphHint (IconId glyph, const char *verb, bool primary=false)
A hint for one glyph key and its verb.
constexpr KeyHintkleidos::ui::glyphPairHint (IconId first, IconId second, const char *verb)
A hint for a pair of glyph keys (the arrows) and their verb.
constexpr KeyHintkleidos::ui::wordHint (const char *key, const char *verb, bool primary=false)
A hint whose key is named in a word.
constexpr KeyHintkleidos::ui::capHint (const char *key, const char *verb, bool primary=false)
A hint for a letter key, drawn as its key cap.
Rectkleidos::ui::keyHintShelfRect (const LayoutContext &layout)
The shelf's band: a strip along the bottom of the screen, one small line tall plus its padding.
Rectkleidos::ui::keyButtonRowRect (const LayoutContext &layout)
The row just above the shelf where a keyboard board with a pointer draws its buttons that are also keys, inside the side margins and at least a hit target tall.
voidkleidos::ui::drawKeyHintShelf (Canvas &canvas, const LayoutContext &layout, const Rect &band, const KeyHintShelfProps &props)
Draw the shelf filling band: a surface strip carrying the hints.
constexpr KleidosMarkPartskleidos::ui::kleidosMarkParts (int16_t ringR, bool mono)
The whole-pixel parts of the mark whose ring has mid radius ringR.
constexpr KleidosMarkGeokleidos::ui::kleidosMarkGeoForEdge (int16_t cx, int16_t cy, int16_t edge, bool mono)
The geometry of a still mark drawn in an edge px square.
constexpr int32_tkleidos::ui::logoSub (int32_t halfUnits, int32_t ringR)
A length of the logo grid on the screen, in 1/kMarkSubPx px.
constexpr MarkBodyShapekleidos::ui::kleidosMarkBodyShape (const KleidosMarkGeo &geo, int16_t deciDeg)
The body and keyhole of a color mark, at deciDeg, in sub-pixels.
constexpr StemSegmentkleidos::ui::stemSegment (const KleidosMarkGeo &geo, const KleidosMarkParts &parts, int16_t deciDeg)
The 1-bit stem at deciDeg: from the pivot to its round-capped tip.
constexpr Rectkleidos::ui::keyholeBox (const KleidosMarkGeo &geo, int16_t deciDeg)
The screen box that holds every pixel of the color keyhole at deciDeg.
constexpr Rectkleidos::ui::keyholeRepaintBox (const KleidosMarkGeo &geo, int16_t fromDeciDeg, int16_t toDeciDeg)
The box one keyhole frame repaints: the keyhole before and after.
constexpr Rectkleidos::ui::kleidosMarkBodyBox (const KleidosMarkGeo &geo)
The color body's box, its outline and antialiased edge included.
constexpr uint16_tkleidos::ui::markLineColor (MarkTone tone)
The ring, outline and keyhole color of a tone on a color panel.
constexpr uint16_tkleidos::ui::markFillColor (MarkTone tone)
The body fill of a tone on a color panel.
voidkleidos::ui::drawKleidosMarkBody (Canvas &canvas, const KleidosMarkGeo &geo, const KleidosMarkView &view)
Draw the mark's body and keyhole (no ring).
voidkleidos::ui::drawKleidosMark (Canvas &canvas, const KleidosMarkGeo &geo, const KleidosMarkView &view)
Draw the whole mark: the ring, then the body and keyhole.
voidkleidos::ui::drawKleidosMarkAtEdge (Canvas &canvas, int16_t cx, int16_t cy, int16_t edge, bool mono, uint16_t background)
Draw a still mark in an edge px square centered at (cx, cy).
BatteryLevelkleidos::ui::liveBatteryLevel (PowerManager &power)
The battery level every header shows, read from the board now.
HeaderStatuskleidos::ui::liveHeaderStatus (PowerManager &power)
The header status cluster as the board stands now.
int16_tkleidos::ui::listRowHeight (const LayoutContext &layout, bool twoLine, ListRowSize size=ListRowSize::Compact)
Compute the row height for a layout (single- or two-line rows).
int16_tkleidos::ui::visibleRowCount (const LayoutContext &layout, int16_t contentHeight, bool twoLine, ListRowSize size=ListRowSize::Compact)
Compute how many rows fully fit a content height (the scroll window).
int16_tkleidos::ui::peekRowHeight (const LayoutContext &layout, const Rect &content, bool twoLine, ListRowSize size, int16_t scrollTop, int16_t count)
Height of the trailing "peek" sliver drawn under the last full row.
int16_tkleidos::ui::usableLabelWidth (const LayoutContext &layout, const Rect &content, bool listOverflows, ListRowTrailing trailing, bool hasLeadingIcon=false)
Usable width for a row's primary label, after chrome.
uint16_tkleidos::ui::scrollWindowTop (uint16_t selected, uint16_t count, uint8_t visible, uint16_t prevTop)
Sticky scroll-window top that keeps the selection on screen.
uint16_tkleidos::ui::touchWindowTop (uint16_t selected, uint16_t count, uint8_t visible, uint16_t prevTop, bool followSelection)
The window top of a list whose window a finger may have moved.
uint16_tkleidos::ui::pagedWindowTop (uint16_t selected, uint16_t count, uint8_t visible, uint16_t prevTop)
First visible item of a list that turns whole pages.
uint16_tkleidos::ui::listWindowTop (const LayoutContext &layout, uint16_t selected, uint16_t count, uint8_t visible, uint16_t prevTop)
First visible item of a list on this panel.
int16_tkleidos::ui::rowBandTop (int16_t contentY, float localRowFrac, int16_t rowHeight, int16_t scrollOffsetPx)
Y of a (possibly fractional) local row within a scrolled content rect.
voidkleidos::ui::drawListRowSelectionBand (Canvas &canvas, const LayoutContext &layout, const Rect &box)
Draw only the selection backdrop of a list row (band + focus rail).
voidkleidos::ui::drawListRow (Canvas &canvas, const LayoutContext &layout, const Rect &box, const ListRowProps &props, bool suppressSelectionFill=false)
Draw a single list row filling the supplied rectangle.
voidkleidos::ui::drawMenuList (Canvas &canvas, const LayoutContext &layout, const Rect &content, const MenuListProps &props)
Draw the scrollable list into a content rectangle.
Stackkleidos::ui::notice_stack::layout (Canvas &canvas, std::span< const Part > parts, const Rect &box)
Set parts as a centered column inside box.
Stackkleidos::ui::notice_stack::draw (Canvas &canvas, std::span< const Part > parts, const Rect &box)
Set parts as layout does and draw every row where it landed.
voidkleidos::ui::drawPinDial (Canvas &canvas, const PinDialProps &props)
Draw the timing-arc PIN dial.
voidkleidos::ui::drawPinDialLabel (Canvas &canvas, const PinDialProps &props)
Draw only the centered hero label of a dial.
voidkleidos::ui::drawPinDialRimDigits (Canvas &canvas, const PinDialProps &props, int16_t ringRadius)
Draw the ten rim digits (0..9) riding a clock face around a dial.
voidkleidos::ui::clearPinDial (Canvas &canvas, const PinDialProps &props, uint16_t bg)
Clear the dial, its ring and everything inside it, and nothing else.
voidkleidos::ui::drawEpaperTimingDial (Canvas &canvas, const LayoutContext &layout, int16_t cx, int16_t cy, int16_t radius, uint8_t percent, uint8_t digit)
Draw the e-paper timing dial: rim digits, swept ring, hero numeral.
boolkleidos::ui::drawPinDialSlice (const PinDialProps &props, int16_t fromPercent)
Incrementally extend the swept fill by only the newly revealed slice.
boolkleidos::ui::popupTitleWordsFit (Canvas &canvas, const LayoutContext &layout, int16_t cardW, const PopupCardProps &props)
Whether every word of the title fits a line of the title bar at card width cardW, in the card's own rung (PopupCardProps::titleFont).
boolkleidos::ui::popupTitleReadsWhole (Canvas &canvas, const LayoutContext &layout, int16_t cardW, const PopupCardProps &props)
Whether the title reads whole in the bar at card width cardW: in the card's rung or one the bar steps down to, every word on a line, within the lines the title may take.
int16_tkleidos::ui::popupCardWidthFor (Canvas &canvas, const LayoutContext &layout, int16_t cardW, const PopupCardProps &props)
The width a card should take for its title: cardW, or the whole width of the glass where a word of the title does not fit a line of the card at cardW (popupTitleWordsFit).
int16_tkleidos::ui::popupTitleBarHeight (Canvas &canvas, const LayoutContext &layout, int16_t cardW, const PopupCardProps &props)
Height of the title bar for props at card width cardW.
BackChipRectskleidos::ui::popupCardBackRects (Canvas &canvas, const LayoutContext &layout, const Rect &card, const PopupCardProps &props)
The back chip of a card drawn with PopupCardProps::showBack, and the box a tap on it answers in (the bar's height, from the card edge to one small gap past the chip).
uint16_tkleidos::ui::popupCardFill (const LayoutContext &layout, DialogSeverity tone)
The fill the card's content sits on for tone (the tone's container where it has one, else the surface); paper on a 1-bit panel.
uint16_tkleidos::ui::popupCardAccent (const LayoutContext &layout, DialogSeverity tone)
The tone's accent: the border, and the ink of anything the content marks in the tone (the safety line of a hold).
Rectkleidos::ui::drawPopupCard (Canvas &canvas, const LayoutContext &layout, const Rect &card, const PopupCardProps &props)
Draw the card frame in card and return where its content goes.
int16_tkleidos::ui::progressBarHeight (const LayoutContext &layout)
Compute the natural progress-bar height for a layout.
voidkleidos::ui::drawProgressBar (Canvas &canvas, const LayoutContext &layout, const Rect &box, const ProgressBarProps &props)
Draw a horizontal progress bar filling the supplied rectangle.
voidkleidos::ui::drawProgressArc (Canvas &canvas, const LayoutContext &layout, const ProgressArcProps &props)
Draw a circular progress arc.
int16_tkleidos::ui::minReadableQrBandPx (std::size_t payloadLen, int16_t quietZone=kQrQuietZone)
Smallest band side that renders payloadLen readably.
QrCardPlankleidos::ui::planQrCard (const QrBand &band, const QrCaptionBox &caption, std::size_t payloadLen, int16_t quietZone=kQrQuietZone)
Solve the largest crisp scan card a band holds for a payload.
QrColorskleidos::ui::qrScanColors (bool monochrome)
Dark-on-light module colors for the panel class monochrome names.
constexpr QrFitkleidos::ui::fitQr (int16_t boxPx, int16_t moduleCount, int16_t quietZone=kQrQuietZone)
Choose the module size a box holds (see QrFit).
boolkleidos::ui::drawQr (Canvas &canvas, int16_t x, int16_t y, int16_t targetSizePx, const char *payload, qr::QrEcc ecc=qr::QrEcc::Medium)
Encode payload and draw a scalable QR code into a target box.
boolkleidos::ui::drawQr (Canvas &canvas, int16_t x, int16_t y, int16_t targetSizePx, const char *payload, qr::QrEcc ecc, QrColors colors)
Variant of drawQr with explicit dark / light colors.
boolkleidos::ui::qr::encode (const char *payload, QrEcc ecc, Matrix &out, int &outSize, int forceMask=-1)
Encode payload into a QR module matrix (byte mode).
intkleidos::ui::qr::chooseVersion (std::size_t dataLen, QrEcc ecc)
Smallest version that fits dataLen payload bytes at ecc.
intkleidos::ui::qr::moduleCountFor (std::size_t dataLen, QrEcc ecc)
Side length in modules of the symbol dataLen bytes encode to.
voidkleidos::ui::qr::wifi (WifiPayload &out, const char *ssid, const char *password, WifiAuth auth=WifiAuth::Wpa)
Build a standard WiFi join payload, escaping the special characters.
voidkleidos::ui::drawRowRule (Canvas &canvas, const LayoutContext &layout, int16_t x, int16_t y, int16_t w)
Draw a row separator from x, w wide, on the row's last line y.
int16_tkleidos::ui::chipWidth (Canvas &canvas, const LayoutContext &layout, const char *label)
Compute the pixel width a chip will occupy for a label.
int16_tkleidos::ui::chipWidth (Canvas &canvas, const LayoutContext &layout, const StatusChipProps &props)
Compute the pixel width a chip will occupy for its props.
int16_tkleidos::ui::chipHeight (const LayoutContext &layout)
Compute the pixel height a chip will occupy.
Rectkleidos::ui::drawStatusChip (Canvas &canvas, const LayoutContext &layout, int16_t x, int16_t y, const StatusChipProps &props)
Draw a status pill with its top-left corner at (x, y).
constexpr int32_tkleidos::ui::stepperClamp (int32_t value, int32_t min, int32_t max)
Clamp value to the inclusive [min, max] range.
constexpr int32_tkleidos::ui::stepperPrev (int32_t value, int32_t step, int32_t min, int32_t max)
Next value after a decrement by step, clamped at min.
constexpr int32_tkleidos::ui::stepperNext (int32_t value, int32_t step, int32_t min, int32_t max)
Next value after an increment by step, clamped at max.
int16_tkleidos::ui::stepperHeight (const LayoutContext &layout)
Compute the natural (preferred) stepper height for a layout.
StepperChipskleidos::ui::stepperChipRects (const LayoutContext &layout, const Rect &box)
The − and + chip rects for a stepper drawn in box.
voidkleidos::ui::drawStepper (Canvas &canvas, const LayoutContext &layout, const Rect &box, const StepperProps &props)
Draw a − value + numeric stepper filling the supplied rectangle.
int16_tkleidos::ui::tabBarHeight (const LayoutContext &layout)
Compute the natural tab-strip height for a layout.
voidkleidos::ui::drawTabBar (Canvas &canvas, const LayoutContext &layout, const Rect &band, const TabBarProps &props)
Draw the tab strip filling the supplied rectangle.
std::size_tkleidos::ui::drawTextBox (Canvas &canvas, const LayoutContext &layout, const Rect &rect, const char *text, const TextBoxProps &props, bool wrap=true)
Draw multi-line text inside rect, wrapped to width and clipped to height.
int16_tkleidos::ui::textFieldHeight (const LayoutContext &layout)
Compute the natural text-field height for a layout.
voidkleidos::ui::drawTextField (Canvas &canvas, const LayoutContext &layout, const Rect &box, const TextFieldProps &props)
Draw a single-line text field filling the supplied rectangle.
std::size_tkleidos::ui::text_wrap::wrap (Canvas &canvas, const char *text, hal::display::Font font, int16_t innerW, std::span< WrapLine > lines)
Greedily word-wrap text into rows of at most innerW pixels.
std::size_tkleidos::ui::text_wrap::wrapFitted (Canvas &canvas, const char *text, hal::display::Font font, int16_t innerW, std::span< WrapLine > lines)
Word-wrap text into at most lines.size() rows, cutting the last row with "…" where the words run past it.
WholeWrapkleidos::ui::text_wrap::wrapWhole (Canvas &canvas, const char *text, hal::display::Font font, int16_t innerW, std::span< WrapLine > lines)
Word-wrap text as wrap does, and say whether it reads whole.
int16_tkleidos::ui::text_wrap::widestUnbreakable (Canvas &canvas, const char *text, hal::display::Font font)
Width of the widest part of text that wrapWhole cannot break.
std::size_tkleidos::ui::text_wrap::wrapValue (Canvas &canvas, const char *text, hal::display::Font font, int16_t maxW, std::span< WrapLine > lines, Weight weight=Weight::Regular)
Break a value into rows of at most maxW pixels, so it reads whole.
std::size_tkleidos::ui::text_wrap::valueRows (Canvas &canvas, const char *text, hal::display::Font font, int16_t maxW, std::size_t maxRows, Weight weight=Weight::Regular)
How many rows wrapValue fills for text with a budget of maxRows, without writing them.
int16_tkleidos::ui::text_wrap::measure (Canvas &canvas, const char *text, hal::display::Font font, Weight weight)
Advance width of text in font, in the face weight draws.
constexpr int16_tkleidos::ui::text_wrap::boldFitWidth (int16_t width)
Fit budget for a bold run inside a box of width width.
voidkleidos::ui::text_wrap::fitText (Canvas &canvas, const char *src, hal::display::Font font, int16_t maxW, char *out, std::size_t cap, bool ellipsis=true, Weight weight=Weight::Regular)
Copy src into out cut to fit maxW pixels at font.
LabelLineskleidos::ui::text_wrap::fitLabel (Canvas &canvas, const char *label, int16_t maxW, Weight weight, std::size_t maxLines=kLabelMaxLines)
Set a short label (a choice row, a button caption) in a box maxW pixels wide, whole wherever it can be.
LabelLineskleidos::ui::text_wrap::fitName (Canvas &canvas, const char *name, int16_t maxW, std::size_t maxLines, Weight weight)
Set a record's name in a box maxW pixels wide, whole wherever the box can hold it.
std::size_tkleidos::ui::text_wrap::tailThatFits (Canvas &canvas, const char *text, std::size_t len, hal::display::Font font, int16_t maxW)
Offset of the longest tail of text that fits maxW pixels at font.
Rectkleidos::ui::drawToast (Canvas &canvas, const LayoutContext &layout, const ToastProps &props)
Draw an auto-positioned transient toast near the bottom edge.
Rectkleidos::ui::drawBanner (Canvas &canvas, const LayoutContext &layout, const BannerProps &props)
Draw a full-width status banner pinned to the top or bottom edge.
size_tkleidos::ui::formatTotpCodeGrouped (uint32_t code, uint8_t digits, bool valid, char *out, size_t cap)
Format a TOTP code as the space-grouped mono string.
int16_tkleidos::ui::totpRowCardHeight (const LayoutContext &layout)
Natural Row-style card height for a layout.
int16_tkleidos::ui::totpRowCardHeightIn (const LayoutContext &layout, int16_t bandH)
Row-style card height for a list band of bandH pixels.
Rectkleidos::ui::totpRowRingBounds (const LayoutContext &layout, const Rect &area)
The square a Row-style card's countdown ring occupies inside area.
constexpr uint16_tkleidos::ui::totpCountdownColor (uint8_t remaining)
The one color rule for every TOTP countdown (list rings, the hero ring, the code screen's bar): brand cyan, warning red for the last kTotpUrgentSeconds.
voidkleidos::ui::formatTotpSeconds (uint8_t remaining, char *out, std::size_t cap)
The one spelling of a TOTP countdown's seconds, on every surface: the number, a space and the SI "s" ("24 s"), and a leading "! " for the last kTotpUrgentSeconds ("! 3 s"), so the urgency reads by shape as well as by color. A bare "!3s" read as "13s".
int16_tkleidos::ui::totpHeroCardHeight (const LayoutContext &layout, bool withRing, bool withExpiry)
Natural Hero-style stack height for a layout.
int16_tkleidos::ui::totpCompactCardHeight (const LayoutContext &layout, bool large=false)
Natural Compact-style card height for a layout.
voidkleidos::ui::drawTotpCodeCard (Canvas &canvas, const LayoutContext &layout, const Rect &area, const TotpCodeCardProps &props)
Draw the TOTP code card into area.
TouchKeyboardLetterskleidos::ui::touchKeyboardLettersForLayout (uint8_t layoutIndex)
The letter rows that match a BLE keyboard layout.
voidkleidos::ui::setTouchKeyboardLettersPreference (TouchKeyboardLetters letters)
Set the letter rows the device's keyboards show (the BLE layout setting).
TouchKeyboardLetterskleidos::ui::touchKeyboardLettersPreference ()
The letter rows the device's keyboards show.
uint8_tkleidos::ui::touchKeyboardKeyCount (const TouchKeyboardSheet &sheet)
Number of keys on sheet.
uint8_tkleidos::ui::touchKeyboardFocusCount (const TouchKeyboardSheet &sheet, bool showReveal, bool showCancel=false, bool showSwitch=false)
Number of focus stops: every key, then the reveal, back and switch controls when shown.
int8_tkleidos::ui::touchKeyboardFocusTarget (const TouchKeyboardSheet &sheet, bool showReveal, bool showCancel, uint8_t stop, bool showSwitch=false)
What a focus stop activates.
uint8_tkleidos::ui::touchKeyboardRowLen (const TouchKeyboardSheet &sheet, uint8_t row)
Number of keys in row of sheet.
uint8_tkleidos::ui::touchKeyboardRowStart (const TouchKeyboardSheet &sheet, uint8_t row)
Row-major index of the first key in row of sheet.
TouchKeyboardKeyKindkleidos::ui::touchKeyboardKindAt (const TouchKeyboardSheet &sheet, uint8_t index)
Kind of the key at row-major index index in sheet.
char16_tkleidos::ui::touchKeyboardCodepointAt (const TouchKeyboardSheet &sheet, uint8_t index)
The character a TouchKeyboardKeyKind::Char cell appends.
TouchKeyboardVariantskleidos::ui::touchKeyboardVariantsOf (char16_t base)
The variants a held key offers.
uint8_tkleidos::ui::touchKeyboardEncodeUtf8 (char16_t codepoint, char *out)
Encode one code point as UTF-8.
uint8_tkleidos::ui::touchKeyboardUtf8Length (const char *text, uint8_t bytes)
Characters in a UTF-8 string: every byte that does not continue a sequence.
uint8_tkleidos::ui::touchKeyboardUtf8LastLength (const char *text, uint8_t bytes)
Bytes the last character of a UTF-8 string takes.
Rectkleidos::ui::touchKeyboardFieldRect (const LayoutContext &layout, const Rect &area)
The value-row rectangle at the top of area.
Rectkleidos::ui::touchKeyboardRevealRect (const LayoutContext &layout, const Rect &area)
The reveal control's rectangle at the right end of the value row.
Rectkleidos::ui::touchKeyboardCancelRect (const LayoutContext &layout, const Rect &area)
The back control's rectangle at the left end of the value row.
Rectkleidos::ui::touchKeyboardSwitchRect (const LayoutContext &layout, const Rect &area)
The PIN / passphrase switch's rectangle, just left of the reveal control.
Rectkleidos::ui::touchKeyboardKeyRect (const LayoutContext &layout, const Rect &area, const TouchKeyboardSheet &sheet, uint8_t index)
Screen-space rectangle of one key.
int8_tkleidos::ui::touchKeyboardHitTest (const LayoutContext &layout, const Rect &area, const TouchKeyboardSheet &sheet, bool showReveal, int16_t x, int16_t y, bool showCancel=false, bool showSwitch=false)
Resolve a touch point to the key (or value-row control) under it.
Rectkleidos::ui::touchKeyboardVariantRect (const LayoutContext &layout, const Rect &area, const TouchKeyboardSheet &sheet, uint8_t key, uint8_t count)
The card of a key's variant strip.
Rectkleidos::ui::touchKeyboardVariantCellRect (const LayoutContext &layout, const Rect &area, const TouchKeyboardSheet &sheet, uint8_t key, uint8_t count, uint8_t cell)
One cell of a key's variant strip.
int8_tkleidos::ui::touchKeyboardVariantAt (const LayoutContext &layout, const Rect &area, const TouchKeyboardSheet &sheet, uint8_t key, uint8_t count, int16_t x, int16_t y)
The variant cell a finger over the strip points at.
TouchKeyboardLayerkleidos::ui::touchKeyboardShifted (TouchKeyboardLayer layer)
The layer a TouchKeyboardKeyKind::Shift press moves to.
TouchKeyboardLayerkleidos::ui::touchKeyboardToggled (TouchKeyboardLayer layer)
The layer a TouchKeyboardKeyKind::LayerToggle press moves to.
voidkleidos::ui::drawTouchKeyboard (Canvas &canvas, const LayoutContext &layout, const Rect &area, const TouchKeyboardProps &props)
Draw the value row and the four key rows into area.
Rectkleidos::ui::drawTouchKeyboardKey (Canvas &canvas, const LayoutContext &layout, const Rect &area, const TouchKeyboardProps &props, uint8_t index)
Repaint one key of what drawTouchKeyboard draws, in place.
Rectkleidos::ui::drawTouchKeyboardField (Canvas &canvas, const LayoutContext &layout, const Rect &area, const TouchKeyboardProps &props)
Repaint the value row of what drawTouchKeyboard draws, in place.
voidkleidos::ui::drawTouchKeyboardValue (Canvas &canvas, const Rect &span, const TouchKeyboardProps &props)
Draw the masked value alone inside span, for a host's own field.
int16_tkleidos::ui::tutorialHintHeight (const LayoutContext &layout)
Natural band height for the tutorial hint pill.
voidkleidos::ui::drawTutorialHint (Canvas &canvas, const LayoutContext &layout, const Rect &band, const TutorialHintProps &props)
Draw the tutorial goal pill centered inside band.

Variables

constexpr const char *kleidos::ui::kDialOkLabel
The dial's press, as every footer, tutorial and key legend names it.
constexpr std::size_tkleidos::ui::kActionBarMaxCells
Most cells one bar draws: a dial's two plus its tab, back and lock cells.
constexpr int16_tkleidos::ui::kBatteryLowPct
Reading at or under which the gauge turns the warning red, in percent.
constexpr int16_tkleidos::ui::kBatteryHysteresisPct
constexpr int16_tkleidos::ui::kBatteryLowClearPct
constexpr int16_tkleidos::ui::kBatteryFillInset
Inset of the gauge's fill inside its outline, in pixels.
constexpr uint8_tkleidos::ui::kCharWheelMaxLen
constexpr uint8_tkleidos::ui::kCharWheelStoreCap
constexpr uint8_tkleidos::ui::kCharGroupCount
Number of character groups (the leading group chips in the tool row).
constexpr uint8_tkleidos::ui::kCharWheelChipCount
Number of cells in the tool / chip row (4 group chips + DEL + OK).
constexpr uint8_tkleidos::ui::kIdentityRowMax
Most rows the identity block stacks: username, password, URL and the line.
constexpr std::size_tkleidos::ui::kIdentityValueRowsMax
constexpr std::size_tkleidos::ui::kIdentityMaskGlyphs
constexpr uint16_tkleidos::ui::kDtYearMin
Inclusive lower bound of the editable year range.
constexpr uint16_tkleidos::ui::kDtYearMax
Inclusive upper bound of the editable year range.
constexpr std::size_tkleidos::ui::kDialogBodyMaxLines
Lines a dialog's body may take; past them the last line ends in "…".
constexpr std::size_tkleidos::ui::kDialogNoticeTitleMaxLines
Lines the title of a dialog that asks for nothing (a notice) may take.
constexpr int16_tkleidos::ui::kFieldFocusRulePx
Height of the rule under the field in focus.
constexpr int16_tkleidos::ui::kFieldFocusRuleGapPx
Paper gap between a field line and the rule under its focused field.
constexpr autokleidos::ui::kFieldFocusRuleRoomPx
Room a field line keeps under it for the focus rule.
constexpr int16_tkleidos::ui::kKleidosMarkSolidBodyMaxEdge
constexpr uint8_tkleidos::ui::kHoldRimStepPct
constexpr int16_tkleidos::ui::kIconChipWidth
Drawn width of an icon chip (px); see the file comment for its hit box.
constexpr uint8_tkleidos::ui::kIpv4OctetCount
Number of octets in a dotted-quad IPv4 address (also the field count).
constexpr size_tkleidos::ui::kIpv4TextCap
Buffer capacity (including NUL) that always fits ipv4ToText output.
constexpr uint8_tkleidos::ui::kKeyHintMaxGlyphs
Most key-cap glyphs one hint draws (a pair of chevrons for the arrows).
constexpr int32_tkleidos::ui::kLogoRingRUnits
Logo units from the center to the ring's mid band.
constexpr int32_tkleidos::ui::kLogoEdgeUnits
Logo grid edge (units).
constexpr int16_tkleidos::ui::kKleidosMarkAtEdgeMinOutlined
constexpr int16_tkleidos::ui::kKeyholeFeatherPx
constexpr int32_tkleidos::ui::kStemSubPx
Sub-pixel steps per pixel of the 1-bit stem's endpoints (Canvas::strokeLineAAQ4).
constexpr std::size_tkleidos::ui::notice_stack::kMaxBlocks
Blocks one column may hold.
constexpr std::size_tkleidos::ui::notice_stack::kRowsPerBlock
Rows one block may wrap onto.
constexpr uint8_tkleidos::ui::kNoActiveMarker
constexpr int16_tkleidos::ui::kSweepFromPercent
PinDialProps::sweepDeg value that derives the lit arc from the percent.
constexpr int16_tkleidos::ui::kPinDialClearPad
constexpr int16_tkleidos::ui::kEpaperDialBand
Band width of the e-paper dial's solid ring (px).
constexpr int16_tkleidos::ui::kEpaperDialRimPad
Gap between the ring and the rim digits on e-paper (px).
constexpr floatkleidos::ui::kEpaperDialHeroScale
The hero numeral's scale: the mono face at twice its line height.
constexpr int16_tkleidos::ui::kNoPriorSweep
constexpr std::size_tkleidos::ui::kPopupTitleMaxLines
constexpr int16_tkleidos::ui::kQrMinModulePx
Fewest whole pixels per module a camera can be expected to resolve.
constexpr int16_tkleidos::ui::kQrQuietZone
Width of the light margin drawn around the symbol, in modules.
constexpr intkleidos::ui::qr::kMinVersion
Lowest supported QR version (21x21 modules).
constexpr intkleidos::ui::qr::kMaxVersion
Highest supported QR version — the documented RAM/flash cap (57x57 modules).
constexpr intkleidos::ui::qr::kMaxModules
Module count (side length) of the largest supported version.
constexpr std::size_tkleidos::ui::qr::kMaxMatrixBytes
Worst-case matrix size in bytes (one byte per module at kMaxVersion).
constexpr std::size_tkleidos::ui::qr::kWifiPayloadCap
constexpr uint8_tkleidos::ui::kMaxTabs
Maximum tabs the strip will render (static, no heap).
constexpr int16_tkleidos::ui::kTabUnderlineAuto
constexpr std::array< IconId, 3 >kleidos::ui::kVaultTabIcons
constexpr std::size_tkleidos::ui::kTextBoxMaxLines
Upper bound on rows a single drawTextBox call will wrap and draw.
constexpr std::size_tkleidos::ui::text_wrap::kWrapLineCap
Capacity of one wrapped line buffer including the trailing NUL.
constexpr int16_tkleidos::ui::text_wrap::kBoldFitNum
constexpr int16_tkleidos::ui::text_wrap::kBoldFitDen
Denominator of the bold fit share (see kBoldFitNum).
constexpr std::size_tkleidos::ui::text_wrap::kLabelMaxLines
constexpr std::size_tkleidos::ui::text_wrap::kLabelGrowLines
constexpr std::size_tkleidos::ui::kToastMaxLines
constexpr uint8_tkleidos::ui::kTotpUrgentSeconds
Seconds left at which a TOTP countdown turns to the warning color.
constexpr uint32_tkleidos::ui::kTouchKeyVariantHoldMs
constexpr uint8_tkleidos::ui::kTouchKeyboardRows
Rows on every layer (the numeric and letter tables are both four rows deep).
constexpr uint8_tkleidos::ui::kTouchKeyboardMaxKeys
Largest key count across all layers (the German letter rows' 11 + 11 + 9 + 3).
constexpr uint8_tkleidos::ui::kTouchKeyboardMaxVariants
Most variants one key offers (a: á à ä â ã å æ).
constexpr int8_tkleidos::ui::kTouchKeyboardNoKey
Sentinel returned by touchKeyboardHitTest when a point misses everything.
constexpr int8_tkleidos::ui::kTouchKeyboardRevealKey
Sentinel returned by touchKeyboardHitTest for the reveal control.
constexpr int8_tkleidos::ui::kTouchKeyboardCancelKey
Sentinel returned by touchKeyboardHitTest for the back control.
constexpr int8_tkleidos::ui::kTouchKeyboardSwitchKey
Sentinel returned by touchKeyboardHitTest for the PIN / passphrase switch.

Back to the top

Typedef Documentation

Matrix #

using kleidos::ui::qr::Matrix

Caller-owned, malloc-free module matrix sized for kMaxVersion.

One byte per module: 0 = light, 1 = dark. Only the top-left size * size sub-square (with size returned by encode) is meaningful; the remainder is left untouched. Declare one on the stack and pass it in.

Back to the top

Enumeration Type Documentation

BannerPlacement #

enum class kleidos::ui::BannerPlacement : uint8_t

Where a banner attaches.

Enumerator
Top 

Pinned to the top edge.

Bottom 

Pinned to the bottom edge.

ButtonState #

enum class kleidos::ui::ButtonState : uint8_t

Visual interaction state of a button.

Drives the fill / outline / text-color presentation. The state is supplied by the caller, which chooses it; the component renders every state. Danger is an orthogonal destructive tone applied on top of the normal / focused look.

Enumerator
Normal 

Resting, not focused.

Focused 

Highlighted / has input focus (selected, not yet activated).

Pressed 

Actively pressed / committed (inverted fill).

Disabled 

Inactive — dimmed, non-interactive.

Danger 

Destructive action (delete / wipe) — warning tone.

CharGroup #

enum class kleidos::ui::CharGroup : uint8_t

One character group of the wheel (frequency-ordered).

The four character groups each expose a scrollable ring of pure glyphs. Recovery / commit are utility chips, not a group. The enumerator order is the order the group chips appear in the tool row.

Enumerator
Upper 

A–Z.

Lower 

a–z.

Digits 

0–9.

Separators 

space, -, _, ..

CharWheelChip #

enum class kleidos::ui::CharWheelChip : uint8_t

A cell in the tool / chip row (ABC abc 123 -_. DEL OK).

The four group chips swap the active ring; the DEL and OK utility chips are always one chip-walk away and resolve immediately (they never enter a ring).

Enumerator
GroupUpper 

Enter the CharGroup::Upper ring.

GroupLower 

Enter the CharGroup::Lower ring.

GroupDigits 

Enter the CharGroup::Digits ring.

GroupSeparators 

Enter the CharGroup::Separators ring.

Backspace 

Delete the last appended glyph (utility chip).

Commit 

Save the label and exit (utility chip).

CharWheelMode #

enum class kleidos::ui::CharWheelMode : uint8_t

The two host-owned interaction regions the wheel renders.

The two focus regions of the interaction model: the body (the scrolling ring) and the selector (the top chip row). ui::CharWheelMode::CharScroll is the body region; ui::CharWheelMode::GroupSelect is the selector region.

Enumerator
GroupSelect 

Selector region: chip row active; wheel dimmed.

CharScroll 

Body region: a group's ring active; chips dimmed.

ChipStyle #

enum class kleidos::ui::ChipStyle : uint8_t

Semantic color/role of a status chip.

Maps to a design token color; the component derives the fill/outline + text color from it (and collapses to ink on Mono1). Neutral is the dim default.

Enumerator
Neutral 

Muted track color — inactive / generic tag.

Primary 

Brand cyan — highlighted / selected (e.g. "TOTP").

Success 

Green — OK / on / connected.

Warning 

Red — error / destructive.

Caution 

Yellow — lockout / attention.

Info 

Orange — WiFi / informational.

DialogSeverity #

enum class kleidos::ui::DialogSeverity : uint8_t

Severity tone of a dialog (drives the title accent).

Enumerator
Info 

Neutral — brand cyan title.

Success 

Positive — green title.

Caution 

Soft warning — yellow title.

Danger 

Destructive — red title (delete / wipe).

DropdownTouch #

enum class kleidos::ui::DropdownTouch : uint8_t

What one pointer gesture did to a dropdown.

Enumerator
None 

Nothing to act on.

Moved 

The focus (and maybe the window) moved: repaint.

Commit 

The focused option was tapped again: apply it.

Cancel 

The back chip was tapped: close without applying.

DtField #

enum class kleidos::ui::DtField : uint8_t

Editable fields of a date-time, in left-to-right edit order.

The edit cursor advances Year → Month → Day → Hour → Minute → Zone; advancing past Zone is the commit signal (see dtAdvanceOrCommit). Count is the enumerator count, not a field.

Enumerator
Year 

Full year (2024–2099).

Month 

Month of year (1–12).

Day 

Day of month (1–daysInMonth).

Hour 

Hour of day (0–23).

Minute 

Minute of hour (0–59).

Zone 

Timezone index (0–kZoneCount − 1); the last field.

Count 

Number of fields (not a selectable field).

HeaderGaugeRepaint #

enum class kleidos::ui::HeaderGaugeRepaint : uint8_t

What the gauge on the glass needs on a tick at rest.

Enumerator
None 

The glass shows the live gauge, or shows no header the watch knows.

Wait 

The gauge moved under an overlay that covers it: repaint once it clears.

Gauge 

Repaint the gauge alone, in place.

IconId #

enum class kleidos::ui::IconId : uint8_t

Identifier of a primitive-drawn icon.

The curated catalog the component library and the screens draw: directional dial marks, chevrons, lock/connectivity/battery status, and a few affordance marks (check / back / key / clock / settings). Each maps to a fixed primitive recipe in drawIcon.

Enumerator
DialUp 

Up triangle — CoreInk dial "up" affordance.

DialSelect 

Filled dot — CoreInk dial "select" affordance.

DialDown 

Down triangle — CoreInk dial "down" affordance.

DialUpDown 

Combined up/down triangles — CoreInk dial "scroll" (▲▼) affordance.

ChevronUp 

Up chevron — scroll-up / more-above hint.

ChevronDown 

Down chevron — scroll-down / more-below hint.

ChevronLeft 

Left chevron — previous / back / move-left hint.

ChevronRight 

Right chevron — submenu / next / move-right hint.

Lock 

Closed padlock — vault locked.

Unlock 

Open padlock — vault unlocked.

Wifi 

Wifi arcs — WiFi AP active.

Ble 

Bluetooth rune — BLE active.

Battery 

Battery outline + level fill.

BatteryCharging 

Battery outline + charging bolt.

Check 

Check mark — confirm / success.

Cross 

X mark — reject / failure (wrong PIN).

Back 

Back arrow — navigate up / cancel.

Key 

Key — credential / password.

Credential 

ID card with avatar — a stored credential entry.

Clock 

Clock face — plain time.

Totp 

Circular-arrow timer clock — TOTP / rotating code.

Settings 

Three sliders — settings.

Warning 

Warning triangle with exclamation — destructive / caution.

Keyboard 

Keyboard outline — type / send keystrokes over BLE HID.

Trash 

Trash can — delete an entry (destructive action).

Card 

Card with a header band and two lines — the vault tab.

Menu 

Hamburger (three rules) — the settings / more tab.

Eye 

Open eye — reveal the masked value (secret currently hidden).

EyeOff 

Struck-through eye — hide again (secret currently revealed).

Shift 

Hollow up-arrow (U+21E7) — on-screen keyboard shift key.

Backspace 

Left pentagon with an X (U+232B) — delete the last character.

Plus 

Plus sign — add a new entry (network, host).

Enter 

Return arrow (U+21B5) — the Enter key on a keyboard.

Tap 

A contact point in a ring — a tap on the glass.

SwipeVertical 

Up-and-down double arrow — a vertical swipe (scroll).

SwipeHorizontal 

Left-and-right double arrow — a sideways swipe (tabs).

Person 

Head and shoulders — a username / account.

Globe 

Circle with an equator and a meridian — a web address.

Info 

Ring with a dot over a stem — an informational tone.

KleidosMarkStyle #

enum class kleidos::ui::KleidosMarkStyle : uint8_t

How the pixel-fit mark draws its body.

The ring is drawn in both: the logo never drops it. Below kKleidosMarkSolidBodyMaxEdge the 1 px outline, its accent fill and the keyhole inside it read as one muddy blot at arm's length, so the small mark is the solid-body version.

Enumerator
Outlined 

The accent body with a 1 px primary outline, the keyhole in the primary (variant A): every mark of 24 px and over, the LILYGO T-Deck's 27 px header and the 31 px one of the Core2 v1.3 and the CoreS3 SE.

SolidBody 

The body solid in the ring's color with the keyhole cut out of it, the background showing through (variant B): every mark of 23 px and under, the headers of the Sticks, the M5Cardputer ADV and the CoreInk, and the Sticks' PIN lockup.

ListRowSize #

enum class kleidos::ui::ListRowSize : uint8_t

Vertical density of a list row.

Compact is the default menu/settings row (primary label in the BODY role). Comfortable is the taller two-line pitch the host lists use: the box is sized for the HEADING role with a larger gap to the secondary line, while the label reads at the BODY role like every other list. Cozy is a single-line credential row at the density of the Sticks' vault list: a BODY-role label in a ~32 px box with generous symmetric padding and no secondary line. All resolve their pixel sizes from the LayoutContext token scales, never magic numbers.

Enumerator
Compact 

Default density — BODY-role primary label.

Comfortable 

Taller two-line pitch — BODY-role label in a HEADING-sized box.

Cozy 

Single-line credential row — BODY-role label, ~32 px, no subtitle.

ListRowState #

enum class kleidos::ui::ListRowState : uint8_t

Visual interaction state of a list row.

Supplied by the caller, which chooses it. Back tints the row as a navigation-up affordance; Disabled dims it.

Enumerator
Normal 

Resting, not selected.

Selected 

Highlighted (current selection / focus).

Disabled 

Non-selectable / dim.

Back 

"Back" navigation row (neutral, leading chevron).

Peek 

Next row under the last full one: a dimmed hint, never selected.

Note 

Read-only content line ("No hosts yet"): legible, never selected.

ListRowTrailing #

enum class kleidos::ui::ListRowTrailing : uint8_t

Kind of trailing accessory drawn on the right of a row.

Enumerator
None 

No trailing accessory.

Value 

Right-aligned value string (ListRowProps::trailingText).

ToggleOn 

Toggle shown ON.

ToggleOff 

Toggle shown OFF.

Chevron 

Submenu chevron icon.

Chip 

Semantic status pill (ListRowProps::trailingText + ::trailingChipStyle).

MarkTone #

enum class kleidos::ui::MarkTone : uint8_t

The tone a mark is drawn in.

Enumerator
Idle 

The brand's inks: primary ring and outline on the accent body.

Success 

The success pair: success ring and outline on its container.

Failure 

The failure pair: warning ring and outline on its container.

ProgressTone #

enum class kleidos::ui::ProgressTone : uint8_t

Semantic color tone of a progress indicator.

Enumerator
Primary 

Brand cyan — default / neutral progress.

Success 

Green — completed / healthy.

Warning 

Red — error / critical.

Caution 

Yellow — attention / nearing limit.

QrCaptionSide #

enum class kleidos::ui::QrCaptionSide : uint8_t

Where a scan card's caption sits relative to the symbol.

Enumerator
Below 

Stacked under the symbol (portrait / narrow panels).

Right 

Beside the symbol, spending width instead of height.

QrEcc #

enum class kleidos::ui::qr::QrEcc : uint8_t

Error-correction level (ISO/IEC 18004 §7.5).

Higher levels recover more damaged modules at the cost of capacity (a larger version for the same payload).

Enumerator
Low 

L — ~7% recovery.

Medium 

M — ~15% recovery (default; matches the admin QR card).

Quartile 

Q — ~25% recovery.

High 

H — ~30% recovery.

StepperFocus #

enum class kleidos::ui::StepperFocus : uint8_t

Which stepper affordance currently carries focus.

On a 2-button device only one side is "armed" at a time (the screen toggles which side a tap nudges); the focused side renders with the accent / ink chip.

Enumerator
None 

Neither side highlighted (resting display).

Decrement 

The − side is armed.

Increment 

The + side is armed.

TextFieldState #

enum class kleidos::ui::TextFieldState : uint8_t

Visual interaction state of a text field.

Supplied by the caller, which chooses it. Drives the frame color and whether the caret is rendered.

Enumerator
Normal 

Resting, not focused — secondary-ink frame (7.18:1), no caret.

Focused 

Active input — brand-cyan frame + caret.

Error 

Validation error — warning-red frame.

ToastSeverity #

enum class kleidos::ui::ToastSeverity : uint8_t

Severity tone of a toast / banner (mirrors popup::Severity).

Enumerator
Info 

Neutral — brand cyan accent.

Success 

Positive — green accent.

Caution 

Soft warning — yellow accent.

Warning 

Error / destructive — red accent.

Admin 

Admin-mode banner — the status.info accent (theme::kInfo).

TotpCardStyle #

enum class kleidos::ui::TotpCardStyle : uint8_t

Composition of the TOTP code card.

Enumerator
Hero 

Centered stack: ring above hero code above expiry caption.

Row 

List row: issuer line + code on the left, compact ring right.

Compact 

Centered code with a countdown bar and the seconds under it.

TouchKeyboardKeyKind #

enum class kleidos::ui::TouchKeyboardKeyKind : uint8_t

What a keyboard cell does when activated.

Enumerator
Char 

Append touchKeyboardCodepointAt to the value.

Shift 

Toggle Lower <-> Upper.

Backspace 

Remove the last entered character.

LayerToggle 

Toggle letters <-> Symbols.

Space 

Append a space.

Confirm 

Submit the entered secret.

TouchKeyboardLayer #

enum class kleidos::ui::TouchKeyboardLayer : uint8_t

Which glyph table the keyboard is showing.

Numeric is the PIN surface and is never reachable from the letter layers; the other three are the passphrase surface and cycle through their own shift and layer-toggle keys.

Enumerator
Numeric 

1-9, backspace, 0, confirm — the PIN keypad.

Lower 

qwerty… — the passphrase default layer.

Upper 

QWERTY… — reached by the shift key.

Symbols 

digits and punctuation — reached by the ?123 key.

TouchKeyboardLetters #

enum class kleidos::ui::TouchKeyboardLetters : uint8_t

The letter rows of the passphrase layers, one per keyboard layout.

Index-stable with the BLE keyboard layout setting through touchKeyboardLettersForLayout. The symbol and numeric layers are the same under every entry.

Enumerator
Qwerty 

qwertyuiop / asdfghjkl / zxcvbnm (US, UK, Italian).

Spanish 

QWERTY with ñ closing the home row.

Portuguese 

QWERTY with ç closing the home row.

German 

QWERTZ with ü and ö ä closing the top and home rows.

French 

AZERTY: azertyuiop / qsdfghjklm / wxcvbn.

Weight #

enum class kleidos::ui::text_wrap::Weight : uint8_t

The face a run is drawn in, and so the face it is measured in.

Enumerator
Regular 

Measured by ui::Canvas::measureText.

Bold 

Measured by ui::Canvas::measureTextBold.

WifiAuth #

enum class kleidos::ui::qr::WifiAuth : uint8_t

WiFi authentication type for wifi.

Enumerator
Wpa 

WPA/WPA2/WPA3 (T:WPA) — the common case.

Wep 

Legacy WEP (T:WEP).

Nopass 

Open network (T:nopass); the password field is omitted.

Back to the top

Function Documentation

actionBarCutsCaption() #

bool kleidos::ui::actionBarCutsCaption(Canvas & canvas, const LayoutContext & layout, const ActionBarProps & props)

Whether the bar for props would cut a caption, one size down included.

A base cell's verb steps down a size before it is cut, and only one that does not fit then ends in "…". This reports that last case, for a surface that must not cut its text and can set ActionBarProps::stacked instead.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (measures text).
layoutinResponsive context.
propsinSemantic action slots to present.
Return values
ValueMeaning
trueA caption would be drawn cut.

actionBarHeight() #

int16_t kleidos::ui::actionBarHeight(Canvas & canvas, const LayoutContext & layout, const ActionBarProps & props)

Height the bar for props takes from the bottom edge.

One shelf (LayoutContext::actionBarHeight), or one per base cell when ActionBarProps::stacked applies on this profile. Zero when nothing would be drawn.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (measures the extra cells).
layoutinResponsive context.
propsinSemantic action slots to present.
Returns
Pixels from the bottom edge.

batteryGaugeBodyWidth() #

int16_t kleidos::ui::batteryGaugeBodyWidth(int16_t iconSize)

Width of the gauge's body outline for a status slot of iconSize.

Parameters
NameDirectionMeaning
iconSizeinSide of the header's square status slot, in pixels.
Returns
The body width in pixels.

batteryGaugeFillWidth() #

int16_t kleidos::ui::batteryGaugeFillWidth(int16_t iconSize, const BatteryLevel & level)

Width of the fill a gauge in a status slot of iconSize draws for level.

Parameters
NameDirectionMeaning
iconSizeinSide of the header's square status slot, in pixels.
levelinThe level shown.
Returns
The fill width in pixels: 0 for an empty level or an unknown one.

batteryGaugeSteps() #

uint8_t kleidos::ui::batteryGaugeSteps(int16_t iconSize)

Steps a gauge drawn in a status slot of iconSize can show: one per pixel column of its fill.

Parameters
NameDirectionMeaning
iconSizeinSide of the header's square status slot, in pixels.
Returns
The step count, at least 1.

batteryLevelFor() #

BatteryLevel kleidos::ui::batteryLevelFor(int16_t pct, uint8_t steps)

The level a gauge shows for pct with no history: its own step and the red mark at kBatteryLowPct. A first reading, or a gauge drawn for a fixed percent (the component gallery).

Parameters
NameDirectionMeaning
pctinBattery reading in percent.
stepsinSteps the fill is divided in (at least 1).
Returns
The level.

batteryStepFor() #

uint8_t kleidos::ui::batteryStepFor(int16_t pct, uint8_t steps)

A reading's own step: the fill level nearest to pct.

Parameters
NameDirectionMeaning
pctinBattery reading in percent (clamped to 0..100).
stepsinSteps the fill is divided in (at least 1).
Returns
The step, 0 to steps.

boldFitWidth() #

int16_t kleidos::ui::text_wrap::boldFitWidth(int16_t width)
constexpr

Fit budget for a bold run inside a box of width width.

Parameters
NameDirectionMeaning
widthinWidth of the box the run is drawn in, in pixels.
Returns
The width to fit the run against when measuring it in the regular face (see kBoldFitNum).

brandLogoKey() #

const char * kleidos::ui::brandLogoKey(const BrandMarkProps & props)
constexpr

The string drawBrandMark looks the registry logo up in.

props.url when it is non-empty, else props.domain. A list row passes no URL, so its logo key is its brand token; a detail screen that passes the record's URL looks the logo up there instead. Two surfaces show the same logo for a record exactly when their keys name the same brand.

Parameters
NameDirectionMeaning
propsinThe mark's props.
Returns
The logo lookup key; null or empty when the mark has none.

brandToken() #

const char * kleidos::ui::brandToken(const char * listDomain, const char * name)
constexpr

The string a credential's brand mark is keyed by: its brand token.

The record's list domain when it has one, else its display name. The list domain is the index's domain column, kleidos::vault::listDomain of the record's URL: canonical (no scheme, user info, port or leading www., lowercase) and cut to the column width. The test is on that derived domain, not on the URL, so a URL that names no host ("https://") keys the mark by the name, as a record with no URL does.

Every surface that draws a credential's mark passes this as BrandMarkProps::domain, which is what makes a list row and the record's detail screen agree on the tile color.

Parameters
NameDirectionMeaning
listDomaininThe record's list domain; null or empty when it has none, or when the row's domain has not been read yet.
nameinThe record's display name.
Returns
listDomain when it is non-empty, else name.

buttonHeight() #

int16_t kleidos::ui::buttonHeight(const LayoutContext & layout)

Compute the natural (preferred) button height for a layout.

height = bodyFontHeight + 2 * verticalPadding. A caller may use a taller rect; the component centers the label either way. Exposed so screens can size a button row before drawing.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved body-font height + spacing).
Returns
Preferred button height in pixels.

capHint() #

KeyHint kleidos::ui::capHint(const char * key, const char * verb, bool primary = false)
constexpr

A hint for a letter key, drawn as its key cap.

Parameters
NameDirectionMeaning
keyinThe key's legend (one letter).
verbinWhat the key does.
primaryinWhether it is the screen's main action.
Returns
The hint.

charWheelBandRect() #

Rect kleidos::ui::charWheelBandRect(const LayoutContext & layout, const Rect & area)

The wheel-band sub-rect of area (the horizontal glyph-ring strip).

The band is the middle tier of the editor (chips above, label below). The host uses it to repaint ONLY the sliding ring during a glyph-ring tween, leaving the static chips and label untouched in the framebuffer — a dirty-only fast path that cuts the per-frame render + blit cost so the slide animates smoothly. Returns an empty rect when the band would be too short to render.

Parameters
NameDirectionMeaning
layoutinResponsive context (carries the device profile).
areainSame content rectangle passed to drawCharWheel.
Returns
The band rect, or an empty rect when it would not render.

charWheelChipAt() #

CharWheelChip kleidos::ui::charWheelChipAt(uint8_t col)

The chip at tool-row column col (ABC abc 123 -_. DEL OK).

Parameters
NameDirectionMeaning
colinZero-based chip-row column [0, kCharWheelChipCount).
Returns
The chip kind (group chip or DEL / OK utility chip).

charWheelChipGroup() #

CharGroup kleidos::ui::charWheelChipGroup(CharWheelChip chip)

Map a group chip to the group it enters.

Parameters
NameDirectionMeaning
chipinA group chip (CharWheelChip::GroupUpper … GroupSeparators).
Returns
The target group; defaults to CharGroup::Upper for the utility chips (the caller must check the chip kind first).

charWheelChipLabel() #

const char * kleidos::ui::charWheelChipLabel(CharGroup group)

Short chip label for a group (drawn in the tool row).

Parameters
NameDirectionMeaning
groupinGroup to label.
Returns
A static, NUL-terminated ASCII chip label (e.g. "ABC", "123").

charWheelChipLabelFor() #

const char * kleidos::ui::charWheelChipLabelFor(CharWheelChip chip)

Short ASCII label for a chip-row cell.

Parameters
NameDirectionMeaning
chipinChip to label.
Returns
A static, NUL-terminated ASCII label (e.g. "ABC", "DEL", "OK").

charWheelGlyphAt() #

char kleidos::ui::charWheelGlyphAt(CharGroup group, uint8_t index)

The appendable glyph at index in a character group's ring.

Parameters
NameDirectionMeaning
groupinCharacter group (CharGroup::Upper … ui::CharGroup::Separators).
indexinRing index [0, ringLen) (wrapped modulo the ring length).
Returns
The ASCII glyph at that ring index.

charWheelNextChip() #

CharWheelChip kleidos::ui::charWheelNextChip(CharWheelChip chip)

Advance the group-chip selector by one, wrapping at the chip count.

Parameters
NameDirectionMeaning
chipinCurrent chip.
Returns
The next chip in the chip-row walk.

charWheelNextIndex() #

uint8_t kleidos::ui::charWheelNextIndex(CharGroup group, uint8_t index)

Advance a wheel ring index by one, wrapping at the ring length.

Parameters
NameDirectionMeaning
groupinActive group (determines the ring length).
indexinCurrent ring index.
Returns
The next index, wrapped to [0, ringLen).

charWheelPrevIndex() #

uint8_t kleidos::ui::charWheelPrevIndex(CharGroup group, uint8_t index)

Step a wheel ring index back by one, wrapping at the ring length.

Parameters
NameDirectionMeaning
groupinActive group (determines the ring length).
indexinCurrent ring index.
Returns
The previous index, wrapped to [0, ringLen).

charWheelRingLen() #

uint8_t kleidos::ui::charWheelRingLen(CharGroup group)

Number of cells in a group's ring.

The ring is pure glyphs (no suggestion stop), so the count equals the group's glyph count.

Parameters
NameDirectionMeaning
groupinGroup to measure.
Returns
Ring length (>= 1).

chipHeight() #

int16_t kleidos::ui::chipHeight(const LayoutContext & layout)

Compute the pixel height a chip will occupy.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved small-font height + padding).
Returns
Chip height in pixels.

chipWidth() [1/2] #

int16_t kleidos::ui::chipWidth(Canvas & canvas, const LayoutContext & layout, const char * label)

Compute the pixel width a chip will occupy for a label.

width = textWidth + 2 * horizontalPadding. Lets a caller right-align or pack chips before drawing. Returns 0 for an empty label.

Parameters
NameDirectionMeaning
canvasinSurface (for text measurement in the small role).
layoutinResponsive context (resolved spacing).
labelinChip label.
Returns
Chip width in pixels.

chipWidth() [2/2] #

int16_t kleidos::ui::chipWidth(Canvas & canvas, const LayoutContext & layout, const StatusChipProps & props)

Compute the pixel width a chip will occupy for its props.

As the label-only overload, plus the leading glyph and its gap when StatusChipProps::icon is set. A chip with a glyph and no label is the glyph alone in its padding; one with neither is 0.

Parameters
NameDirectionMeaning
canvasinSurface (for text measurement in the small role).
layoutinResponsive context (padding, glyph size).
propsinThe chip as it will be drawn.
Returns
Width in pixels.

chooseVersion() #

int kleidos::ui::qr::chooseVersion(std::size_t dataLen, QrEcc ecc)

Smallest version that fits dataLen payload bytes at ecc.

Exposed for tests / sizing (the same logic encode uses internally).

Parameters
NameDirectionMeaning
dataLeninPayload length in bytes.
eccinError-correction level.
Return values
ValueMeaning
1..kMaxVersionThe chosen version.
0The payload does not fit within kMaxVersion.

clampDay() #

void kleidos::ui::clampDay(DateTimeFieldModel & m)
constexpr

Re-clamp DateTimeFieldModel::day to the current month's length.

Called after any change to the year or month so a day such as 31 folds down to the last valid day of a shorter month (e.g. Feb 28/29). Also lifts a zero day to 1. Leaves an already-valid day unchanged.

Parameters
NameDirectionMeaning
min, outThe model whose day is re-clamped in place.

clearPinDial() #

void kleidos::ui::clearPinDial(Canvas & canvas, const PinDialProps & props, uint16_t bg)

Clear the dial, its ring and everything inside it, and nothing else.

Fills the disc of radius rOuter + kPinDialClearPad about the dial center in bg, so a repaint of the ring and the hero numeral starts from a clean dial while the rim digits riding outside it (drawPinDialRimDigits) stay as they were. A square of the same half-width is not that: its corners sit √2 further out and cut the numerals on the diagonals (1, 4, 6 and 9 on the Sticks' 135 px panel).

No-op for a non-positive PinDialProps::rOuter.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
propsinCarries the center and PinDialProps::rOuter.
bginBackground color the dial is cleared to (RGB565).

codeOfferHeight() #

int16_t kleidos::ui::codeOfferHeight(const LayoutContext & layout)

Natural height of the offer's stack, for a caller that centers it.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
Stack height in pixels (the hint counted at two lines).

countdownRingSweepDeg() [1/2] #

int16_t kleidos::ui::countdownRingSweepDeg(float fraction)

Swept angle (degrees, clockwise from the top) for a remaining fraction.

Pure sector math shared by the render and the native tests: the sweep is linear in fraction, clamped to [0, 360]. Non-finite input maps to 0.

Parameters
NameDirectionMeaning
fractioninRemaining fraction of the window (1 = full ring).
Returns
Sweep in degrees, 0..360.

countdownRingSweepDeg() [2/2] #

int16_t kleidos::ui::countdownRingSweepDeg(uint16_t remainingSeconds, uint16_t periodSeconds)

Swept angle for a seconds-remaining / period pair (integer-exact).

Convenience overload used by the TOTP surfaces: remaining * 360 / period with the same clamping as the fraction form. A zero periodSeconds yields 0.

Parameters
NameDirectionMeaning
remainingSecondsinSeconds left in the current window.
periodSecondsinWindow length in seconds.
Returns
Sweep in degrees, 0..360.

daysInMonth() #

uint8_t kleidos::ui::daysInMonth(uint16_t year, uint8_t month)
constexpr

Days in month of year, accounting for leap-year February.

The proleptic-Gregorian leap rule (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) is applied so February is 29 days in a leap year and 28 otherwise. An out-of-range month (0 or > 12) returns 31 defensively.

Parameters
NameDirectionMeaning
yearinFull year (e.g. 2026).
monthinMonth of year, 1–12.
Returns
Number of days in that month, 28–31.

draw() #

Stack kleidos::ui::notice_stack::draw(Canvas & canvas, std::span< const Part > parts, const Rect & box)

Set parts as layout does and draw every row where it landed.

Parameters
NameDirectionMeaning
canvasin, outSurface to draw on (inside the caller's frame).
partsinThe blocks, top to bottom.
boxinThe box the column is set in.
Returns
The column that was drawn.

drawActionBar() [1/2] #

void kleidos::ui::drawActionBar(Canvas & canvas, const LayoutContext & layout, const ActionBarProps & props)

Draw the affordance-driven hint bar into the reserved footer shelf.

Lays the bar out across LayoutContext::actionBarHeight at the bottom edge, splits it into one cell per active slot via the flex helper, and for each cell draws the device-appropriate affordance prefix glyph + the slot label. Renders nothing when the profile reserves no action bar (keyboard / pointer devices put their hints on the keys). Pure: no state retained between calls.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
propsinSemantic action slots to present.

drawActionBar() [2/2] #

void kleidos::ui::drawActionBar(Canvas & canvas, const LayoutContext & layout, const ActionBarProps & props, DrawnActionBar & drawn)

Draw the hint bar, as drawActionBar does, and record it in drawn.

The full-draw half of a footer that a hold gauge repaints: every full paint of that footer goes through here, so repaintActionBar knows what is on the glass.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
propsinSemantic action slots to present.
drawnoutWhat the bar now shows.

drawBackKeyCap() #

void kleidos::ui::drawBackKeyCap(Canvas & canvas, const LayoutContext & layout, const Rect & chip)

Draw the mark of a dedicated back key (the CoreInk side key).

A 2 px ink key-cap outline with a left chevron. The key sits outside the glass, so the mark names it instead of inviting a tap. The header draws it in its back chip; a screen without a header (the PIN dial) draws it at headerBackRects' chip.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context.
chipinThe cap's box.

drawBanner() #

Rect kleidos::ui::drawBanner(Canvas & canvas, const LayoutContext & layout, const BannerProps & props)

Draw a full-width status banner pinned to the top or bottom edge.

Pure: no retained state. Draws nothing without a message.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
propsinMessage / severity / placement.
Returns
The drawn banner rectangle (empty rect if nothing was drawn).

drawBodyBattery() #

void kleidos::ui::drawBodyBattery(Canvas & canvas, const LayoutContext & layout, int16_t rightX, int16_t cy, const HeaderGaugeShown & live)

Draw the battery gauge on a screen that has no header bar, on the screen's background, and record it so it stays live at rest.

The header's own gauge (the same step, red mark and charge tint), right-aligned on rightX and centered on cy. Unlike drawStatusBattery it is recorded in glassHeaderGauge as a gauge on the background (HeaderGaugeSlot::onBg), so the main loop repaints it alone when the battery moves, as it does a header's. For a screen whose body already carries the brand (the keyboard boards' lock screen).

Parameters
NameDirectionMeaning
canvasin, outDrawing surface; the background under the gauge is already painted.
layoutinResponsive context (the slot size, the panel's tone).
rightXinRight edge the gauge packs against.
cyinVertical center.
liveinWhat the gauge shows.

drawBrandKeyMark() #

void kleidos::ui::drawBrandKeyMark(Canvas & canvas, const LayoutContext & layout, int16_t centerX, int16_t centerY, int16_t radius)

Draw the Kleidos mark (a keyhole in a ring) at the official geometry.

The product's mark, drawn from ui::Canvas primitives through drawKleidosMarkAtEdge in a square of edge 2 radius + 1, so the small-size rule holds here too: below 24 px a solid body with the keyhole cut out, from 24 px an outlined body, the ring always. Used where no baked mark is available and as the small lockup mark on the PIN screen. Primary on color panels, ink on Mono1.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (carries the device profile / color mode).
centerXinCenter X in pixels.
centerYinCenter Y in pixels.
radiusinHalf the mark's edge in pixels; clamped to a minimum of 6.

drawBrandMark() #

bool kleidos::ui::drawBrandMark(Canvas & canvas, const LayoutContext & layout, const Rect & box, const BrandMarkProps & props)

Draw the brand badge within box, returning true if drawn.

On device, attempts the registry logo for the box size (looked up in props.url when set, else in props.domain); on a miss (or when the letter fallback is forced) draws the deterministic letter tile, colored by props.domain alone. On host only the letter path is compiled, so tests assert the fallback geometry/color.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (carries the device profile).
boxinSquare-ish target rectangle for the badge.
propsinBrand token / label / URL / registry toggle.
Return values
ValueMeaning
trueA badge (logo or letter) was drawn.
falseNothing was drawn (empty box).

drawButton() #

void kleidos::ui::drawButton(Canvas & canvas, const LayoutContext & layout, const Rect & box, const ButtonProps & props)

Draw a pressable button filling the supplied rectangle.

Renders the fill / outline appropriate to the ui::ButtonState, plus a centered label. The label is drawn at the center of box; long labels are not clipped by the backend (the caller sizes box to fit). Pure: no retained state. Draws nothing for an empty rect or an empty label.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
boxinButton rectangle in screen space.
propsinLabel + visual state.

drawCharWheel() #

void kleidos::ui::drawCharWheel(Canvas & canvas, const LayoutContext & layout, const Rect & area, const CharWheelProps & props)

Draw the paged character wheel into area.

Renders, top to bottom: the six tool chips (ABC abc 123 -_. DEL OK; the highlighted / active one boxed or underlined) as the tools, the horizontal wheel with a generous portrait center selection box and faded neighbor previews, a row of position dots marking the ring index, and the in-progress label with a blinking caret pinned to the bottom. In CharWheelMode::GroupSelect the wheel band is dimmed and the chips carry the focus. Pure: no retained state; draws nothing for an empty rect.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
areainContent rectangle to fill (between header and action bar).
propsinHost-owned current state.

drawCharWheelBand() #

void kleidos::ui::drawCharWheelBand(Canvas & canvas, const LayoutContext & layout, const Rect & area, const CharWheelProps & props)

Draw ONLY the wheel band (sliding glyph ring + center box + position dots) of area — not the chips or the label.

The dirty-only companion to drawCharWheel — during a ring-slide tween the chips and label do not change, so the host clears and repaints just charWheelBandRect with this. The caller clears the band background first.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
areainSame content rectangle passed to drawCharWheel.
propsinHost-owned current state.

drawCodeOffer() #

void kleidos::ui::drawCodeOffer(Canvas & canvas, const LayoutContext & layout, const Rect & body, const CodeOfferProps & props)

Draw the offer, centered vertically in body.

Top to bottom: a check mark and CodeOfferProps::typedLine in the success ink, the caption, the code with its countdown bar, and the hint. The background is the caller's.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context.
bodyinRegion between the screen's header and its keys.
propsinTexts and code.

drawColorFieldFocus() #

void kleidos::ui::drawColorFieldFocus(Canvas & canvas, int16_t left, int16_t width, int16_t centerY, int16_t lineH)

Draw the accent rule under the field in focus on a color panel.

The accent tint alone is the kind of single-channel mark WCAG 2.2 SC 1.4.1 rules out, and on these panels the neighboring fields are the same size and weight, so the rule is what says which one a key will change. It sits the same ui::kFieldFocusRuleGapPx under the line as the 1-bit rule does.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
leftinLeft edge of the rule.
widthinWidth of the rule (the field's measured text width).
centerYinVertical center of the field's line.
lineHinHeight of that line.

drawCountdownRing() #

void kleidos::ui::drawCountdownRing(Canvas & canvas, const CountdownRingProps & props)

Draw the countdown ring: dim track + linear remaining-fraction sector.

Color panels fill an anti-aliased annulus sector; non-AA panels draw the crisp per-degree spoke fallback. Pure: no retained state. Draws nothing for a non-positive radius.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
propsinCenter / radius / thickness / fraction / colors.

drawCredIdentity() #

void kleidos::ui::drawCredIdentity(Canvas & canvas, const LayoutContext & layout, const Rect & column, const CredIdentityProps & props)

Draw the identity block into column.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context.
columninThe block's rectangle; rows stack from its top.
propsinWhat the record carries.

drawDateTimeField() #

void kleidos::ui::drawDateTimeField(Canvas & canvas, const LayoutContext & layout, const Rect & box, const DateTimeFieldProps & props)

Draw the YYYY-MM-DD HH:MM timestamp + a zone line into a rectangle.

On a box wide enough for the whole timestamp in the HEADING face (the 320 px panels) it is one BODY line; on a narrower box (the 135 px sticks) the date and the time stack on two HEADING lines, so the digits can take the larger face exactly where they were smallest.

Renders each field as text, highlighting the active field in theme::kPrimary565 and the rest in theme::kText565 over a theme::kBg565 background — solid colors only (no alpha). On a Mono1 / e-paper panel, where the accent prints as ink, the active field is paper text on an ink band its own width, with a 2 px ink rule under the band, and every line keeps room for that rule. Sizes come from the LayoutContext; the component draws nothing for an empty rect or a null model.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile + scales).
boxinField rectangle in screen space.
propsinBorrowed model + resolved zone name.

drawDialog() #

Rect kleidos::ui::drawDialog(Canvas & canvas, const LayoutContext & layout, const DialogProps & props)

Draw a centered modal dialog over the screen.

Sizes a card centered in the layout bounds, renders the title (accent tinted), the word-wrapped body, and the action row (1 or 2 cells presented like the action bar). Pure: no retained state. Draws nothing when there is no title and no body.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
propsinTitle / body / action labels / severity.
Returns
The drawn card rectangle (empty rect if nothing was drawn).

drawDropdown() #

void kleidos::ui::drawDropdown(Canvas & canvas, const LayoutContext & layout, const Rect & box, const DropdownProps & props)

Draw a single-select dropdown popover filling the supplied rectangle.

Renders a surface panel, the optional title band, and the windowed option list: the focused option gets the selection band, the applied option gets a trailing marker. Pure: no retained state. Draws nothing for an empty rect or an empty option list.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
boxinPopover rectangle in screen space.
propsinTitle + options + selection / focus / scroll.

drawEpaperTimingDial() #

void kleidos::ui::drawEpaperTimingDial(Canvas & canvas, const LayoutContext & layout, int16_t cx, int16_t cy, int16_t radius, uint8_t percent, uint8_t digit)

Draw the e-paper timing dial: rim digits, swept ring, hero numeral.

The one drawing of that dial. Unlock enters its PIN on it and setup rehearses on it, so what is practiced is the screen that is met later — a rehearsal drawn a little differently teaches a dial the owner never sees.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (the mono face sizes the rim).
cxinCenter x of the dial.
cyinCenter y.
radiusinOuter radius of the ring.
percentinSweep of the hold, 0..100, clockwise from twelve.
digitinThe numeral under the sweep.

drawHeader() #

int16_t kleidos::ui::drawHeader(Canvas & canvas, const LayoutContext & layout, const HeaderProps & props)

Draw the header / status bar across the top edge.

Renders the surface shelf (or a divider rule on Mono1), the left title (and optional subtitle), and the right-aligned status cluster. Pure: no retained state. Draws nothing when props has no title and no active status flag.

On the glass (Canvas::glassScreen) it rewrites the battery gauge's record (ui/components/header_gauge_watch.h): a header with a battery records its gauge, one without forgets the gauge an earlier header drew.

Returns the status cluster's left edge (the "next available right edge" one gap to the left of the leftmost status token), so a caller that packs a trailing element against the cluster — e.g. the Sticks' clock chip — can position it from the actual drawn geometry instead of re-deriving the token widths. When there is no status cluster this is the right content inset.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (carries the device profile).
propsinTitle / subtitle / status to present.
Returns
Status cluster left edge in pixels (title-clamp boundary before the gap).

drawHeaderBeside() #

HeaderDrawn kleidos::ui::drawHeaderBeside(Canvas & canvas, const LayoutContext & layout, const HeaderProps & props)

Draw the header as drawHeader does, and say which reserve the title kept for the trailing element the caller draws next.

With HeaderProps::titleReserveRightCompact set, the title keeps the full reserve where it (or its short form) still reads whole beside it, and the compact one otherwise, so a "clock not set" chip gives up its word before the title gives up its name. The caller draws its element at the width returned.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (carries the device profile).
propsinTitle / subtitle / status to present.
Returns
The cluster's left edge and the reserve used.

drawHoldRim() #

void kleidos::ui::drawHoldRim(Canvas & canvas, const Rect & row, float progress01, HoldRimState & state, uint8_t stepPct = kHoldRimStepPct)

Paint the rim around row for a hold that is progress01 charged.

The first call lays a dim 1 px track around the whole row; later calls ink the arc the hold has reached, clockwise from the top-left corner, and the rim turns to the success ink once the hold is complete.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface; the call brackets its own frame.
rowinThe row to draw around.
progress01inHold progress, clamped to 0..1.
statein, outThe caller's rim state (see HoldRimState).
stepPctinAdvance step in percent; 0 uses kHoldRimStepPct.

drawIcon() [1/3] #

void kleidos::ui::drawIcon(Canvas & canvas, const Rect & box, IconId id, uint16_t color)

Draw an icon centered inside a box.

The icon is rendered into the largest centered square that fits box, scaled from box size. Pure: emits only Canvas primitive calls, holds no state. Draws nothing for an empty box. The caller passes the resolved RGB565 color, so the icon is color-agnostic (no mono mapping done here).

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
boxinBounding rectangle the icon is centered + scaled into.
idinWhich icon to draw.
colorinAlready-resolved RGB565 draw color.

drawIcon() [2/3] #

void kleidos::ui::drawIcon(Canvas & canvas, int16_t cx, int16_t cy, int16_t size, IconId id, uint16_t color)

Convenience overload: draw an icon from a center point and size.

Builds the centered square box of side size around (cx, cy) and forwards to drawIcon. Lets a caller place an icon by its center without computing the bounding rect.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
cxinCenter X in pixels.
cyinCenter Y in pixels.
sizeinSquare side length in pixels.
idinWhich icon to draw.
colorinAlready-resolved RGB565 draw color.

drawIcon() [3/3] #

void kleidos::ui::drawIcon(Canvas & canvas, int16_t cx, int16_t cy, int16_t size, IconId id, uint16_t color, int16_t minStroke)

Draw an icon centered on a point, with a stroke of at least minStroke.

As the centered overload, but the stroke (about 1/12 of the side) never drops below minStroke: a 1-bit panel draws small marks with 2 px strokes so they do not read as hairlines.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
cxinCenter X in pixels.
cyinCenter Y in pixels.
sizeinSquare side length in pixels.
idinWhich icon to draw.
colorinAlready-resolved RGB565 draw color.
minStrokeinThinnest stroke in pixels.

drawIconChip() #

void kleidos::ui::drawIconChip(Canvas & canvas, const LayoutContext & layout, const Rect & box, const IconChipProps & props)

Draw an icon chip filling box.

Pure: no retained state; draws nothing for an empty rect. Leaves the canvas's known background at the page background, as it found it.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (corner radius).
boxinChip rectangle in screen space.
propsinGlyph and look.

drawIpv4Field() #

void kleidos::ui::drawIpv4Field(Canvas & canvas, const LayoutContext & layout, const Rect & box, const Ipv4FieldProps & props)

Draw the NNN.NNN.NNN.NNN address + an optional caption into a rect.

Octets render zero-padded to three digits in the MONO data font (stable cell layout while stepping), the rest in theme::kText565 over theme::kBg565. The active octet is theme::kPrimary565 with an underline cursor on a color panel, and paper text on an ink band with a rule under it on a 1-bit panel (see field_focus.h); the caption keeps clear of the rule. Sizes come from the LayoutContext; the component draws nothing for an empty rect or a null model.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile + scales).
boxinField rectangle in screen space.
propsinBorrowed model + optional caption.

drawKeyCap() #

void kleidos::ui::drawKeyCap(Canvas & canvas, int16_t cx, int16_t cy, int16_t size, const char * key, uint16_t color)

Draw a letter key as its key cap: the letter, bold, in a rounded box.

The keyboard boards' way to name a key that has no glyph of its own (R, T, E…), beside the action it runs. Draws nothing for an empty key.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
cxinCenter X in pixels.
cyinCenter Y in pixels.
sizeinThe box's side in pixels.
keyinThe key's legend (one letter).
colorinAlready-resolved RGB565 color of the box and the legend.

drawKeyHintShelf() #

void kleidos::ui::drawKeyHintShelf(Canvas & canvas, const LayoutContext & layout, const Rect & band, const KeyHintShelfProps & props)

Draw the shelf filling band: a surface strip carrying the hints.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context.
bandinThe strip to fill.
propsinThe hints.

drawKleidosMark() #

void kleidos::ui::drawKleidosMark(Canvas & canvas, const KleidosMarkGeo & geo, const KleidosMarkView & view)

Draw the whole mark: the ring, then the body and keyhole.

Color: the ring an antialiased band in the tone's hue. 1-bit: an ink ring of the band's width, or for a knockout an ink disc to the ring's outer edge. The caller clears what lies under the mark and brackets the frame.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
geoinThe mark.
viewinHow it is drawn.

drawKleidosMarkAtEdge() #

void kleidos::ui::drawKleidosMarkAtEdge(Canvas & canvas, int16_t cx, int16_t cy, int16_t edge, bool mono, uint16_t background)

Draw a still mark in an edge px square centered at (cx, cy).

The small-size rule in one place: below kleidos::ui::kKleidosMarkAtEdgeMinOutlined the header's pixel-fit mark with a solid body and the keyhole cut out to background; from it up the official geometry with an outlined body. The ring is drawn at every size.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
cxinCenter X.
cyinCenter Y.
edgeinThe square's edge (px).
monoinWhether the panel is 1-bit ink.
backgroundinWhat the mark stands on.

drawKleidosMarkBody() #

void kleidos::ui::drawKleidosMarkBody(Canvas & canvas, const KleidosMarkGeo & geo, const KleidosMarkView & view)

Draw the mark's body and keyhole (no ring).

Color: the body filled in the tone's container and outlined in its hue, the eye and the stem in the hue, in one antialiased pass over what the mark stands on (kleidosMarkBodyShape, Canvas::drawMarkBody). 1-bit: a paper body outlined in ink with an ink keyhole; a knockout frame draws the body in paper with no outline, for an ink disc under it. The caller clears what lies under the body and brackets the frame.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
geoinThe mark.
viewinHow it is drawn.

drawKleidosMarkPrimitive() #

void kleidos::ui::drawKleidosMarkPrimitive(Canvas & canvas, int16_t left, int16_t top, int16_t edge, bool mono, uint16_t background)

Draw the pixel-fit Kleidos mark from canvas primitives.

The parts of kleidosMarkPixels around the center pixel of the edge square at (left, top), in the edge's KleidosMarkStyle. Outlined: a color panel fills the body with the accent and draws the ring, the body outline and the keyhole in the primary; a 1-bit panel draws them in ink and leaves the body paper. Solid body: the ring and the whole body in the primary (ink on a 1-bit panel), then the keyhole in background, so the bar shows through it. The e-paper header draws this, and so does any header where no raster is compiled (the host build).

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
leftinLeft edge of the mark's square.
topinTop edge of the mark's square.
edgeinThe square's edge in pixels.
monoinWhether the panel is 1-bit ink.
backgroundinWhat the mark stands on: the color a solid body's keyhole is cut out to (the bar's surface, or paper).

drawListRow() #

void kleidos::ui::drawListRow(Canvas & canvas, const LayoutContext & layout, const Rect & box, const ListRowProps & props, bool suppressSelectionFill = false)

Draw a single list row filling the supplied rectangle.

Renders the selection highlight, leading marker, width-fitted primary (and secondary) label, and the trailing accessory. Long labels are truncated by bounds math (no backend clip). Pure: no retained state. Draws nothing for an empty rect.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
boxinRow rectangle in screen space.
propsinRow content + state.
suppressSelectionFillinWhen true, a Selected row keeps its selected text/marker styling but does NOT paint its own background fill — used by the animated list, which draws one continuous sliding highlight band behind the rows instead.

drawListRowSelectionBand() #

void kleidos::ui::drawListRowSelectionBand(Canvas & canvas, const LayoutContext & layout, const Rect & box)

Draw only the selection backdrop of a list row (band + focus rail).

The exact selected-row visual drawListRow paints (flat accent band + kPrimary left rail on color panels; full ink inversion + paper marker bar on Mono1), exposed so custom-anatomy rows (e.g. the TOTP tab's code rows) reuse the one selection styling instead of re-deriving it. Draws nothing for an empty rect.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
boxinRow rectangle in screen space.

drawMenuList() #

void kleidos::ui::drawMenuList(Canvas & canvas, const LayoutContext & layout, const Rect & content, const MenuListProps & props)

Draw the scrollable list into a content rectangle.

Lays rows top-to-bottom from scrollTop, drawing only the rows that fit content (the visible window), maps selected to the highlighted row, and draws a scroll-rail / chevron hint whenever the list is longer than the window (count > visibleRows — the same condition under which scrollWindowTop can move the window, and the same one that reserves the rail's gutter width, so the affordance and its gutter always agree). The trailing peek sliver never enters that decision: it is a reduced render, not a resting place for the selection. Pure: no retained state. Draws nothing for an empty rect or zero items.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
contentinContent rectangle the list fills.
propsinItems / selected / scrollTop.

drawMonoFieldFocus() #

void kleidos::ui::drawMonoFieldFocus(Canvas & canvas, const char * text, int16_t left, int16_t centerY, hal::display::Font font, int16_t bandH)

Draw the field in focus on a 1-bit panel: paper text on an ink band, with an ink rule under the band.

The band is the text's measured width by bandH, centered on centerY; the rule runs the band's width, ui::kFieldFocusRuleGapPx below it.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
textinThe field's text.
leftinLeft edge of the band and of the text.
centerYinVertical center of the band and of the text.
fontinFont role the text is set in.
bandHinHeight of the band: the line the text sits on.

drawPinDial() #

void kleidos::ui::drawPinDial(Canvas & canvas, const PinDialProps & props)

Draw the timing-arc PIN dial.

Composition order gives ring presence at idle and bright progress on top:

  1. TRACK: the full annulus (0..360) in the dim track color.
  2. PROGRESS: the lit arc in the bright fill color, from PinDialProps::startDeg for PinDialProps::sweepDeg (or percent*360/100) degrees.
  3. OUTLINES: the two concentric circle edges.
  4. MARKERS: the exterior per-digit ticks.
  5. LABEL: the optional centered hero numeral.

On a color panel with a readable framebuffer the annulus / outline steps use the coverage-AA primitives; otherwise they use the crisp concentric-circle + point-plotted-sweep fallback. Pure: no retained state. Draws nothing for a non-positive PinDialProps::rOuter.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper / host).
propsinCenter / radii / band / percent / colors / label.

drawPinDialLabel() #

void kleidos::ui::drawPinDialLabel(Canvas & canvas, const PinDialProps & props)

Draw only the centered hero label of a dial.

Renders PinDialProps::label centered on (PinDialProps::cx, PinDialProps::cy) in PinDialProps::labelColor at the LARGE font's native size (bold). Called internally by drawPinDial; exposed so a caller that composes the dial and its hero in separate passes can reuse the exact same hero render. No-op for an empty label.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
propsinCarries the label, its center, and its color.

drawPinDialRimDigits() #

void kleidos::ui::drawPinDialRimDigits(Canvas & canvas, const PinDialProps & props, int16_t ringRadius)

Draw the ten rim digits (0..9) riding a clock face around a dial.

The dial has a ring of rim numerals in place of tick markers: digit 0 at 12 o'clock, increasing clockwise (matching the sweep), each glyph centered on the circle of radius ringRadius about (PinDialProps::cx, PinDialProps::cy) in the MONO data face. The digit at PinDialProps::activeMarker renders live (bold, in PinDialProps::markerActive); every other digit renders in the dim PinDialProps::marker ink. Out-of-range activeMarker (e.g. kNoActiveMarker) highlights none. The caller computes ringRadius so the glyph band nests outside the ring (typically rOuter + pad + monoLineHeight/2) and reserves that room in its layout.

Shared by the PIN entry and the dial tutorial of first-time setup, so the practice dial is pixel-true to the real one.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
propsinCarries the center, the dim/live inks (marker / markerActive), and the live digit (activeMarker).
ringRadiusinRadius of the glyph-center circle (px).

drawPinDialSlice() #

bool kleidos::ui::drawPinDialSlice(const PinDialProps & props, int16_t fromPercent)

Incrementally extend the swept fill by only the newly revealed slice.

For a monotonically growing gauge (the PIN timing dial within one digit), the fill wedge only ever advances. Instead of repainting the whole [0, sweepDeg] wedge each frame (drawPinDial), this paints just the angular slice [fromPercent, to props.percent] of the annulus in PinDialProps::fill over the existing track — a few-degree band per frame — leaving the track, outlines, markers and hero label untouched. The caller is responsible for the static chrome (drawn once on the prior full frame).

Color-TFT (AA) only and a no-op when ui::aa::available() is false or the span is empty; the caller falls back to drawPinDial on non-AA backends or when there is no valid prior sweep (kNoPriorSweep, a digit boundary, or a backwards step).

Parameters
NameDirectionMeaning
propsinDial geometry + colors; PinDialProps::percent is the NEW (target) fill.
fromPercentinThe fill the dial was last painted at (0..100); the slice spans [fromPercent, percent]. kNoPriorSweep or a value >= percent paints nothing.
Returns
true if the slice was painted incrementally; false if the caller must fall back to a full drawPinDial.

drawPopupCard() #

Rect kleidos::ui::drawPopupCard(Canvas & canvas, const LayoutContext & layout, const Rect & card, const PopupCardProps & props)

Draw the card frame in card and return where its content goes.

The rectangle below the title bar, inset by the card's padding. The known background is left set to the content fill. Marks the open frame heavy (Canvas::markHeavyFrame), so the card composes and blits at the frame clock.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context.
cardinThe whole card, bar included.
propsinTitle, tone and icon.
Returns
The content rectangle.

drawProgressArc() #

void kleidos::ui::drawProgressArc(Canvas & canvas, const LayoutContext & layout, const ProgressArcProps & props)

Draw a circular progress arc.

Renders the dim ring track plus the filled arc (clockwise from the top) and an optional centered label. The backend exposes no native arc primitive: the track is short chord segments and the fill is a fan of radial spokes that overlap into a solid annulus; the angular step is coarsened on e-paper to limit refresh cost. Pure: no retained state. Draws nothing for a non-positive radius.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
propsinCenter / radius / thickness / percent / tone / label.

drawProgressBar() #

void kleidos::ui::drawProgressBar(Canvas & canvas, const LayoutContext & layout, const Rect & box, const ProgressBarProps & props)

Draw a horizontal progress bar filling the supplied rectangle.

Renders the rounded track plus the filled portion sized by percent. Pure: no retained state. Draws nothing for an empty rect.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
boxinBar rectangle in screen space.
propsinPercent + tone.

drawQr() [1/2] #

bool kleidos::ui::drawQr(Canvas & canvas, int16_t x, int16_t y, int16_t targetSizePx, const char * payload, qr::QrEcc ecc, QrColors colors)

Variant of drawQr with explicit dark / light colors.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
xinTop-left X of the target box.
yinTop-left Y of the target box.
targetSizePxinDesired square side in pixels.
payloadinNUL-terminated payload string.
eccinError-correction level.
colorsinDark / light module colors.
Return values
ValueMeaning
trueThe QR was encoded and drawn.
falseEncoding failed; nothing drawn.

drawQr() [2/2] #

bool kleidos::ui::drawQr(Canvas & canvas, int16_t x, int16_t y, int16_t targetSizePx, const char * payload, qr::QrEcc ecc = qr::QrEcc::Medium)

Encode payload and draw a scalable QR code into a target box.

Encodes with the in-house byte-mode encoder (auto-version), then fills the dark modules through canvas, centered in the targetSizePx box at (x, y) with a quiet-zone light border. Draws nothing (returns false) if the payload cannot be encoded at ecc within the encoder's version cap.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
xinTop-left X of the target box.
yinTop-left Y of the target box.
targetSizePxinDesired square side in pixels (the QR is centered inside it on an integer module grid).
payloadinNUL-terminated payload string.
eccinError-correction level (default Medium).
Return values
ValueMeaning
trueThe QR was encoded and drawn.
falseEncoding failed (payload too long for the version cap); nothing drawn.

drawRowRule() #

void kleidos::ui::drawRowRule(Canvas & canvas, const LayoutContext & layout, int16_t x, int16_t y, int16_t w)

Draw a row separator from x, w wide, on the row's last line y.

Monochrome only: on a color panel the rows are separated by their own fills and a rule would only add noise, so nothing is drawn.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (its profile decides the treatment).
xinLeft edge of the rule.
yinRow of pixels the rule occupies.
winWidth of the rule.

drawStatusBattery() #

void kleidos::ui::drawStatusBattery(Canvas & canvas, const LayoutContext & layout, int16_t rightX, int16_t cy, const HeaderGaugeShown & live)

Draw the header's battery gauge outside a header, right-aligned on rightX and centered on cy, over the background already there.

For a screen with no header bar that still shows the battery (the Core's PIN column). The gauge is the header's own: the same step, red mark and charge tint. It is not recorded for the at-rest repaint (header_gauge_watch.h).

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (the slot size, the panel's tone).
rightXinRight edge the gauge packs against.
cyinVertical center.
liveinWhat the gauge shows.

drawStatusChip() #

Rect kleidos::ui::drawStatusChip(Canvas & canvas, const LayoutContext & layout, int16_t x, int16_t y, const StatusChipProps & props)

Draw a status pill with its top-left corner at (x, y).

Self-sizes from the label; use chipWidth / chipHeight to lay out around it. Pure: no retained state. A chip with a glyph and no label draws the glyph alone, centered in the pill; one with neither draws nothing.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (carries the device profile).
xinLeft edge in pixels.
yinTop edge in pixels.
propsinChip label / style / fill.
Returns
The drawn chip rectangle (empty rect if nothing was drawn).

drawStepper() #

void kleidos::ui::drawStepper(Canvas & canvas, const LayoutContext & layout, const Rect & box, const StepperProps & props)

Draw a − value + numeric stepper filling the supplied rectangle.

Renders the two square affordance chips at the rectangle's left / right edges and the centered StepperProps::valueText between them. The focused side gets the accent (color) or ink (mono) chip; an at-bound side renders disabled (dimmed). Pure: no retained state. Draws nothing for an empty rect.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
boxinStepper rectangle in screen space.
propsinValue + bounds + focus.

drawTabBar() #

void kleidos::ui::drawTabBar(Canvas & canvas, const LayoutContext & layout, const Rect & band, const TabBarProps & props)

Draw the tab strip filling the supplied rectangle.

Splits band into min(count, kMaxTabs) equal cells, draws each label centered, and highlights the selected one (accent fill + underline on color, K0-inverse cell on Mono1). Pure: no retained state. Draws nothing for an empty band or zero tabs.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
bandinTab-strip rectangle in screen space.
propsinLabels / count / selected index.

drawTextBox() #

std::size_t kleidos::ui::drawTextBox(Canvas & canvas, const LayoutContext & layout, const Rect & rect, const char * text, const TextBoxProps & props, bool wrap = true)

Draw multi-line text inside rect, wrapped to width and clipped to height.

When wrap is true the text is greedily word-wrapped to rect.w and the resulting rows are drawn from the top; when false the text is treated as a single line. Either way an exact software clip is armed to rect for the duration of the draw, so rows (or a long unwrapped line) that exceed the box are cut at its edges and never paint outside it. The clip is released before returning. Pure: no retained state. Draws nothing for an empty rect or text.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (line-height metrics, profile).
rectinDestination rectangle in screen space.
textinNUL-terminated text to lay out.
propsinFont / color / datum / bold / line spacing.
wrapinWord-wrap to rect.w when true; single line when false.
Returns
Number of lines actually drawn (before height clipping drops pixels).

drawTextField() #

void kleidos::ui::drawTextField(Canvas & canvas, const LayoutContext & layout, const Rect & box, const TextFieldProps & props)

Draw a single-line text field filling the supplied rectangle.

Renders the framed box, the visible (caret-anchored) tail of the content (or the dim placeholder when empty), and the caret when focused. Masks each glyph with * in password mode. Only the characters that fit the inner width are drawn (bounds math; no backend clip). Pure: no retained state. Draws nothing for an empty rect.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
boxinField rectangle in screen space.
propsinContent / placeholder / state / password / caret.

drawToast() #

Rect kleidos::ui::drawToast(Canvas & canvas, const LayoutContext & layout, const ToastProps & props)

Draw an auto-positioned transient toast near the bottom edge.

Self-sizes from the longer of title / detail, centers horizontally, and floats above the action-bar shelf. Pure: no retained state. Draws nothing without a title.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
propsinTitle / detail / severity.
Returns
The drawn toast rectangle (empty rect if nothing was drawn).

drawTotpCodeCard() #

void kleidos::ui::drawTotpCodeCard(Canvas & canvas, const LayoutContext & layout, const Rect & area, const TotpCodeCardProps & props)

Draw the TOTP code card into area.

Hero style centers the ring/code/caption stack vertically in area; Row style lays the issuer + code left and the compact ring right. Pure: no retained state; the background is the caller's (region fills stay at the call site so dirty-only repaints keep working). Draws nothing for an empty rect.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
areainCard rectangle in screen space.
propsinCode / window / style / gate.

drawTouchKeyboard() #

void kleidos::ui::drawTouchKeyboard(Canvas & canvas, const LayoutContext & layout, const Rect & area, const TouchKeyboardProps & props)

Draw the value row and the four key rows into area.

Pure: no retained state, draws nothing for an empty rect. The caller brackets the frame and owns anything outside area.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context (carries the device profile).
areainContent rectangle to fill.
propsinHost-owned current state.

drawTouchKeyboardField() #

Rect kleidos::ui::drawTouchKeyboardField(Canvas & canvas, const LayoutContext & layout, const Rect & area, const TouchKeyboardProps & props)

Repaint the value row of what drawTouchKeyboard draws, in place.

Clears touchKeyboardFieldRect to the background and draws the row (the value or its placeholder, the label, the hint, the reveal, back and switch controls and the rule under them) as drawTouchKeyboard does. Plaintext reaches it under the same rule: only TouchKeyboardProps::plain while TouchKeyboardProps::revealed.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface; the caller brackets the frame.
layoutinResponsive context.
areainThe rectangle drawTouchKeyboard was drawn into.
propsinHost-owned current state.
Returns
The row repainted (empty when nothing was).

drawTouchKeyboardKey() #

Rect kleidos::ui::drawTouchKeyboardKey(Canvas & canvas, const LayoutContext & layout, const Rect & area, const TouchKeyboardProps & props, uint8_t index)

Repaint one key of what drawTouchKeyboard draws, in place.

Clears the key's box to the background and draws the key as drawTouchKeyboard does for props, so the box ends exactly as a whole repaint would leave it. For a change that only touches keys and the value row (the pressed key, the length): the focus box and the variant strip, which draw over the keys, need the whole keyboard repainted instead.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface; the caller brackets the frame.
layoutinResponsive context.
areainThe rectangle drawTouchKeyboard was drawn into.
propsinHost-owned current state.
indexinRow-major key index on the props' layer; out of range draws nothing.
Returns
The box repainted (empty when nothing was).

drawTouchKeyboardValue() #

void kleidos::ui::drawTouchKeyboardValue(Canvas & canvas, const Rect & span, const TouchKeyboardProps & props)

Draw the masked value alone inside span, for a host's own field.

For a host that keeps the value out of the keyboard's area (TouchKeyboardProps::valueRow off) and draws its own field box: the free-length mask row (bullets windowed to the span, then the caret when TouchKeyboardProps::caretOn), or the revealed plaintext, right-anchored, under the same rule as the value row (TouchKeyboardProps::plain read only while TouchKeyboardProps::revealed). Clears nothing; draws nothing for an empty span or an empty value.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface; the caller brackets the frame and clears the span.
spaninWhere the value goes, vertically centered.
propsinHost-owned current state.

drawTutorialHint() #

void kleidos::ui::drawTutorialHint(Canvas & canvas, const LayoutContext & layout, const Rect & band, const TutorialHintProps & props)

Draw the tutorial goal pill centered inside band.

Pending (done == false) renders an outlined primary chip; done renders a filled success chip — the caption text carries the state as well, so the flip never relies on color alone. Pure: no retained state. Draws nothing for an empty band or an empty caption.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (color TFT or Mono1 e-paper).
layoutinResponsive context (carries the device profile).
bandinBand rectangle the pill is centered in (screen space).
propsinCaption + done flag.

dropdownBackRects() #

BackChipRects kleidos::ui::dropdownBackRects(const LayoutContext & layout, const Rect & box, const DropdownProps & props)

Geometry of the title band's back chip — the one definition the draw and the hit test share.

The chip sits at the band's left; its hit box runs from the screen edge to one small gap past it, from the top of the screen to the bottom of the band.

Parameters
NameDirectionMeaning
layoutinResponsive context.
boxinPopover rectangle, the same one passed to drawDropdown.
propsinThe props the popover is drawn with.
Returns
The chip and its hit box; both empty unless DropdownProps::showBack is set and the popover has a title band.

dropdownBodyRect() #

Rect kleidos::ui::dropdownBodyRect(const LayoutContext & layout, const Rect & box, const char * title)

The rect drawDropdown lays its option rows in: the popover minus its title band.

The one definition of where the rows are. Anything that windows, scrolls or hit-tests the rows reads it from here; computing the title band a second way is how a scroll window drifts a row away from the rows drawn, and how a tap lands on the option above the one under the finger.

Parameters
NameDirectionMeaning
layoutinResponsive context.
boxinPopover rectangle, the same one passed to drawDropdown.
titleinThe same title passed in DropdownProps (null or empty: no band).
Returns
The body rect; empty when the title band fills the box.

dropdownKeepsActionBar() #

bool kleidos::ui::dropdownKeepsActionBar(const LayoutContext & layout)

Whether dropdownPopoverBox stops above the action bar.

True on the boards that read their keys from a bar of captions (two or three face keys, or zones with a reserved shelf): there the popover leaves the bar on screen, and the screen that shows it draws the picker's own bindings in it.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Return values
ValueMeaning
trueThe bar stays visible below the popover.
falseThe popover reaches the bottom margin.

dropdownPopoverBox() #

Rect kleidos::ui::dropdownPopoverBox(const LayoutContext & layout, uint8_t optionCount = 0, const char * title = nullptr)

The popover rect of a picker: the screen less a small margin that frames it, ending above the first row the pointer does not own (on a board whose A/B/C zones are a band of the screen) and above the action bar where the picker keeps one.

Passing optionCount shrinks the box to the height its content needs, anchored at the top, so a short picker draws no empty surface. The draw, the scroll windowing and the pointer must all be given the same arguments.

Parameters
NameDirectionMeaning
layoutinResponsive context.
optionCountinOptions the picker lists; 0 keeps the full height.
titleinThe picker's title, or null when it has no title band.
Returns
The box to pass to drawDropdown and resolveDropdownTouch.

dropdownRowHeight() #

int16_t kleidos::ui::dropdownRowHeight(const LayoutContext & layout)

Height of a single dropdown option row for a layout.

height = bodyFontHeight + 2 * verticalPadding, matching the compact list row so a dropdown and the settings list read at the same rhythm.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
Option row height in pixels.

dropdownScrollTop() #

uint8_t kleidos::ui::dropdownScrollTop(uint8_t focus, uint8_t count, uint8_t visible, uint8_t prevTop)

Clamp / advance the scroll window so the focused option is visible.

Mirrors the menu-list windowing: if the cursor is above the window the top is pulled up; if below, the top is pushed down. Pure; no retained state.

Parameters
NameDirectionMeaning
focusinCursor option index.
countinTotal option count.
visibleinVisible row count.
prevTopinPrevious window top.
Returns
The clamped / advanced window top.

dropdownVisibleRows() #

int16_t kleidos::ui::dropdownVisibleRows(const LayoutContext & layout, int16_t bodyH)

Number of option rows that fit in a panel body of bodyH pixels.

Parameters
NameDirectionMeaning
layoutinResponsive context.
bodyHinAvailable body height in pixels (panel minus title).
Returns
Visible row count (>= 0).

dtAdvanceOrCommit() #

bool kleidos::ui::dtAdvanceOrCommit(DateTimeFieldModel & m)
constexpr

Advance to the next field, or signal commit when past the last field.

If the active field is before Zone, moves to the next field and returns false (keep editing). If the active field is already Zone, returns true — the caller commits the edited date-time — and leaves active on Zone so a re-entry resumes on the last field.

Parameters
NameDirectionMeaning
min, outThe model; its active advances when not yet at Zone.
Return values
ValueMeaning
trueThe user advanced past Zone: commit the value.
falseStill editing: active now points at the next field.

dtDecrement() #

void kleidos::ui::dtDecrement(DateTimeFieldModel & m)
constexpr

Decrement the active field by one, wrapping at its lower bound.

Wrap-around per field: year 2024→2099, month 1→12, day 1→(max), hour 0→23, minute 0→59, zone 0→(kZoneCount − 1). Changing the year or month re-clamps the day via clampDay so it never exceeds the new month.

Parameters
NameDirectionMeaning
min, outThe model; its DateTimeFieldModel::active field is nudged.

dtIncrement() #

void kleidos::ui::dtIncrement(DateTimeFieldModel & m)
constexpr

Increment the active field by one, wrapping at its upper bound.

Wrap-around per field: year 2099→2024, month 12→1, day (max)→1, hour 23→0, minute 59→0, zone (kZoneCount − 1)→0. Changing the year or month re-clamps the day via clampDay so it never exceeds the new month.

Parameters
NameDirectionMeaning
min, outThe model; its DateTimeFieldModel::active field is nudged.

encode() #

bool kleidos::ui::qr::encode(const char * payload, QrEcc ecc, Matrix & out, int & outSize, int forceMask = -1)

Encode payload into a QR module matrix (byte mode).

Auto-selects the smallest version in [kMinVersion, kMaxVersion] that holds the data at ecc, runs the full pipeline (data + RS ECC + interleave + pattern placement + masking + format/version info), and writes the dark/light module grid into out.

Host-testable and deterministic: no I/O, and the only allocation is the lazily heap-backed worst-case scratch (see RAM cost of the version cap), shared across calls and never freed. Non-reentrant — call it from a single task.

Parameters
NameDirectionMeaning
payloadinNUL-terminated payload; each byte is encoded verbatim (ISO-8859-1 / UTF-8 bytes pass through). nullptr is treated as empty.
eccinError-correction level.
outoutCaller-owned matrix; the encoded grid lands top-left.
outSizeoutSide length in modules of the produced matrix.
forceMaskinOptional fixed mask 0..7 for deterministic known-answer tests; -1 (default) selects the lowest-penalty mask per the spec.
Return values
ValueMeaning
trueEncoded successfully; outSize is valid.
falsePayload does not fit at ecc within kMaxVersion, an invalid forceMask, or the scratch allocation failed. out / outSize are unspecified.

fitLabel() #

LabelLines kleidos::ui::text_wrap::fitLabel(Canvas & canvas, const char * label, int16_t maxW, Weight weight, std::size_t maxLines = kLabelMaxLines)

Set a short label (a choice row, a button caption) in a box maxW pixels wide, whole wherever it can be.

The label is measured in the face it is drawn in and takes the first setting that holds it whole: one line in BODY, one line in SMALL, then two lines in SMALL split at the space that leaves the longer line shortest, then, where maxLines allows three, three SMALL lines of whole words. Only a label that not even those hold (or a single word wider than the box in SMALL) is cut, over two lines, each line that runs past the box ending in "…". The setting depends only on the label, the width, the weight and the line budget, so a row measured in the face it takes when focused keeps its size as the focus moves.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
labelinNUL-terminated UTF-8 label (nullptr yields no lines).
maxWinWidth of the box the label is drawn in, in pixels.
weightinFace the label is drawn in.
maxLinesinLines the box can grow to: kLabelMaxLines, or kLabelGrowLines where the box grows to three.
Returns
The font and the lines to draw.

fitName() #

LabelLines kleidos::ui::text_wrap::fitName(Canvas & canvas, const char * name, int16_t maxW, std::size_t maxLines, Weight weight)

Set a record's name in a box maxW pixels wide, whole wherever the box can hold it.

The name a credential screen titles itself with. It takes the first setting that holds it whole: one line in HEADING, one in BODY, one in SMALL, then, when maxLines allows two, two SMALL lines broken as wrapValue breaks a value (at a space, then at a joint). Only a name that not even those hold is cut, its last line ending in "…".

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
nameinNUL-terminated UTF-8 name (nullptr or empty yields no lines).
maxWinWidth of the box, in pixels.
maxLinesinLines the box has room for (1 or 2; 0 is taken as 1).
weightinFace the name is drawn in.
Returns
The font and the lines to draw.

fitQr() #

QrFit kleidos::ui::fitQr(int16_t boxPx, int16_t moduleCount, int16_t quietZone = kQrQuietZone)
constexpr

Choose the module size a box holds (see QrFit).

modulePx is boxPx / gridModules, floored and clamped to at least 1, so renderedPx exceeds boxPx only in the clamped case (a box too small for even one pixel per module). A caller that must not overflow checks renderedPx <= boxPx.

Parameters
NameDirectionMeaning
boxPxinSquare side available, in pixels.
moduleCountinSymbol side in modules; <= 0 yields an empty fit.
quietZoneinLight margin in modules (negative reads as 0).
Returns
The grid, module size and rendered square side.

fitText() #

void kleidos::ui::text_wrap::fitText(Canvas & canvas, const char * src, hal::display::Font font, int16_t maxW, char * out, std::size_t cap, bool ellipsis = true, Weight weight = Weight::Regular)

Copy src into out cut to fit maxW pixels at font.

Text that fits is copied as-is. Text that does not is cut on a whole UTF-8 code point — never inside one, which would leave a broken byte on a panel showing Spanish, French, German or Italian — and, with ellipsis, ends in "…" so a cut label reads as cut. A source longer than out counts as cut. When not even the ellipsis fits, out is empty.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
srcinNUL-terminated UTF-8 source (nullptr yields "").
fontinFont role the text will be drawn in.
maxWinWidth to fit, in pixels (<= 0 yields "").
outoutDestination buffer, always NUL-terminated.
capinSize of out in bytes, NUL included.
ellipsisinEnd a cut text in "…" (default) or cut it bare.
weightinFace the text will be drawn in, measured in it.

formatTotpCodeGrouped() #

size_t kleidos::ui::formatTotpCodeGrouped(uint32_t code, uint8_t digits, bool valid, char * out, size_t cap)

Format a TOTP code as the space-grouped mono string.

Pure and native-testable: 6-digit codes group as "NNN NNN", 8-digit as "NNNN NNNN" (any other digit count clamps to 6), zero-padded. When valid is false a dash placeholder of the same shape is written ("--- ---" / "---- ----") so an untrusted clock can never leak a code.

Parameters
NameDirectionMeaning
codeinCode value.
digitsin6 or 8.
validinFalse writes the placeholder instead of the code.
outoutDestination buffer.
capinCapacity of out in bytes (needs >= 10).
Returns
Characters written (excluding the NUL); 0 when cap is too small.
Warning
SECURITY: callers must securely zeroize out after use.

formatTotpSeconds() #

void kleidos::ui::formatTotpSeconds(uint8_t remaining, char * out, std::size_t cap)

The one spelling of a TOTP countdown's seconds, on every surface: the number, a space and the SI "s" ("24 s"), and a leading "! " for the last kTotpUrgentSeconds ("! 3 s"), so the urgency reads by shape as well as by color. A bare "!3s" read as "13s".

Parameters
NameDirectionMeaning
remaininginSeconds left in the current window.
outoutDestination; always NUL-terminated when cap > 0.
capinSize of out in bytes (8 holds every value).

glassHeaderGauge() #

HeaderGaugeWatch & kleidos::ui::glassHeaderGauge()

The record of the gauge on the glass: the one every header draw writes and the main loop's watch reads. UI task only.

Returns
The record.

glyphHint() #

KeyHint kleidos::ui::glyphHint(IconId glyph, const char * verb, bool primary = false)
constexpr

A hint for one glyph key and its verb.

Parameters
NameDirectionMeaning
glyphinThe key cap.
verbinWhat the key does.
primaryinWhether it is the screen's main action.
Returns
The hint.

glyphPairHint() #

KeyHint kleidos::ui::glyphPairHint(IconId first, IconId second, const char * verb)
constexpr

A hint for a pair of glyph keys (the arrows) and their verb.

Parameters
NameDirectionMeaning
firstinThe first key cap.
secondinThe second key cap.
verbinWhat the keys do.
Returns
The hint.

headerBackRects() #

BackChipRects kleidos::ui::headerBackRects(const LayoutContext & layout, const HeaderProps & props)

Geometry of the header back chip — the one definition the draw and the hit test share.

Parameters
NameDirectionMeaning
layoutinResponsive context.
propsinThe props the header is drawn with.
Returns
The chip and its hit box; both empty unless HeaderProps::showBack.

headerGaugeRect() #

Rect kleidos::ui::headerGaugeRect(const HeaderGaugeSlot & slot)

The footprint of the battery gauge a header drew in slot: its body and its terminal.

A header drawn on the glass records the slot (ui/components/header_gauge_watch.h); the gauge's width is fixed whatever it shows, so a moved battery changes these pixels and no others.

Parameters
NameDirectionMeaning
slotinWhere the gauge was drawn.
Returns
The rectangle a repaint of the gauge alone covers.

headerHeight() [1/3] #

int16_t kleidos::ui::headerHeight(const LayoutContext & layout, bool subtitle)

Compute the header bar height for a layout (title-only vs title+subtitle).

Exposed so screens can reserve the matching content offset (the component does not mutate the context's insets). Derived from the resolved heading / small font heights plus vertical padding. On a board that draws its own touch controls (DeviceProfile::drawsTouchControls: the Core2 v1.3, the CoreS3 SE) every bar is at least the tap-target floor, with or without a back chip, so the header is one height on every screen.

Parameters
NameDirectionMeaning
layoutinResponsive context.
subtitleinWhether a subtitle line is present.
Returns
Header bar height in pixels.

headerHeight() [2/3] #

int16_t kleidos::ui::headerHeight(const LayoutContext & layout, bool subtitle, bool showBack)

Header bar height from the two props that size it, for a caller that lays out before it has the title (or whose title varies).

Parameters
NameDirectionMeaning
layoutinResponsive context.
subtitleinWhether a subtitle line is present.
showBackinWhether the back chip is drawn (HeaderProps::showBack).
Returns
Header bar height in pixels.

headerHeight() [3/3] #

int16_t kleidos::ui::headerHeight(const LayoutContext & layout, const HeaderProps & props)

Header bar height for props: headerHeight(const LayoutContext&, bool) raised to the tap-target floor when HeaderProps::showBack is set (and always on the Core2 v1.3 and the CoreS3 SE).

Parameters
NameDirectionMeaning
layoutinResponsive context.
propsinThe props the header will be drawn with.
Returns
Header bar height in pixels.

headerMarkEdge() #

int16_t kleidos::ui::headerMarkEdge(const LayoutContext & layout)

Edge of the square the header's brand mark fills.

The single-line bar (headerHeight(const LayoutContext&, bool)) over its bottom rule (1 px on color, 2 px of ink on e-paper) less the mark's clearance above and below (headerMarkInset), never smaller than the title and never larger than 31 px, the largest mark raster. An even edge drops to the odd one below, so the pixel-fit mark (kleidosMarkPixels) centers its ring, eye and stem on a pixel: 21 px on the Sticks, 19 px on the M5Cardputer ADV, 27 px on the LILYGO T-Deck, 21 px on the CoreInk and 31 px on the Core2 v1.3 and the CoreS3 SE. The mark centers on the title line, at least the inset under the bar's top edge (a title lifted by a subtitle) and at least 1 px over its bottom rule.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The mark's edge in pixels.

headerMarkInset() #

int16_t kleidos::ui::headerMarkInset(const LayoutContext & layout)

Clearance between the header's brand mark and the bar's top edge.

1 px when the single-line bar has under 24 rows over its bottom rule (the Sticks and the M5Cardputer ADV), where a 1 px ring and a 3 px eye need every row the bar has; 2 px otherwise.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The clearance in pixels.

headerStatusCy() #

int16_t kleidos::ui::headerStatusCy(const LayoutContext & layout, const HeaderProps & props)

Center line of the header's title row and status cluster for props, where the bar draws its battery gauge.

A screen that drops the bar but keeps the battery (the keyboard boards' lock screen) centers its gauge here, so the gauge stands where every other screen's bar draws it and does not move when the screen changes.

Parameters
NameDirectionMeaning
layoutinResponsive context.
propsinThe props the bar would be drawn with.
Returns
The row's center Y in pixels.

headerStatusIconSize() #

int16_t kleidos::ui::headerStatusIconSize(const LayoutContext & layout)

Side of the square slot each status token is drawn in, the battery gauge's included.

The slot is the drawn SMALL role height, so the gauge's fill spans a fixed number of pixel columns on each board (batteryGaugeSteps).

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The slot side in pixels.

ipv4AdvanceOrCommit() #

bool kleidos::ui::ipv4AdvanceOrCommit(Ipv4FieldModel & m)
constexpr

Advance to the next octet, or signal commit when past the last one.

If the active octet is before the fourth, moves to the next octet and returns false (keep editing). If the active octet is already the last, returns true — the caller formats and persists the address — and leaves active on the last octet so a re-entry resumes there.

Parameters
NameDirectionMeaning
min, outThe model; its active advances when not yet at the end.
Return values
ValueMeaning
trueThe user advanced past the last octet: commit the value.
falseStill editing: active now points at the next octet.

ipv4Decrement() #

void kleidos::ui::ipv4Decrement(Ipv4FieldModel & m)
constexpr

Decrement the active octet by one, wrapping 0 → 255.

Parameters
NameDirectionMeaning
min, outThe model; its active octet is nudged. An out-of-range active is ignored.

ipv4FromText() #

bool kleidos::ui::ipv4FromText(const char * text, Ipv4FieldModel & m)
constexpr

Prefill the model's octets from a literal dotted-quad string.

Strict parse mirroring kleidos::platform::net::isLiteralIpv4: exactly four decimal octets 0–255 separated by single dots, digits and dots only. On success the octets are stored and active resets to the first octet; on rejection the model is left untouched.

Parameters
NameDirectionMeaning
textinNUL-terminated candidate string (nullptr is rejected).
min, outModel receiving the parsed octets.
Return values
ValueMeaning
truetext parsed as a literal IPv4; model updated.
falseNot a plain dotted quad; model unchanged.

ipv4Increment() #

void kleidos::ui::ipv4Increment(Ipv4FieldModel & m)
constexpr

Increment the active octet by one, wrapping 255 → 0.

Parameters
NameDirectionMeaning
min, outThe model; its active octet is nudged. An out-of-range active is ignored.

ipv4ToText() #

bool kleidos::ui::ipv4ToText(const Ipv4FieldModel & m, char * out, size_t cap)
constexpr

Format the model as an unpadded dotted quad ("10.0.0.1").

The output always satisfies the strict literal-IPv4 validator (octets are full-range bytes by construction). Nothing is written when cap cannot hold the longest form (kIpv4TextCap).

Parameters
NameDirectionMeaning
minModel to format.
outoutDestination buffer, NUL-terminated on success.
capinCapacity of out in bytes.
Return values
ValueMeaning
trueFormatted; out holds the dotted quad.
falseout is null or cap is too small; nothing written.

keepHeaderGaugeLive() #

bool kleidos::ui::keepHeaderGaugeLive(Canvas & canvas, HeaderGaugeWatch & watch, const HeaderGaugeShown & live, uint32_t screen, const GaugeOverlays & overlays)

Keep the gauge on the glass live on a tick at rest.

Asks watch what the gauge needs (HeaderGaugeWatch::atRest) and, when it moved and no overlay covers it, repaints it alone in place in a frame of its own (repaintHeaderGauge) and notes what it now shows. The same on every panel: a backlit one blits the gauge's footprint, an e-paper one writes it to its frame buffer and refreshes the band it changed. A gauge under a covering overlay, and any gauge while the frame is being composed in tones (the e-paper gray pass repaints the whole screen, its header drawn live), stays owed for a later tick. No screen is asked for anything.

Parameters
NameDirectionMeaning
canvasin, outThe glass.
watchin, outThe record of the gauge on it (glassHeaderGauge).
liveinWhat the gauge would draw now.
screeninThe glass's screen count now (display::screenClears).
overlaysinThe overlays on the glass.
Returns
true when the gauge was repainted.

keyButtonRowRect() #

Rect kleidos::ui::keyButtonRowRect(const LayoutContext & layout)

The row just above the shelf where a keyboard board with a pointer draws its buttons that are also keys, inside the side margins and at least a hit target tall.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The row.

keyHintShelfRect() #

Rect kleidos::ui::keyHintShelfRect(const LayoutContext & layout)

The shelf's band: a strip along the bottom of the screen, one small line tall plus its padding.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The band.

keyholeBox() #

Rect kleidos::ui::keyholeBox(const KleidosMarkGeo & geo, int16_t deciDeg)
constexpr

The screen box that holds every pixel of the color keyhole at deciDeg.

The eye's box and the four corners of the stem (kleidosMarkBodyShape), each grown by the half pixel of the coverage ramp, rounded out to whole pixels and widened by kKeyholeFeatherPx.

Parameters
NameDirectionMeaning
geoinThe mark.
deciDeginKeyhole angle, tenths of a degree.
Returns
The box.

keyholeRepaintBox() #

Rect kleidos::ui::keyholeRepaintBox(const KleidosMarkGeo & geo, int16_t fromDeciDeg, int16_t toDeciDeg)
constexpr

The box one keyhole frame repaints: the keyhole before and after.

Parameters
NameDirectionMeaning
geoinThe mark.
fromDeciDeginThe angle on the glass.
toDeciDeginThe angle the frame paints.
Returns
The union of both keyhole boxes.

kleidosMarkBodyBox() #

Rect kleidos::ui::kleidosMarkBodyBox(const KleidosMarkGeo & geo)
constexpr

The color body's box, its outline and antialiased edge included.

Parameters
NameDirectionMeaning
geoinThe mark.
Returns
The box (markBodyBounds of kleidosMarkBodyShape).

kleidosMarkBodyShape() #

MarkBodyShape kleidos::ui::kleidosMarkBodyShape(const KleidosMarkGeo & geo, int16_t deciDeg)
constexpr

The body and keyhole of a color mark, at deciDeg, in sub-pixels.

The logo's own lengths scaled by s = ringR / 42 and centered on the center of pixel (cx, cy), the ring's center: a contour of half width 14 s whose straight half length is 14 s (a 28 x 56 stadium), an outline 2.5 s wide centered on it, an eye of radius 5 s whose center is 4 s above the mark's, and a stem 3 s wide that runs 14 s from the eye's center, square at its end. The angle turns the stem clockwise on the screen about the eye's center: 0 points it straight down, 900 to 9 o'clock, a negative angle to the right.

Parameters
NameDirectionMeaning
geoinThe mark.
deciDeginKeyhole angle, tenths of a degree.
Returns
The shape (zero lengths when the ring has no radius).

kleidosMarkGeoForEdge() #

KleidosMarkGeo kleidos::ui::kleidosMarkGeoForEdge(int16_t cx, int16_t cy, int16_t edge, bool mono)
constexpr

The geometry of a still mark drawn in an edge px square.

The ring at the official stroke: mid radius round(42 e / 100) and band round(3 e / 100), at least one pixel (two on a 1-bit panel).

Parameters
NameDirectionMeaning
cxinCenter X.
cyinCenter Y.
edgeinThe square's edge (px).
monoinWhether the panel is 1-bit ink.
Returns
The geometry.

kleidosMarkParts() #

KleidosMarkParts kleidos::ui::kleidosMarkParts(int16_t ringR, bool mono)
constexpr

The whole-pixel parts of the mark whose ring has mid radius ringR.

What a 1-bit panel draws (a color panel draws the sub-pixel kleidosMarkBodyShape). Scaled from the logo grid by s = ringR / 42 and rounded to whole pixels: body 2 round(14 s) x 2 round(28 s), outline round(2.5 s), eye round(5 s), stem round(3 s) x round(14 s), pivot round(4 s) above the center. A 1-bit panel has no antialiasing to carry a thin stroke, so its outline and eye keep larger floors.

Parameters
NameDirectionMeaning
ringRinMid-band radius of the ring (px).
monoinWhether the panel is 1-bit ink.
Returns
The parts.

kleidosMarkPixels() #

KleidosMarkPixels kleidos::ui::kleidosMarkPixels(int16_t edge)

The pixel-fit parts of the Kleidos mark at edge.

Parameters
NameDirectionMeaning
edgeinThe mark's square edge in pixels (odd for a centered mark).
Returns
The parts; see KleidosMarkPixels.

layout() #

Stack kleidos::ui::notice_stack::layout(Canvas & canvas, std::span< const Part > parts, const Rect & box)

Set parts as a centered column inside box.

Tries the roles the parts ask for, then every part one role smaller (each no smaller than its minFont), and returns the first setting in which no word is wider than the box, every word of every part lands on a row, and the column is no taller than the box. When no setting does, returns the smallest one with fits false, its rows starting at the top of the box.

kleidos::hal::display::Font::MONO is a face of its own and never steps: a part asking for it is set in it at every setting.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
partsinThe blocks, top to bottom; at most kMaxBlocks are set.
boxinThe box the column is set in.
Returns
Where every row of the column lands.

listRowHeight() #

int16_t kleidos::ui::listRowHeight(const LayoutContext & layout, bool twoLine, ListRowSize size = ListRowSize::Compact)

Compute the row height for a layout (single- or two-line rows).

The Comfortable size sizes the primary line for the HEADING role and adds a larger inter-line gap, yielding a noticeably taller row than Compact; its label is still drawn at the BODY role. All terms come from the layout token scales.

On touch-primary profiles the result is floored to the ui::LayoutContext::minTapPx tap floor (5 mm at the panel's PPI), so a finger always has an accessible row to hit; button/dial/e-paper boards resolve a 0 floor and keep the density-native height.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved font heights + spacing).
twoLineinTrue to size for a primary + secondary line.
sizeinVertical density of the row.
Returns
Row height in pixels (tap-floored on touch-primary profiles).

listWindowTop() #

uint16_t kleidos::ui::listWindowTop(const LayoutContext & layout, uint16_t selected, uint16_t count, uint8_t visible, uint16_t prevTop)

First visible item of a list on this panel.

A 1-bit panel turns whole pages (each e-paper repaint is a refresh, so a list moves once per page, not once per row); other panels scroll a row at a time.

Parameters
NameDirectionMeaning
layoutinResponsive context.
selectedinSelected item index.
countinTotal number of items.
visibleinRows the window shows.
prevTopinThe window's first item before this move.
Returns
pagedWindowTop on a monochrome panel, scrollWindowTop elsewhere.

liveBatteryLevel() #

BatteryLevel kleidos::ui::liveBatteryLevel(PowerManager & power)

The battery level every header shows, read from the board now.

Reads power once and moves the one BatteryGauge of the firmware with it, at the step count the board's header gauge can show (the fill columns of a gauge in the header's status slot, ui::headerStatusIconSize). The gauge lives in RAM, so its first reading after a boot (every wake from the production sleep is one) sets the level directly. The sample holds only good readings (a read the chip refused keeps the last); before the first one the battery is unknown and the level has no steps (BatteryLevel::known): the gauge draws its outline with a "?" inside. Called on the UI task only.

Parameters
NameDirectionMeaning
powerin, outBoard power manager (battery reading).
Returns
The level to draw.

liveHeaderStatus() #

HeaderStatus kleidos::ui::liveHeaderStatus(PowerManager & power)

The header status cluster as the board stands now.

Parameters
NameDirectionMeaning
powerin, outBoard power manager (battery level and charge state).
Returns
The battery level the gauge shows (liveBatteryLevel), charging, and whether a host is connected.

logoSub() #

int32_t kleidos::ui::logoSub(int32_t halfUnits, int32_t ringR)
constexpr

A length of the logo grid on the screen, in 1/kMarkSubPx px.

Scaled by s = ringR / 42, the ring's own mid radius, so the body keeps the logo's proportions to the ring that is drawn.

Parameters
NameDirectionMeaning
halfUnitsinThe length in half logo units (2.5 units is 5).
ringRinMid-band radius of the ring (px).
Returns
The length in sub-pixels, rounded half up.

markFillColor() #

uint16_t kleidos::ui::markFillColor(MarkTone tone)
constexpr

The body fill of a tone on a color panel.

Parameters
NameDirectionMeaning
toneinThe tone.
Returns
RGB565 color.

markLineColor() #

uint16_t kleidos::ui::markLineColor(MarkTone tone)
constexpr

The ring, outline and keyhole color of a tone on a color panel.

Parameters
NameDirectionMeaning
toneinThe tone.
Returns
RGB565 color.

measure() #

int16_t kleidos::ui::text_wrap::measure(Canvas & canvas, const char * text, hal::display::Font font, Weight weight)

Advance width of text in font, in the face weight draws.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
textinNUL-terminated string.
fontinFont role the text is drawn in.
weightinFace the text is drawn in.
Returns
Pixel width (advance, not bounding box).

minReadableQrBandPx() #

int16_t kleidos::ui::minReadableQrBandPx(std::size_t payloadLen, int16_t quietZone = kQrQuietZone)

Smallest band side that renders payloadLen readably.

The side at which the sparsest symbol the payload can take (the weakest error-correction level, which needs the fewest modules) still gets kQrMinModulePx whole pixels per module. A band below this cannot hold a readable symbol at any level, so it is the figure a page quotes when it asks its chrome for room.

Parameters
NameDirectionMeaning
payloadLeninPayload length in bytes.
quietZoneinLight margin in modules (kQrQuietZone).
Return values
ValueMeaning
>0The band side in pixels.
0The payload does not fit the encoder's version cap at any level.

moduleCountFor() #

int kleidos::ui::qr::moduleCountFor(std::size_t dataLen, QrEcc ecc)

Side length in modules of the symbol dataLen bytes encode to.

17 + 4 * chooseVersion(dataLen, ecc) — the figure a layout needs to size a symbol before encoding it, so a card can be laid out on the grid the encoder will actually produce instead of a guessed version.

Parameters
NameDirectionMeaning
dataLeninPayload length in bytes.
eccinError-correction level.
Return values
ValueMeaning
21..kMaxModulesThe symbol's module count.
0The payload does not fit within kMaxVersion.

overlayCoversGauge() #

bool kleidos::ui::overlayCoversGauge(const Rect & gauge, const GaugeOverlays & overlays)
constexpr

Whether an overlay covers the gauge drawn in gauge.

A gauge painted under an overlay would cut it, so the watch waits for it to clear; one painted beside it (a toast at the bottom of the glass) cuts nothing and is painted at once.

Parameters
NameDirectionMeaning
gaugeinThe gauge's footprint (ui::headerGaugeRect).
overlaysinThe overlays on the glass.
Returns
true while one covers the gauge.

pagedWindowTop() #

uint16_t kleidos::ui::pagedWindowTop(uint16_t selected, uint16_t count, uint8_t visible, uint16_t prevTop)

First visible item of a list that turns whole pages.

Moving past the last visible row starts the next page at the selection; moving above the first ends the previous page at it; a selection inside the window keeps it. A wrap from the last item to the first lands on the first page, and from the first to the last on the last page. A list that fits never moves.

Parameters
NameDirectionMeaning
selectedinSelected item index.
countinTotal number of items.
visibleinRows the window shows.
prevTopinThe window's first item before this move.
Returns
The new first visible item.

peekRowHeight() #

int16_t kleidos::ui::peekRowHeight(const LayoutContext & layout, const Rect & content, bool twoLine, ListRowSize size, int16_t scrollTop, int16_t count)

Height of the trailing "peek" sliver drawn under the last full row.

The single gate shared by drawMenuList (which draws the sliver) and the touch hit-tests (which size their tap band with it), so every row the list draws is tappable and the two predicates can never drift. Returns 0 when no peek row is drawn: mono/e-paper panels, a window that already reaches the list end, or a leftover band too short to seat a compact single line (body font + xs spacing). Mid-scroll animation frames suppress the peek inside drawMenuList itself (the slide draws its own trailing row), independent of this gate.

Parameters
NameDirectionMeaning
layoutinResponsive context (carries the device profile).
contentinContent rectangle the list fills.
twoLineinTrue if rows are two-line.
sizeinVertical density of the rows.
scrollTopinFirst visible item index.
countinTotal number of items.
Returns
Sliver height in pixels, or 0 when no peek row is drawn.

planIdentityRows() #

IdentityRowPlan kleidos::ui::planIdentityRows(const std::array< int16_t, kIdentityRowMax > & heights, uint8_t count, int16_t room, int16_t minGap, int16_t maxGap)

Decide how many rows fit room and how far apart they sit. Pure.

Rows are kept from the first while each one, plus the gap before it, still fits. The kept rows then share the height left over, so the block fills its column; the gap never leaves minGap .. maxGap.

Parameters
NameDirectionMeaning
heightsinHeight of each row, in order.
countinRows offered (clamped to kIdentityRowMax).
roominPixels the column has.
minGapinSmallest gap between two rows.
maxGapinLargest gap between two rows.
Returns
The rows kept and the gap to draw them with.

planQrCard() #

QrCardPlan kleidos::ui::planQrCard(const QrBand & band, const QrCaptionBox & caption, std::size_t payloadLen, int16_t quietZone = kQrQuietZone)

Solve the largest crisp scan card a band holds for a payload.

Tries the caption below and beside the symbol; for each, tries every error-correction level the payload fits in; and keeps the candidate with the largest module size, breaking ties toward the highest error-correction level and then toward QrCaptionSide::Below (the familiar stacked layout). A candidate whose symbol would overflow its box is rejected, so a valid plan never draws outside the band.

Parameters
NameDirectionMeaning
bandinUsable band (content box) and the caption gap.
captioninWhat the caption needs (see QrCaptionBox).
payloadLeninPayload length in bytes.
quietZoneinLight margin in modules (kQrQuietZone).
Returns
The solved plan; valid == false when no symbol fits the band at all (the caller then draws its "cannot show" state rather than a symbol spilling over its neighbors).

popupCardAccent() #

uint16_t kleidos::ui::popupCardAccent(const LayoutContext & layout, DialogSeverity tone)

The tone's accent: the border, and the ink of anything the content marks in the tone (the safety line of a hold).

Parameters
NameDirectionMeaning
layoutinResponsive context.
toneinThe card's tone.
Returns
RGB565 color.

popupCardBackRects() #

BackChipRects kleidos::ui::popupCardBackRects(Canvas & canvas, const LayoutContext & layout, const Rect & card, const PopupCardProps & props)

The back chip of a card drawn with PopupCardProps::showBack, and the box a tap on it answers in (the bar's height, from the card edge to one small gap past the chip).

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (measures the title).
layoutinResponsive context.
cardinThe card's rect.
propsinThe card's props.
Returns
Empty rects when the card shows no back chip.

popupCardFill() #

uint16_t kleidos::ui::popupCardFill(const LayoutContext & layout, DialogSeverity tone)

The fill the card's content sits on for tone (the tone's container where it has one, else the surface); paper on a 1-bit panel.

Parameters
NameDirectionMeaning
layoutinResponsive context.
toneinThe card's tone.
Returns
RGB565 color.

popupCardWidthFor() #

int16_t kleidos::ui::popupCardWidthFor(Canvas & canvas, const LayoutContext & layout, int16_t cardW, const PopupCardProps & props)

The width a card should take for its title: cardW, or the whole width of the glass where a word of the title does not fit a line of the card at cardW (popupTitleWordsFit).

The title then steps down a rung in the wider card only where it still has to (popupTitleBarHeight), so a word is never split.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (measures the title).
layoutinResponsive context (the glass's width).
cardWinThe width the card would take.
propsinThe card's title, font and mark.
Returns
Card width in pixels.

popupTitleBarHeight() #

int16_t kleidos::ui::popupTitleBarHeight(Canvas & canvas, const LayoutContext & layout, int16_t cardW, const PopupCardProps & props)

Height of the title bar for props at card width cardW.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (measures the wrapped title).
layoutinResponsive context.
cardWinThe card's width.
propsinThe card's title, font and wrap budget.
Returns
Bar height in pixels.

popupTitleReadsWhole() #

bool kleidos::ui::popupTitleReadsWhole(Canvas & canvas, const LayoutContext & layout, int16_t cardW, const PopupCardProps & props)

Whether the title reads whole in the bar at card width cardW: in the card's rung or one the bar steps down to, every word on a line, within the lines the title may take.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (measures the title).
layoutinResponsive context.
cardWinWidth of the card.
propsinThe card's title, font, mark and line budget.
Return values
ValueMeaning
trueThe bar sets it whole; false where it splits or cuts it.

popupTitleWordsFit() #

bool kleidos::ui::popupTitleWordsFit(Canvas & canvas, const LayoutContext & layout, int16_t cardW, const PopupCardProps & props)

Whether every word of the title fits a line of the title bar at card width cardW, in the card's own rung (PopupCardProps::titleFont).

A popup never splits a word of its title: where one is wider than the card's line, the narrow card stands from edge to edge of the glass first, and only then does the title take a smaller rung.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface (measures the title).
layoutinResponsive context.
cardWinWidth of the card.
propsinThe card's title, font and mark.
Return values
ValueMeaning
trueEvery word (a compound by its hyphenated parts) fits a line.

progressBarHeight() #

int16_t kleidos::ui::progressBarHeight(const LayoutContext & layout)

Compute the natural progress-bar height for a layout.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved spacing).
Returns
Bar height in pixels.

qrScanColors() #

QrColors kleidos::ui::qrScanColors(bool monochrome)

Dark-on-light module colors for the panel class monochrome names.

A scanner expects dark modules on a light quiet zone, and which theme token is physically dark depends on the panel:

  • 1-bit e-paper inverts in the Light theme it defaults to, mapping a bright color to ink and a dark one to paper, so the ink token (kText) lands as black modules and the background token (kBg) as white paper.
  • Color TFT draws what it is given, and the Kleidos palette is a dark theme, so the same pair would render light modules on a black field — an inverted symbol that not every phone camera decodes. Those panels take the pair the other way round: kBg modules on a kText quiet zone, which is also the near-white card the admin scan page draws.
Parameters
NameDirectionMeaning
monochromeinTrue for a 1-bit (e-paper) panel; false for color.
Returns
The dark / light pair that renders physically dark-on-light.

repaintActionBar() [1/2] #

void kleidos::ui::repaintActionBar(Canvas & canvas, const LayoutContext & layout, const ActionBarProps & props, DrawnActionBar & drawn)

Repaint the hint bar for props, touching only what changed since drawn.

A hold gauge moves ~20 times across one 800 ms hold. Repainting the whole bar for each step clears its band and redraws every cell for a 2 px rule; drawn straight to the panel (no shadow framebuffer) that is a visible flicker. With the cells where drawn recorded them: a cell whose verb or mark changed is cleared to the shelf color and redrawn alone; a cell whose hold fill alone moved gets its rule as two fills that do not overlap (the filled part and the rest), with no clear; an unchanged cell is left alone. Anything else — no recorded draw, other cells or places, a 1-bit panel, a verb that runs past its cell — draws the whole bar. Either way the pixels equal a full draw of props, and drawn records them.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context.
propsinSemantic action slots to present, gauges included.
drawnin, outWhat the bar shows; updated to props.

repaintActionBar() [2/2] #

void kleidos::ui::repaintActionBar(const ActionBarProps & props, DrawnActionBar & drawn)

Repaint the hint bar on the display, in a frame of its own.

Device-only: it owns the raster surface and the active display's layout, so callers never open a frame for a footer-sized update. See the overload that takes a canvas for what it repaints.

Parameters
NameDirectionMeaning
propsinSemantic action slots to present, gauges included.
drawnin, outWhat the bar shows; updated to props.

repaintHeaderGauge() #

void kleidos::ui::repaintHeaderGauge(Canvas & canvas, const HeaderGaugeSlot & slot, const HeaderGaugeShown & live)

Repaint a header's battery gauge alone, in place, showing live.

Fills the gauge's footprint (headerGaugeRect) with what lies under it (the bar's surface, or the background for a gauge drawn with no bar) and draws the gauge over it, the very pixels a repaint of the whole header would change for a moved battery. The caller brackets it in a frame.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
slotinWhere the header drew the gauge.
liveinWhat the gauge shows now.

resolveDropdownTouch() #

DropdownTouch kleidos::ui::resolveDropdownTouch(const TouchGestureEvent & ev, const LayoutContext & layout, const Rect & box, const DropdownProps & props, uint8_t & focus, uint8_t & scrollTop)

Resolve a gesture against a dropdown drawn in box with props — the one touch grammar every picker shares.

The back chip cancels; the option rows take the list grammar of ui::resolveTouchList (a tap selects, a tap on the selection commits, a swipe pages). Reads the same geometry drawDropdown lays out, so a tap lands on the option drawn under it.

Parameters
NameDirectionMeaning
evinThe resolved gesture.
layoutinResponsive context.
boxinThe popover rect the dropdown is drawn in.
propsinIts props (title, count and back chip are read).
focusin, outThe focused option; moved on a select or a page.
scrollTopin, outThe window top; kept following focus.
Returns
What the gesture did.

rowBandTop() #

int16_t kleidos::ui::rowBandTop(int16_t contentY, float localRowFrac, int16_t rowHeight, int16_t scrollOffsetPx)

Y of a (possibly fractional) local row within a scrolled content rect.

The row-placement math shared by the static and animated list paths: the top Y of local row localRowFrac is content.y + localRowFrac * rowHeight + scrollOffsetPx. Exposed (pure) so the sliding-highlight geometry is host-testable without a canvas.

Parameters
NameDirectionMeaning
contentYinTop of the content rect (px).
localRowFracinFractional local row index (0 = first visible row).
rowHeightinRow height (px).
scrollOffsetPxinSub-row vertical shift applied to all rows (px).
Returns
Top Y of the row band (px).

scrollWindowTop() #

uint16_t kleidos::ui::scrollWindowTop(uint16_t selected, uint16_t count, uint8_t visible, uint16_t prevTop)

Sticky scroll-window top that keeps the selection on screen.

Pure list-scroll math shared by the catalog: given the previous window top, the selected index, the item count, and how many rows are visible, it returns the new top. The window does not re-center on the selection — it only moves the minimum needed so the selected row stays inside [top, top + visible): scroll up when the selection went above the window, scroll down when it went below, otherwise leave the window put. The result is clamped to [0, count - visible]. This is what makes the highlight track the selection within the window instead of pinning it to a fixed row.

Parameters
NameDirectionMeaning
selectedinCurrently selected item index.
countinTotal number of items.
visibleinNumber of fully-visible rows in the window.
prevTopinThe window top from the previous frame.
Returns
The new window top (first visible item index).

setTouchKeyboardLettersPreference() #

void kleidos::ui::setTouchKeyboardLettersPreference(TouchKeyboardLetters letters)

Set the letter rows the device's keyboards show (the BLE layout setting).

The one device-wide input preference, like the UI language: set at boot and whenever the layout setting changes; hosts read it when they open a keyboard.

Parameters
NameDirectionMeaning
lettersinThe rows to show.

stemSegment() #

StemSegment kleidos::ui::stemSegment(const KleidosMarkGeo & geo, const KleidosMarkParts & parts, int16_t deciDeg)
constexpr

The 1-bit stem at deciDeg: from the pivot to its round-capped tip.

The angle turns clockwise on the screen: 0 points the stem straight down, 900 to 9 o'clock, a negative angle to the right of the pivot. The round cap ends where the logo's square-ended stem does, so the segment is the stem's length less half its width.

Parameters
NameDirectionMeaning
geoinThe mark.
partsinIts parts.
deciDeginKeyhole angle, tenths of a degree.
Returns
The segment.

stepperChipRects() #

StepperChips kleidos::ui::stepperChipRects(const LayoutContext & layout, const Rect & box)

The − and + chip rects for a stepper drawn in box.

The one definition of where the chips are, read by drawStepper and by anything that hit-tests them, so a finger on a drawn chip is a finger on that chip. Both rects are empty when the box is too small to draw them.

Parameters
NameDirectionMeaning
layoutinResponsive context.
boxinStepper rectangle, the same one passed to drawStepper.
Returns
The two chip rects.

stepperClamp() #

int32_t kleidos::ui::stepperClamp(int32_t value, int32_t min, int32_t max)
constexpr

Clamp value to the inclusive [min, max] range.

A defensive helper so a screen that loads a persisted value out of range (e.g. after a range change between firmware revisions) lands back in bounds. If min > max the value is returned unchanged.

Parameters
NameDirectionMeaning
valueinCandidate value.
mininInclusive lower bound.
maxinInclusive upper bound.
Returns
The clamped value.

stepperHeight() #

int16_t kleidos::ui::stepperHeight(const LayoutContext & layout)

Compute the natural (preferred) stepper height for a layout.

height = bodyFontHeight + 2 * verticalPadding — same as a button row so a stepper drops into a list / edit overlay at a consistent height. A caller may use a taller rect; the component centers its content either way.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved body-font height + spacing).
Returns
Preferred stepper height in pixels.

stepperNext() #

int32_t kleidos::ui::stepperNext(int32_t value, int32_t step, int32_t min, int32_t max)
constexpr

Next value after an increment by step, clamped at max.

Saturating: never wraps. step is treated as a magnitude (its sign is ignored). Returns max when already at or above the ceiling.

Parameters
NameDirectionMeaning
valueinCurrent value.
stepinIncrement magnitude (>= 1 advised).
mininInclusive lower bound (for the initial clamp).
maxinInclusive upper bound.
Returns
The incremented, clamped value.

stepperPrev() #

int32_t kleidos::ui::stepperPrev(int32_t value, int32_t step, int32_t min, int32_t max)
constexpr

Next value after a decrement by step, clamped at min.

Saturating: never wraps. step is treated as a magnitude (its sign is ignored). Returns min when already at or below the floor.

Parameters
NameDirectionMeaning
valueinCurrent value.
stepinDecrement magnitude (>= 1 advised).
mininInclusive lower bound.
maxinInclusive upper bound (for the initial clamp).
Returns
The decremented, clamped value.

tabBarHeight() #

int16_t kleidos::ui::tabBarHeight(const LayoutContext & layout)

Compute the natural tab-strip height for a layout.

height = bodyFontHeight + 2 * verticalPadding + underline, floored to the ui::LayoutContext::minTapPx tap floor (5 mm at the panel's PPI) on touch-primary profiles — labels stay centered in the taller band. Exposed so a screen can reserve the band and offset its content below it.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved body-font height + spacing).
Returns
Tab-strip height in pixels (tap-floored on touch-primary profiles).

tailThatFits() #

std::size_t kleidos::ui::text_wrap::tailThatFits(Canvas & canvas, const char * text, std::size_t len, hal::display::Font font, int16_t maxW)

Offset of the longest tail of text that fits maxW pixels at font.

The head-dropping twin of fitText. An entry row (a text field, a passphrase being dialed, the touch keyboard's revealed row) keeps the end the user just typed in view and drops whole code points from the front until the rest fits. It works in place — the caller draws text + offset — so a secret is never copied, and the offset always lands on the lead byte of a code point, so a multi-byte glyph (an accented letter, the U+2022 mask bullet) is never cut in half.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
textinUTF-8 text, NUL-terminated at text[len] (nullptr yields 0).
leninLength of text in bytes.
fontinFont role the text will be drawn in.
maxWinWidth to fit, in pixels.
Returns
Byte offset of the first code point of the tail that fits: 0 when the whole text fits, len when not even the last code point does.

textFieldHeight() #

int16_t kleidos::ui::textFieldHeight(const LayoutContext & layout)

Compute the natural text-field height for a layout.

height = bodyFontHeight + 2 * verticalPadding. Exposed so a screen can lay out a stack of fields. The caller may pass a taller rect.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved body-font height + spacing).
Returns
Text-field height in pixels.

totpCompactCardHeight() #

int16_t kleidos::ui::totpCompactCardHeight(const LayoutContext & layout, bool large = false)

Natural Compact-style card height for a layout.

The code line plus the bar-and-seconds line under it: the one-block form a surface uses when the 2FA code shares the screen with other fields, where the hero ring and code would crowd them.

Parameters
NameDirectionMeaning
layoutinResponsive context.
largeinThe code at the hero size (see TotpCodeCardProps::large).
Returns
Card height in pixels.

totpCountdownColor() #

uint16_t kleidos::ui::totpCountdownColor(uint8_t remaining)
constexpr

The one color rule for every TOTP countdown (list rings, the hero ring, the code screen's bar): brand cyan, warning red for the last kTotpUrgentSeconds.

Parameters
NameDirectionMeaning
remaininginSeconds left in the current window.
Returns
RGB565 color of the countdown on a color panel.

totpHeroCardHeight() #

int16_t kleidos::ui::totpHeroCardHeight(const LayoutContext & layout, bool withRing, bool withExpiry)

Natural Hero-style stack height for a layout.

Shared with callers that center the stack plus their own field label, so the label + card group centers as one block.

Parameters
NameDirectionMeaning
layoutinResponsive context.
withRinginInclude the countdown-ring band.
withExpiryinInclude the expiry-caption line.
Returns
Stack height in pixels.

totpRowCardHeight() #

int16_t kleidos::ui::totpRowCardHeight(const LayoutContext & layout)

Natural Row-style card height for a layout.

Issuer line (SMALL) over the row-scale mono code line plus the vertical rhythm padding — all terms from the layout token scales (a 44 px row on the Sticks).

This is what the row WANTS, with no reference to the band it has to tile. A list draws its rows at totpRowCardHeightIn instead; this entry point is for the code that has no band to fit (a cache sizing a scratch, a tick region measured against the row it was given).

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved font heights + spacing).
Returns
Row card height in pixels.
See also
totpRowCardHeightIn

totpRowCardHeightIn() #

int16_t kleidos::ui::totpRowCardHeightIn(const LayoutContext & layout, int16_t bandH)

Row-style card height for a list band of bandH pixels.

A row of fixed height tiling a fixed band always floors, and the remainder is lost. That is harmless while the remainder is a sliver and a bug when it is most of a row: on the M5Cardputer ADV's 87 px 2FA band the natural 46 px row tiles ONCE and leaves 41 blank pixels, so a vault with two 2FA entries reports two and draws one.

The code line is therefore a two-rung ladder, and the band picks the rung: the list code (the MONO role magnified, which every board draws), and one rung down, the compact code of the Sticks' row. The smaller row is taken ONLY when it lets the band hold one more row than the natural one does — so a band that already tiles well keeps the larger code, and the only boards that change are the ones whose band was a rung short.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved font heights + spacing).
bandHinHeight of the list band in pixels; 0 or less reads as "no band", giving totpRowCardHeight.
Returns
Row card height in pixels, never above totpRowCardHeight.
See also
totpRowCardHeight

totpRowRingBounds() #

Rect kleidos::ui::totpRowRingBounds(const LayoutContext & layout, const Rect & area)

The square a Row-style card's countdown ring occupies inside area.

The part of a list row that changes every second (the code changes once a window): a 1 Hz refresh repaints the row clipped to this square. It holds the ring with its anti-aliased edge and a pixel of margin.

Parameters
NameDirectionMeaning
layoutinResponsive context (spacing tokens).
areainThe row the card is drawn in.
Returns
The ring's bounding square.

touchKeyboardCancelRect() #

Rect kleidos::ui::touchKeyboardCancelRect(const LayoutContext & layout, const Rect & area)

The back control's rectangle at the left end of the value row.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills.
Returns
The control rect; empty when area is empty or too narrow.

touchKeyboardCodepointAt() #

char16_t kleidos::ui::touchKeyboardCodepointAt(const TouchKeyboardSheet & sheet, uint8_t index)

The character a TouchKeyboardKeyKind::Char cell appends.

Parameters
NameDirectionMeaning
sheetinThe keyboard as drawn.
indexinRow-major key index [0, touchKeyboardKeyCount(sheet)).
Returns
The character's Unicode code point (Latin-1), or 0 for a non-character cell.

touchKeyboardEncodeUtf8() #

uint8_t kleidos::ui::touchKeyboardEncodeUtf8(char16_t codepoint, char * out)

Encode one code point as UTF-8.

Parameters
NameDirectionMeaning
codepointinThe character (U+0001..U+FFFF).
outoutAt least 4 bytes; receives the bytes and a NUL.
Returns
The byte count (1..3), or 0 for code point 0.

touchKeyboardFieldRect() #

Rect kleidos::ui::touchKeyboardFieldRect(const LayoutContext & layout, const Rect & area)

The value-row rectangle at the top of area.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills.
Returns
The value-row rect; empty when area is empty.

touchKeyboardFocusCount() #

uint8_t kleidos::ui::touchKeyboardFocusCount(const TouchKeyboardSheet & sheet, bool showReveal, bool showCancel = false, bool showSwitch = false)

Number of focus stops: every key, then the reveal, back and switch controls when shown.

Parameters
NameDirectionMeaning
sheetinThe keyboard as drawn.
showRevealinWhether the reveal control participates.
showCancelinWhether the back control participates.
showSwitchinWhether the PIN / passphrase switch participates.
Returns
The focus-ring size.

touchKeyboardFocusTarget() #

int8_t kleidos::ui::touchKeyboardFocusTarget(const TouchKeyboardSheet & sheet, bool showReveal, bool showCancel, uint8_t stop, bool showSwitch = false)

What a focus stop activates.

Stops [0, keys) are the keys; the stops after them are the reveal control (when shown), the back control (when shown) and the PIN / passphrase switch (when shown).

Parameters
NameDirectionMeaning
sheetinThe keyboard as drawn.
showRevealinWhether the reveal control participates.
showCancelinWhether the back control participates.
stopinFocus stop index.
showSwitchinWhether the PIN / passphrase switch participates.
Returns
The key index, kTouchKeyboardRevealKey, kTouchKeyboardCancelKey, kTouchKeyboardSwitchKey, or kTouchKeyboardNoKey for a stop past the ring.

touchKeyboardHitTest() #

int8_t kleidos::ui::touchKeyboardHitTest(const LayoutContext & layout, const Rect & area, const TouchKeyboardSheet & sheet, bool showReveal, int16_t x, int16_t y, bool showCancel = false, bool showSwitch = false)

Resolve a touch point to the key (or value-row control) under it.

Rows are resolved by pitch and then the key within the row by pitch, so a contact in a gutter still activates the cell it belongs to (full-pitch effective targets). The value-row controls are tested first, so a contact on one can never fall through to a key.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills (same value passed to draw).
sheetinThe keyboard as drawn.
showRevealinWhether the reveal control is present.
xinTouch point X in screen space.
yinTouch point Y in screen space.
showCancelinWhether the back control is present.
showSwitchinWhether the PIN / passphrase switch is present.
Returns
The row-major key index, kTouchKeyboardRevealKey, kTouchKeyboardCancelKey, kTouchKeyboardSwitchKey, or kTouchKeyboardNoKey.

touchKeyboardKeyCount() #

uint8_t kleidos::ui::touchKeyboardKeyCount(const TouchKeyboardSheet & sheet)

Number of keys on sheet.

Parameters
NameDirectionMeaning
sheetinThe keyboard as drawn.
Returns
12 on ui::TouchKeyboardLayer::Numeric, 31 on the symbols, and the letter rows' keys plus the six utility keys on a letter layer.

touchKeyboardKeyRect() #

Rect kleidos::ui::touchKeyboardKeyRect(const LayoutContext & layout, const Rect & area, const TouchKeyboardSheet & sheet, uint8_t index)

Screen-space rectangle of one key.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills.
sheetinThe keyboard as drawn (rows differ per layer and letters).
indexinRow-major key index [0, touchKeyboardKeyCount(sheet)).
Returns
The key rect; empty for an out-of-range index or an empty area.

touchKeyboardKindAt() #

TouchKeyboardKeyKind kleidos::ui::touchKeyboardKindAt(const TouchKeyboardSheet & sheet, uint8_t index)

Kind of the key at row-major index index in sheet.

Parameters
NameDirectionMeaning
sheetinThe keyboard as drawn.
indexinRow-major key index [0, touchKeyboardKeyCount(sheet)).
Returns
The cell's kind; TouchKeyboardKeyKind::Char for out-of-range.

touchKeyboardLettersForLayout() #

TouchKeyboardLetters kleidos::ui::touchKeyboardLettersForLayout(uint8_t layoutIndex)

The letter rows that match a BLE keyboard layout.

Parameters
NameDirectionMeaning
layoutIndexinThe layout setting's index: US, ES, UK, FR, DE, PT, IT.
Returns
The rows a keyboard of that layout shows; QWERTY for an unknown index.

touchKeyboardLettersPreference() #

TouchKeyboardLetters kleidos::ui::touchKeyboardLettersPreference()

The letter rows the device's keyboards show.

Returns
The rows last set by setTouchKeyboardLettersPreference; QWERTY before.

touchKeyboardRevealRect() #

Rect kleidos::ui::touchKeyboardRevealRect(const LayoutContext & layout, const Rect & area)

The reveal control's rectangle at the right end of the value row.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills.
Returns
The control rect; empty when area is empty or too narrow.

touchKeyboardRowLen() #

uint8_t kleidos::ui::touchKeyboardRowLen(const TouchKeyboardSheet & sheet, uint8_t row)

Number of keys in row of sheet.

Parameters
NameDirectionMeaning
sheetinThe keyboard as drawn.
rowinZero-based keyboard row [0, kTouchKeyboardRows).
Returns
Key count in that row; 0 for an out-of-range row.

touchKeyboardRowStart() #

uint8_t kleidos::ui::touchKeyboardRowStart(const TouchKeyboardSheet & sheet, uint8_t row)

Row-major index of the first key in row of sheet.

Parameters
NameDirectionMeaning
sheetinThe keyboard as drawn.
rowinZero-based keyboard row [0, kTouchKeyboardRows).
Returns
The first key index of that row; the layer's key count when row is out of range.

touchKeyboardShifted() #

TouchKeyboardLayer kleidos::ui::touchKeyboardShifted(TouchKeyboardLayer layer)

The layer a TouchKeyboardKeyKind::Shift press moves to.

Parameters
NameDirectionMeaning
layerinCurrent layer.
Returns
Upper from Lower, Lower from Upper, unchanged otherwise.

touchKeyboardSwitchRect() #

Rect kleidos::ui::touchKeyboardSwitchRect(const LayoutContext & layout, const Rect & area)

The PIN / passphrase switch's rectangle, just left of the reveal control.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills.
Returns
The control rect; empty when area is empty or too narrow.

touchKeyboardToggled() #

TouchKeyboardLayer kleidos::ui::touchKeyboardToggled(TouchKeyboardLayer layer)

The layer a TouchKeyboardKeyKind::LayerToggle press moves to.

Parameters
NameDirectionMeaning
layerinCurrent layer.
Returns
Symbols from a letter layer, Lower from Symbols, unchanged from Numeric (the PIN keypad has no layer-toggle key).

touchKeyboardUtf8LastLength() #

uint8_t kleidos::ui::touchKeyboardUtf8LastLength(const char * text, uint8_t bytes)

Bytes the last character of a UTF-8 string takes.

Parameters
NameDirectionMeaning
textinThe string.
bytesinIts length in bytes.
Returns
The last character's byte count (1..3); 0 for an empty string.

touchKeyboardUtf8Length() #

uint8_t kleidos::ui::touchKeyboardUtf8Length(const char * text, uint8_t bytes)

Characters in a UTF-8 string: every byte that does not continue a sequence.

Parameters
NameDirectionMeaning
textinThe string (need not be NUL-terminated).
bytesinBytes to count over.
Returns
The character count.

touchKeyboardVariantAt() #

int8_t kleidos::ui::touchKeyboardVariantAt(const LayoutContext & layout, const Rect & area, const TouchKeyboardSheet & sheet, uint8_t key, uint8_t count, int16_t x, int16_t y)

The variant cell a finger over the strip points at.

Lenient as a held finger is: anywhere from a cell's height above the strip to a key's height below the held key, the nearest cell by X; beyond half a cell past either end, nothing.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills.
sheetinThe keyboard as drawn.
keyinThe held key.
countinVariants on the strip.
xinFinger X.
yinFinger Y.
Returns
The cell index, or -1 when the finger has left the strip.

touchKeyboardVariantCellRect() #

Rect kleidos::ui::touchKeyboardVariantCellRect(const LayoutContext & layout, const Rect & area, const TouchKeyboardSheet & sheet, uint8_t key, uint8_t count, uint8_t cell)

One cell of a key's variant strip.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills.
sheetinThe keyboard as drawn.
keyinThe held key.
countinVariants on the strip.
cellinZero-based cell.
Returns
The cell rect; empty for a cell past count.

touchKeyboardVariantRect() #

Rect kleidos::ui::touchKeyboardVariantRect(const LayoutContext & layout, const Rect & area, const TouchKeyboardSheet & sheet, uint8_t key, uint8_t count)

The card of a key's variant strip.

Cells of the key's size in a row over the key, the first over the key itself, running right (left where the panel ends), inside area.

Parameters
NameDirectionMeaning
layoutinResponsive context.
areainContent rectangle the keyboard fills.
sheetinThe keyboard as drawn.
keyinThe held key.
countinVariants on the strip (TouchKeyboardVariants::count).
Returns
The strip's card; empty for no variants or an invalid key.

touchKeyboardVariantsOf() #

TouchKeyboardVariants kleidos::ui::touchKeyboardVariantsOf(char16_t base)

The variants a held key offers.

The accented and other Latin-1 forms of a letter, in the case of base (a → á à ä â ã å æ, N → Ñ), and ¿ / ¡ for ? / !. Forms the atlas cannot draw (outside Latin-1) are never offered.

Parameters
NameDirectionMeaning
baseinThe key's character (touchKeyboardCodepointAt).
Returns
The variants; a count of 0 when the key has none.

touchWindowTop() #

uint16_t kleidos::ui::touchWindowTop(uint16_t selected, uint16_t count, uint8_t visible, uint16_t prevTop, bool followSelection)

The window top of a list whose window a finger may have moved.

While followSelection is set this is scrollWindowTop. Once a touch scroll moved the window on its own the selection may be off screen, as on a phone: the window then stays where the finger left it, clamped to the list, until a button or key moves the selection and the host sets the flag again.

Parameters
NameDirectionMeaning
selectedinCurrently selected item index.
countinTotal number of items.
visibleinNumber of fully-visible rows in the window.
prevTopinThe window top from the previous frame.
followSelectioninTrue to keep the selection on screen.
Returns
The new window top (first visible item index).

tutorialHintHeight() #

int16_t kleidos::ui::tutorialHintHeight(const LayoutContext & layout)

Natural band height for the tutorial hint pill.

Matches chipHeight so a screen can reserve the band above its action bar and offset the tutorial content above it.

Parameters
NameDirectionMeaning
layoutinResponsive context (resolved small-font height + spacing).
Returns
Hint band height in pixels.

updateDropdownTouch() #

DropdownTouch kleidos::ui::updateDropdownTouch(const TouchGestureRecognizer & gestures, const TouchGestureEvent & ev, uint32_t nowMs, const LayoutContext & layout, const Rect & box, const DropdownProps & props, DropdownScroll & scroll, uint8_t & focus, uint8_t & scrollTop)

resolveDropdownTouch for a host that scrolls its options by touch.

Feeds the frame to scroll's scroller first: a vertical drag moves the options under the finger (and is never a tap), a release flings and settles, and scrollTop follows. A tap then takes the same grammar as resolveDropdownTouch, a tap on the peek sliver gliding a windowful on. Call it every frame, with or without a gesture, so a fling keeps moving.

Parameters
NameDirectionMeaning
gesturesinThe host's recognizer, after this frame's sample.
evinWhat the recognizer resolved on this sample.
nowMsinMonotonic time of the sample.
layoutinResponsive context.
boxinThe popover rect the dropdown is drawn in.
propsinIts props (title, count and back chip are read).
scrollin, outThe host's scroll state.
focusin, outThe focused option; moved on a select.
scrollTopin, outThe window top.
Returns
What the frame did (Moved also when only the options moved).

usableLabelWidth() #

int16_t kleidos::ui::usableLabelWidth(const LayoutContext & layout, const Rect & content, bool listOverflows, ListRowTrailing trailing, bool hasLeadingIcon = false)

Usable width for a row's primary label, after chrome.

The exact budget drawListRow leaves for the label: the row width (content minus the scroll rail when the list overflows) less the two horizontal row pads, the trailing accessory reserve, and the leading icon slot when present. Exposed so a caller can pre-select a responsive label variant (the longest that fits) instead of relying on the row's truncation fallback — byte-identical to the width the row itself will measure against.

Parameters
NameDirectionMeaning
layoutinResponsive context (token scales + device profile).
contentinThe list content rectangle the rows fill.
listOverflowsinTrue when the list is longer than its window (a scroll rail is reserved on color panels, narrowing the row).
trailinginThe row's trailing accessory kind.
hasLeadingIconinTrue when the row draws a leading icon/brand slot.
Returns
Usable label width in pixels (>= 0).

valueRows() #

std::size_t kleidos::ui::text_wrap::valueRows(Canvas & canvas, const char * text, hal::display::Font font, int16_t maxW, std::size_t maxRows, Weight weight = Weight::Regular)

How many rows wrapValue fills for text with a budget of maxRows, without writing them.

A screen that grows to hold a value asks this first, sizes the value's band from the answer, and draws the rows once the whole layout is known.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
textinNUL-terminated UTF-8 value (nullptr or empty yields 0).
fontinFont role the rows will be drawn in.
maxWinRow width in pixels (<= 0 yields 0).
maxRowsinRow budget.
weightinFace the rows will be drawn in.
Returns
Rows filled, 0..maxRows; maxRows also when the value is cut.

visibleRowCount() #

int16_t kleidos::ui::visibleRowCount(const LayoutContext & layout, int16_t contentHeight, bool twoLine, ListRowSize size = ListRowSize::Compact)

Compute how many rows fully fit a content height (the scroll window).

Divides by listRowHeight, so the count already accounts for the touch-primary tap-target floor (fewer, taller rows on touch boards).

Parameters
NameDirectionMeaning
layoutinResponsive context.
contentHeightinHeight of the area the list draws into.
twoLineinTrue if rows are two-line.
sizeinVertical density of the rows.
Returns
Number of fully-visible rows (>= 0).

widestUnbreakable() #

int16_t kleidos::ui::text_wrap::widestUnbreakable(Canvas & canvas, const char * text, hal::display::Font font)

Width of the widest part of text that wrapWhole cannot break.

A word, or the part of a hyphenated compound up to and with its hyphen: the narrowest row wrapWhole can set text in whole.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
textinNUL-terminated text (nullptr or empty measures 0).
fontinLogical font role it would be drawn in.
Returns
Width in pixels.

wifi() #

void kleidos::ui::qr::wifi(WifiPayload & out, const char * ssid, const char * password, WifiAuth auth = WifiAuth::Wpa)

Build a standard WiFi join payload, escaping the special characters.

Produces WIFI:T:<auth>;S:<ssid>;P:<password>;;, backslash-escaping any of \ ; , : " in ssid / password. For ui::qr::WifiAuth::Nopass the P: field is emitted empty. Heap-free; truncates if the payload would exceed the buffer capacity.

Parameters
NameDirectionMeaning
outoutDestination payload buffer (overwritten).
ssidinNetwork SSID (treated as empty if nullptr).
passwordinNetwork password (ignored for ui::qr::WifiAuth::Nopass; treated as empty if nullptr).
authinAuthentication type (default ui::qr::WifiAuth::Wpa).

wordHint() #

KeyHint kleidos::ui::wordHint(const char * key, const char * verb, bool primary = false)
constexpr

A hint whose key is named in a word.

Parameters
NameDirectionMeaning
keyinThe key's name, drawn bold.
verbinWhat the key does.
primaryinWhether it is the screen's main action.
Returns
The hint.

wrap() #

std::size_t kleidos::ui::text_wrap::wrap(Canvas & canvas, const char * text, hal::display::Font font, int16_t innerW, std::span< WrapLine > lines)

Greedily word-wrap text into rows of at most innerW pixels.

Measures candidate lines through canvas at font and packs whole words greedily; a single word wider than innerW is split by measured width and continues on the next row rather than being dropped. Stops at lines.size() rows; remaining text is not emitted (the caller clips vertical overflow). Each row is NUL-terminated.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text (no draws emitted).
textinNUL-terminated source text (nullptr yields 0 rows).
fontinLogical font role the rows will be drawn in.
innerWinTarget row width in pixels (<= 0 yields 0 rows).
linesoutCaller-owned row span; its size bounds the rows filled.
Returns
Number of rows written (0..lines.size()).

wrapFitted() #

std::size_t kleidos::ui::text_wrap::wrapFitted(Canvas & canvas, const char * text, hal::display::Font font, int16_t innerW, std::span< WrapLine > lines)

Word-wrap text into at most lines.size() rows, cutting the last row with "…" where the words run past it.

The rows are those of wrap. When the text needs more rows than lines holds, the last row takes the rest of the text cut by fitText, so a block that cannot grow any further still shows that it goes on instead of dropping its last words silently. The cut never splits a UTF-8 sequence.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text (no draws emitted).
textinNUL-terminated source text (nullptr yields 0 rows).
fontinLogical font role the rows will be drawn in.
innerWinTarget row width in pixels (<= 0 yields 0 rows).
linesoutCaller-owned row span; its size is the row budget.
Returns
Number of rows written (0..lines.size()).

wrapValue() #

std::size_t kleidos::ui::text_wrap::wrapValue(Canvas & canvas, const char * text, hal::display::Font font, int16_t maxW, std::span< WrapLine > lines, Weight weight = Weight::Regular)

Break a value into rows of at most maxW pixels, so it reads whole.

For what a credential screen shows of a record: a username, an e-mail address, a host, a line naming what else the record stores. Such a value often has no space to wrap on, and a row that runs out of room must not cut it with "…": the owner reads it to know which account this is. A row ends where the value has a seam, the furthest one that fits:

  1. after the last space in the row's back half (the space itself is dropped);
  2. else after the last joint in its back half (a period, hyphen, underscore, slash, backslash, colon, semicolon, comma, plus, equals sign, vertical bar, ampersand, tilde or at sign), so "example." / "com" never reads as two words the value does not have;
  3. else after the last space anywhere in it;
  4. else on the last whole code point that fits, never inside one.

An e-mail address breaks after its last "@" first when that costs no extra row, so each row names something: "dev@" / "example.com", not "dev@example." / "com".

Only a value that needs more rows than lines holds is cut: its last row takes the rest and ends in "…" (fitText). That is the last resort, for a value longer than every row together.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text (no draws emitted).
textinNUL-terminated UTF-8 value (nullptr or empty yields 0 rows).
fontinFont role the rows will be drawn in.
maxWinRow width in pixels (<= 0 yields 0 rows).
linesoutCaller-owned rows; its size is the row budget.
weightinFace the rows will be drawn in, measured in it.
Returns
Number of rows written (0..lines.size()).

wrapWhole() #

WholeWrap kleidos::ui::text_wrap::wrapWhole(Canvas & canvas, const char * text, hal::display::Font font, int16_t innerW, std::span< WrapLine > lines)

Word-wrap text as wrap does, and say whether it reads whole.

For text that must not be cut and can instead be set smaller: a warning, a notice, a popup's title. The rows are those of wrap, except that a word wider than innerW that is a hyphenated compound ("Datenschutz-Schlüssel") breaks after its hyphen, its parts read whole on two rows. Any other word wider than innerW is split across rows, and the rows stop at lines.size(); whole is false in either case, so the caller can try another font instead of drawing it.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text (no draws emitted).
textinNUL-terminated source text (nullptr or empty is whole, in 0 rows).
fontinLogical font role the rows will be drawn in.
innerWinTarget row width in pixels.
linesoutCaller-owned row span; its size bounds the rows filled.
Returns
The rows written and whether every word landed whole on one.

Back to the top

Variable Documentation

kBatteryHysteresisPct #

int16_t kleidos::ui::kBatteryHysteresisPct
inlineconstexpr

Points a step's window reaches past the readings that are its own, on each side, so two neighboring windows share twice as many. Six shared points hold the widest read noise measured at rest: 44 mV on the CoreInk's ADC (about five points at 9 mV a point), 8 mV on the M5StickC Plus2's (one point), and a fuel-gauge percent that did not move on the CoreS3 SE.

kBatteryLowClearPct #

int16_t kleidos::ui::kBatteryLowClearPct
inlineconstexpr

Reading above which a red gauge stops being red, in percent: the red mark's window reaches the same overlap above kBatteryLowPct.

kBoldFitNum #

int16_t kleidos::ui::text_wrap::kBoldFitNum
inlineconstexpr

Share of a wrap budget a bold block may claim, as num/den (7/8 = 12.5% held back). The wrap helpers (wrap, wrapFitted) measure the regular face, and a baked bold rung runs wider per glyph than the regular face that was measured (the synthetic fallback adds a smear column), so a block drawn bold is wrapped against the reduced budget; the headroom exceeds the widening of every bold rung the font ladder bakes. A single line measures the bold face itself instead (fitText and fitLabel with Weight::Bold).

kCharWheelMaxLen #

uint8_t kleidos::ui::kCharWheelMaxLen
constexpr

Default maximum label length the wheel will build (under the 23-byte backend buffer, keeps the label one line on a 135 px row). Used by the short-label editors (bond rename / device name). A per-context CharWheelProps::maxLen can raise the effective cap up to kCharWheelStoreCap (e.g. a 63-char WiFi passphrase); the visible line then windows to its tail.

kCharWheelStoreCap #

uint8_t kleidos::ui::kCharWheelStoreCap
constexpr

Storage capacity for the wheel label (chars, sans NUL). Sized to hold the longest per-context value the editor accepts — an 802.11 WPA passphrase (63 chars). The label renderer holds this many mask bullets (three UTF-8 bytes each), so a masked value is never cut short before it is windowed to its tail.

kHoldRimStepPct #

uint8_t kleidos::ui::kHoldRimStepPct
inlineconstexpr

Progress step, in percent, at which the rim advances.

The rim advances in the same increments as the footer's hold gauge rather than per perimeter pixel: a ~330 px perimeter filled over the hold threshold would otherwise advance on nearly every loop iteration, and each advance is a frame — a blit over SPI plus a seqlock cycle that spoils any concurrent read-back.

kIdentityMaskGlyphs #

std::size_t kleidos::ui::kIdentityMaskGlyphs
inlineconstexpr

Mask glyphs the password row draws, whatever the password's length: the row must not publish how long the secret is.

kIdentityValueRowsMax #

std::size_t kleidos::ui::kIdentityValueRowsMax
inlineconstexpr

Most lines one value of the block (the username, the site, the line) takes before its last line is cut.

kKeyholeFeatherPx #

int16_t kleidos::ui::kKeyholeFeatherPx
inlineconstexpr

Pixels a keyhole repaint box reaches past every pixel the keyhole can touch: a margin for the rounding of the stem's direction.

kKleidosMarkAtEdgeMinOutlined #

int16_t kleidos::ui::kKleidosMarkAtEdgeMinOutlined
inlineconstexpr

The edge from which a still mark is drawn outlined (variant A); below it the header's pixel-fit solid body (variant B) is drawn.

kKleidosMarkSolidBodyMaxEdge #

int16_t kleidos::ui::kKleidosMarkSolidBodyMaxEdge
constexpr

The largest edge drawn as KleidosMarkStyle::SolidBody (px): the 23 px mark of the Sticks' PIN lockup, the largest mark in a bar of 24 px or less.

kLabelGrowLines #

std::size_t kleidos::ui::text_wrap::kLabelGrowLines
inlineconstexpr

Lines a label set by fitLabel may take where its box grows to hold them (a popup's button: "Borrar" / "llavero" / "(mantén)").

kLabelMaxLines #

std::size_t kleidos::ui::text_wrap::kLabelMaxLines
inlineconstexpr

Lines a label set by fitLabel takes at most by default (a choice row, a key's caption), and a name set by fitName.

kNoActiveMarker #

uint8_t kleidos::ui::kNoActiveMarker
inlineconstexpr

Sentinel for PinDialProps::activeMarker meaning "no tick highlighted" (idle / parked state — every exterior tick stays dim).

kNoPriorSweep #

int16_t kleidos::ui::kNoPriorSweep
inlineconstexpr

Sentinel for drawPinDialSlice meaning "no previously-painted fill" (the caller must do a full drawPinDial instead).

kPinDialClearPad #

int16_t kleidos::ui::kPinDialClearPad
inlineconstexpr

How far clearPinDial reaches past PinDialProps::rOuter (px): the AA feather of the outer outline, with a pixel to spare.

kPopupTitleMaxLines #

std::size_t kleidos::ui::kPopupTitleMaxLines
inlineconstexpr

Lines a card's title may take at most, whatever the caller asks; past them the last line ends in "…".

kQrMinModulePx #

int16_t kleidos::ui::kQrMinModulePx
constexpr

Fewest whole pixels per module a camera can be expected to resolve.

At one pixel per module the modules are the panel's own pixel pitch, and no phone resolves them at any distance it can focus at — the symbol renders, and nothing reads it. Two is the floor a band has to clear for the page to be doing its job, and minReadableQrBandPx is that floor expressed as the band a payload needs.

kQrQuietZone #

int16_t kleidos::ui::kQrQuietZone
constexpr

Width of the light margin drawn around the symbol, in modules.

ISO/IEC 18004 §9.1 requires a four-module light border on all four sides of a QR Code symbol, and nothing wider buys anything: the margin is the quiet zone the spec requires and no more. The margin is drawn in the light color, so a caller whose card is that same light shade gets the card and the quiet zone from one fill.

kTabUnderlineAuto #

int16_t kleidos::ui::kTabUnderlineAuto
inlineconstexpr

Sentinel for TabBarProps::underlineX meaning "underline at rest on the selected cell" (no slide override).

kToastMaxLines #

std::size_t kleidos::ui::kToastMaxLines
inlineconstexpr

Lines a toast's title or detail may take; more than any string in the table needs on the narrowest frame. Past them the last line ends in "…".

kTouchKeyVariantHoldMs #

uint32_t kleidos::ui::kTouchKeyVariantHoldMs
inlineconstexpr

How long a key or the B zone is held before its variant strip opens (ms); the touch recognizer's long-press threshold, so finger and button agree.

kVaultTabIcons #

std::array<IconId, 3> kleidos::ui::kVaultTabIcons
inlineconstexpr

Icons of the vault pager's labeled tabs, in tab order: the credential card, the 2FA timer and the actions menu.

kWifiPayloadCap #

std::size_t kleidos::ui::qr::kWifiPayloadCap
constexpr

Capacity (chars) of the WiFi payload buffer wifi fills. A WIFI: string for a 32-char SSID + 63-char passphrase, fully escaped, fits comfortably.

Back to the top