Kleidos API Search

In development. It changes without notice.

Topic

First-Time Setup

The first use of a board: its keys, the language, a rehearsal of each control, the unlock secret, and the pairing of a first computer.

It has one handler for the boards with keys or touch and one for the boards with a keyboard. Its pairing page and the settings' page that adds a host are the two that open the pairing window (BLE HID Keyboard).

See also
Application States, Pairing & Numeric Comparison

Files

file src/states/onboarding/keyboard_onboarding_state.h
FSM handler for first-time setup on the keyboard boards (the M5Cardputer ADV and the LILYGO T-Deck).
file src/states/onboarding/onboarding_chrome.h
The drawing both first-time setup flows share: the setup header with its progress bar, the welcome mark and the touch-gesture row.
file src/states/onboarding/onboarding_epaper_layout.h
Where the dial board's setup pages put their rows and key locators.
file src/states/onboarding/onboarding_flow.h
Which onboarding pages a board plays, and in what order.
file src/states/onboarding/onboarding_logic.h
Headless finite-state machine driving the first-time setup flow.
file src/states/onboarding/onboarding_state.h
FSM handler for first-time setup on the boards without a keyboard.
file src/states/onboarding/onboarding_state_internal.h
The constants and helpers the sources of OnboardingStateHandler share.
file src/states/onboarding/onboarding_state_tutorial.cpp
The chrome the five first-run tutorials share and the sequencing that enters each (part of onboarding_state.h).
file src/states/onboarding/onboarding_state_tutorial_arc.cpp
The first-run Timing Arc tutorial: a practice dial for the PIN's hold-and-release (part of onboarding_state.h).
file src/states/onboarding/onboarding_state_tutorial_dropdown.cpp
The first-run dropdown tutorial: a picker of five sample options, one committed (part of onboarding_state.h).
file src/states/onboarding/onboarding_state_tutorial_stepper.cpp
The first-run stepper tutorial: a bounded practice value stepped away from its start (part of onboarding_state.h).
file src/states/onboarding/onboarding_state_tutorial_tabs.cpp
The first-run tabs tutorial: the vault's tab strip, walked until every tab was shown (part of onboarding_state.h).
file src/states/onboarding/onboarding_state_tutorial_writing.cpp
The first-run writing tutorial: two glyphs typed on the CharWheel, the button boards' text editor (part of onboarding_state.h).
file src/states/onboarding/onboarding_tips.h
The one-line messages of a setup page: the role each fits the panel in, and the tips a touch board's closing page shows.
file src/states/onboarding/onboarding_tutorial_logic.h
Headless sequencer for the interactive component tutorials block.

Classes

class kleidos::KeyboardOnboardingStateHandler
First-time setup on the keyboard boards: language, passphrase, clock and pairing, after the keys (and touch) tour. More about kleidos::KeyboardOnboardingStateHandler
struct kleidos::states::onb::SkipRects
The header's Skip button where the board draws its own touch controls: the drawn button at the header's free right end, and the header band around it that answers the tap. Both empty elsewhere. One geometry for the draw and the pointer. More about kleidos::states::onb::SkipRects
struct kleidos::states::onb::EpaperControlRow
Where one row of the controls page sits. More about kleidos::states::onb::EpaperControlRow
struct kleidos::states::onb::EpaperControlLayout
The controls page's row ladder. More about kleidos::states::onb::EpaperControlLayout
struct kleidos::states::onb::EpaperLocator
An arrow that points at a chassis key. More about kleidos::states::onb::EpaperLocator
struct kleidos::states::onb::PageList
The pages one flow plays, in order. More about kleidos::states::onb::PageList
class kleidos::OnboardingLogic
Headless onboarding router; holds the captured PIN and current step only. More about kleidos::OnboardingLogic
class kleidos::OnboardingStateHandler
First-time setup on the boards without a keyboard: runs the OnboardingLogic steps and its introduction screens, and stores the finished flag and the language. More about kleidos::OnboardingStateHandler
class kleidos::OnboardingTutorialLogic
Headless tutorial sequencer; holds the phase, goal flag, and the completed bitmask only. More about kleidos::OnboardingTutorialLogic

Enumerations

enum class kleidos::states::onb::EpaperKeyMark : uint8_t { kleidos::states::onb::EpaperKeyMark::TopKey , kleidos::states::onb::EpaperKeyMark::Dial , kleidos::states::onb::EpaperKeyMark::BackKey }
A chassis key the controls page points at. More about kleidos::states::onb::EpaperKeyMark
enum class kleidos::states::onb::Flow : uint8_t { kleidos::states::onb::Flow::Buttons , kleidos::states::onb::Flow::Touch , kleidos::states::onb::Flow::Dial , kleidos::states::onb::Flow::ButtonsNoClock }
Which set of pages a board plays, chosen by what it can be driven with. More about kleidos::states::onb::Flow
enum class kleidos::states::onb::Page : uint8_t { kleidos::states::onb::Page::WELCOME, kleidos::states::onb::Page::BtnAIntro, kleidos::states::onb::Page::BtnBIntro, kleidos::states::onb::Page::LANGUAGE, kleidos::states::onb::Page::TutArc, kleidos::states::onb::Page::TutTabs, kleidos::states::onb::Page::TutDropdown, kleidos::states::onb::Page::TutStepper, kleidos::states::onb::Page::TutWriting, kleidos::states::onb::Page::PinLength, kleidos::states::onb::Page::CreatePin, kleidos::states::onb::Page::ConfirmPin, kleidos::states::onb::Page::SetClock, kleidos::states::onb::Page::PAIR, kleidos::states::onb::Page::DEMO, kleidos::states::onb::Page::DONE }
enum class kleidos::OnboardingStep : uint8_t { kleidos::OnboardingStep::WELCOME, kleidos::OnboardingStep::LANGUAGE, kleidos::OnboardingStep::TUTORIAL, kleidos::OnboardingStep::CreatePin, kleidos::OnboardingStep::ConfirmPin, kleidos::OnboardingStep::PAIR, kleidos::OnboardingStep::DEMO, kleidos::OnboardingStep::DONE }
Steps of the canonical onboarding flow. More about kleidos::OnboardingStep
enum class kleidos::OnboardingLang : uint8_t
User-facing language preference. Persisted to NVS as a short tag. Values mirror i18n::Lang so casts between the two are well-defined.
enum class kleidos::OnboardingResult : uint8_t { kleidos::OnboardingResult::CONTINUE , kleidos::OnboardingResult::MISMATCH , kleidos::OnboardingResult::FINISHED }
Outcome codes returned by each step-transition call in OnboardingLogic. More about kleidos::OnboardingResult
enum class kleidos::TutorialPhase : uint8_t { kleidos::TutorialPhase::ARC, kleidos::TutorialPhase::TABS, kleidos::TutorialPhase::DROPDOWN, kleidos::TutorialPhase::STEPPER, kleidos::TutorialPhase::WRITING, kleidos::TutorialPhase::COMPLETE }
Phases of the interactive component-tutorial block, in play order. More about kleidos::TutorialPhase

Functions

SkipRectskleidos::states::onb::skipRects (const ui::LayoutContext &layout)
Where the header's Skip button goes on this board.
int16_tkleidos::states::onb::contentTopY (const ui::LayoutContext &layout)
Y of the first content line (a middle-center datum) below the setup header and its progress bar.
voidkleidos::states::onb::drawSetupHeader (ui::Canvas &canvas, const ui::LayoutContext &layout, uint8_t step, uint8_t total, bool skip=false)
Draw the "Kleidos · setup" header and the step progress bar under it.
voidkleidos::states::onb::drawCompactSetupHeader (ui::Canvas &canvas, const ui::LayoutContext &layout, const char *title, uint8_t step, uint8_t total)
Draw a short panel's setup header: the page title in the header bar itself (no "setup" subtitle, no separate title line) and the progress bar under it, so the page keeps its rows.
int16_tkleidos::states::onb::compactHeaderBottom (const ui::LayoutContext &layout)
Bottom of the compact setup header's progress bar.
voidkleidos::states::onb::drawWelcomeMark (ui::Canvas &canvas, const ui::LayoutContext &layout, int16_t cx, int16_t cy, int16_t edge)
Draw the big Kleidos welcome mark (lock and keyhole) centered at (cx, cy), edge pixels across.
int16_tkleidos::states::onb::drawTouchGestures (ui::Canvas &canvas, const ui::LayoutContext &layout, int16_t titleY)
Draw the three touch gestures side by side under titleY: tap to select, swipe to scroll, swipe sideways to change tab — each an icon, the gesture in bold and what it does.
constexpr EpaperControlLayoutkleidos::states::onb::epaperControlRows (int16_t left, int16_t top, int16_t bottom, int16_t rowH)
Lay the controls page's five rows between top and bottom.
constexpr EpaperLocatorkleidos::states::onb::epaperKeyLocator (EpaperKeyMark mark, int16_t w, int16_t h)
Where to point for mark on a w by h panel.
constexpr Flowkleidos::states::onb::flowFor (const ui::DeviceProfile &profile, bool hasClock)
The flow a board with profile plays.
constexpr const PageList &kleidos::states::onb::pagesFor (Flow flow)
The pages flow plays, in order.
constexpr boolkleidos::states::onb::includesPage (Flow flow, Page page)
Whether flow plays page at all.
constexpr boolkleidos::states::onb::pageOwnsRadio (Page page)
Whether page holds the Bluetooth radio while it is on screen.
constexpr boolkleidos::states::onb::stopRadioOnPageChange (bool leavingOwns, bool enteringOwns)
Whether a page change has to stop the radio.
constexpr Pagekleidos::states::onb::nextPage (Flow flow, Page page)
The page after page in flow, wrapping from the last to the first.
constexpr TutorialPhasekleidos::states::onb::tutorialOf (Page page)
The tutorial page rehearses.
constexpr uint8_tkleidos::states::onb::tutorialMask (Flow flow)
The tutorials flow plays, as a tutorialBit mask.
constexpr OnboardingStepkleidos::states::onb::stepOf (Page page)
The canonical step page belongs to.
uint8_tkleidos::states::onb::barStep (Flow flow, OnboardingStep step)
The 1-based bar step a canonical step shows in a button or touch flow.
uint8_tkleidos::states::onb::progressStep (Flow flow, Page page)
The 1-based step page shows in flow's progress bar.
constexpr uint8_tkleidos::states::onb::progressSteps (Flow flow)
The denominator of flow's progress bar.
ui::LayoutContextkleidos::states::onboarding::onbLayout ()
voidkleidos::states::onboarding::drawOnbActionBar (ui::Canvas &canvas, const ui::LayoutContext &layout, const char *primary, const char *secondary, const char *tertiary, bool secondaryHeld, const char *primaryHold)
boolkleidos::states::onboarding::skipKeyPressed (AppContext &ctx)
const char *kleidos::states::onboarding::tutHint (i18n::StringId buttons, i18n::StringId threeButtons, i18n::StringId touch, bool hasC)
ui::Rectkleidos::states::onboarding::tutHintBand (const ui::LayoutContext &layout)
Goal-pill band above the action bar, shared by all five tutorial screens.
voidkleidos::states::onboarding::drawTutGoalPill (ui::Canvas &canvas, const ui::LayoutContext &layout, i18n::StringId goal, bool done)
voidkleidos::states::onboarding::drawTutTitle (ui::Canvas &canvas, const ui::LayoutContext &layout, i18n::StringId title, uint8_t number, uint8_t count)
int16_tkleidos::states::onboarding::tutHintLineY (ui::Canvas &canvas, const ui::LayoutContext &layout)
Y of the single hint line drawn under a tutorial title.
uint8_tkleidos::states::onboarding::tutTabCount ()
Number of cells the tutorial strip draws.
ui::ActionBarPropskleidos::states::onboarding::tutWritingBarFor (ui::CharWheelMode mode, uint8_t holdPctB, bool twoButtons)
int16_tkleidos::states::onb::lineRoom (const ui::LayoutContext &layout)
Width a one-line message of a setup page may take.
hal::display::Fontkleidos::states::onb::lineFont (ui::Canvas &canvas, const ui::LayoutContext &layout, const char *text)
The role a one-line message is drawn in.
hal::display::Fontkleidos::states::onb::tipsFont (ui::Canvas &canvas, const ui::LayoutContext &layout, std::span< const i18n::StringId > tips)
The one role the tips of a page are drawn in.
int16_tkleidos::states::onb::gestureColumnRoom (const ui::LayoutContext &layout)
Width a gesture's line may take in its third of the panel.
hal::display::Fontkleidos::states::onb::gestureUseFont (ui::Canvas &canvas, const ui::LayoutContext &layout)
The one role the three gesture uses are drawn in.
constexpr uint8_tkleidos::tutorialBit (TutorialPhase phase)
The mask bit that stands for phase.

Variables

constexpr int16_tkleidos::states::onb::kProgressBarGap
Gap (px) between the bottom of the setup header and the progress bar.
constexpr size_tkleidos::states::onb::kEpaperControlRowCount
Rows the controls page draws: move, press, hold, back, lock.
constexpr int16_tkleidos::states::onb::kEpaperMarkColumnPx
Width of the mark column, wide enough for a bold "OK" and a key-cap chip.
constexpr int16_tkleidos::states::onb::kEpaperMarkGapPx
Gap between the mark column and the words.
constexpr size_tkleidos::states::onb::kFlowCount
Number of flows; not a flow.
constexpr size_tkleidos::states::onb::kPageCount
Number of pages in the catalog; not a page.
constexpr std::array< PageList, kFlowCount >kleidos::states::onb::kPagesByFlow
Every flow's page order, indexed by Flow.
constexpr uint8_tkleidos::states::onb::kDialProgressSteps
How many steps the dial's progress bar counts (see progressStep).
constexpr uint32_tkleidos::states::onboarding::kTutBeatMs
constexpr uint32_tkleidos::states::onboarding::kTutBackHoldMs
constexpr uint32_tkleidos::states::onboarding::kTutCaretBlinkMs
Caret blink half-cycle on the WRITING screen (motion.pulse).
constexpr int32_tkleidos::states::onboarding::kTutStepStart
constexpr std::array< i18n::StringId, 3 >kleidos::states::onb::kTouchClosingTips
constexpr std::array< i18n::StringId, 3 >kleidos::states::onb::kTouchGestureUses
constexpr uint8_tkleidos::kTutorialPhaseCount
Number of playable tutorial phases (excludes the terminal COMPLETE).
constexpr uint8_tkleidos::kTutorialMaskAll
Every playable tutorial: the mask a two-button board resets with.

Back to the top

Enumeration Type Documentation

EpaperKeyMark #

enum class kleidos::states::onb::EpaperKeyMark : uint8_t

A chassis key the controls page points at.

Enumerator
TopKey 

The lock key on the top edge.

Dial 

The ▲●▼ dial on the right edge.

BackKey 

The back / wake key below the dial, same edge.

Flow #

enum class kleidos::states::onb::Flow : uint8_t

Which set of pages a board plays, chosen by what it can be driven with.

Enumerator
Buttons 

Two face buttons and a clock chip: fifteen pages, no clock page.

Touch 

A touch panel with touch buttons: twelve pages, no dial, no wheel.

Dial 

A ▲●▼ dial: ten pages, one controls page, two tutorials.

ButtonsNoClock 

Two face buttons and no clock chip: all sixteen, the clock page included.

OnboardingResult #

enum class kleidos::OnboardingResult : uint8_t

Outcome codes returned by each step-transition call in OnboardingLogic.

Enumerator
CONTINUE 

Step advanced (or the call was a no-op for the current state).

MISMATCH 

Confirm failed — caller shows banner + stays.

FINISHED 

DONE step acknowledged — caller leaves onboarding.

OnboardingStep #

enum class kleidos::OnboardingStep : uint8_t

Steps of the canonical onboarding flow.

Value UI screen Advance function
WELCOME Brand splash advanceFromWelcome
LANGUAGE Language picker advanceFromLanguage
TUTORIAL Interactive tutorials × 5 advanceFromTutorial
CreatePin First PIN entry storeCreatedPin
ConfirmPin Second PIN entry confirmPin
PAIR Optional BLE pairing advanceFromPair
DEMO Optional fake-credential advanceFromDemo
DONE "Open vault" CTA acknowledgeDone
Enumerator
WELCOME 

Intro screen.

LANGUAGE 

Language selection.

TUTORIAL 

Interactive component tutorials (OnboardingTutorialLogic).

CreatePin 

First PIN entry.

ConfirmPin 

Confirm PIN entry.

PAIR 

Optional BLE pairing.

DEMO 

Optional demo screen.

DONE 

Setup complete.

Page #

enum class kleidos::states::onb::Page : uint8_t

One page of setup. The names and order are the whole catalog; a flow's table picks from it.

Enumerator
WELCOME 

The brand mark and the invitation to begin.

BtnAIntro 

Where the first key is — the controls page on a dial.

BtnBIntro 

Where the second key is (button and touch boards only).

LANGUAGE 

The language picker.

TutArc 

Rehearse the Timing Arc, the default dial the PIN is entered on.

TutTabs 

Rehearse the vault's tab strip.

TutDropdown 

Rehearse a single-select popover.

TutStepper 

Rehearse a numeric editor.

TutWriting 

Rehearse the character wheel.

PinLength 

Choose how many digits the PIN has (the boards that dial it).

CreatePin 

Choose the PIN.

ConfirmPin 

Repeat it.

SetClock 

Set the time, on a board that keeps none while it is off.

PAIR 

Optional BLE pairing.

DEMO 

Optional rehearsal on a fake credential.

DONE 

Setup finished.

TutorialPhase #

enum class kleidos::TutorialPhase : uint8_t

Phases of the interactive component-tutorial block, in play order.

Value Component exercised Goal
ARC ui::drawPinDial timing-arc dial lock one digit
TABS ui::drawTabBar icon pager visit every tab
DROPDOWN ui::drawDropdown single-select list commit a pick
STEPPER ui::drawStepper numeric editor change the value
WRITING ui::drawCharWheel text entry type two glyphs
COMPLETE (terminal — leave the block) —
Enumerator
ARC 

Timing-arc dial (hold-to-select).

TABS 

Tab pager with the sliding underline.

DROPDOWN 

Single-select list popover.

STEPPER 

− value + numeric editor.

WRITING 

CharWheel 2-button text entry (keyboard-less boards).

COMPLETE 

Terminal: every tutorial played or skipped.

Back to the top

Function Documentation

barStep() #

uint8_t kleidos::states::onb::barStep(Flow flow, OnboardingStep step)
inline

The 1-based bar step a canonical step shows in a button or touch flow.

The flow without a clock chip plays one page more — the clock, right after the PIN — so every step after the PIN moves one along its bar.

Parameters
NameDirectionMeaning
flowinThe board's flow (not the dial's, which numbers pages).
stepinA canonical step.
Returns
Its position in flow's bar.

compactHeaderBottom() #

int16_t kleidos::states::onb::compactHeaderBottom(const ui::LayoutContext & layout)

Bottom of the compact setup header's progress bar.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The y just under the bar.

contentTopY() #

int16_t kleidos::states::onb::contentTopY(const ui::LayoutContext & layout)

Y of the first content line (a middle-center datum) below the setup header and its progress bar.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The line's center.

drawCompactSetupHeader() #

void kleidos::states::onb::drawCompactSetupHeader(ui::Canvas & canvas, const ui::LayoutContext & layout, const char * title, uint8_t step, uint8_t total)

Draw a short panel's setup header: the page title in the header bar itself (no "setup" subtitle, no separate title line) and the progress bar under it, so the page keeps its rows.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context.
titleinThe page title.
stepin1-based step.
totalinSteps in the flow.

drawOnbActionBar() #

void kleidos::states::onboarding::drawOnbActionBar(ui::Canvas & canvas, const ui::LayoutContext & layout, const char * primary, const char * secondary, const char * tertiary = nullptr, bool secondaryHeld = false, const char * primaryHold = nullptr)

Draw a setup page's footer hint bar. The affordance-driven component maps the semantic slots to the board's physical inputs (A/B key caps on the Stick, key hints on keyboards, dial icons on CoreInk); a null secondary draws a single centered slot. Defined in onboarding_state.cpp.

Parameters
NameMeaning
canvasThe canvas to draw on.
layoutThe active display layout.
primaryThe primary slot's label.
secondaryThe secondary slot's label, or null for one slot.
tertiaryThe tertiary slot's label, or null for none.
secondaryHeldWhether the secondary acts on a hold (skip on two buttons), which draws the rule that announces it.
primaryHoldThe primary slot's hold label, or null for none.

drawSetupHeader() #

void kleidos::states::onb::drawSetupHeader(ui::Canvas & canvas, const ui::LayoutContext & layout, uint8_t step, uint8_t total, bool skip = false)

Draw the "Kleidos · setup" header and the step progress bar under it.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context.
stepin1-based step; 0 draws nothing (a splash owns the screen).
totalinSteps in the flow (the bar's full length).
skipinDraw the Skip button, on the boards that draw their own touch controls, for a page that can be skipped.

drawTouchGestures() #

int16_t kleidos::states::onb::drawTouchGestures(ui::Canvas & canvas, const ui::LayoutContext & layout, int16_t titleY)

Draw the three touch gestures side by side under titleY: tap to select, swipe to scroll, swipe sideways to change tab — each an icon, the gesture in bold and what it does.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context.
titleYinCenter of the page title the row sits under.
Returns
The y just below the row.

drawTutGoalPill() #

void kleidos::states::onboarding::drawTutGoalPill(ui::Canvas & canvas, const ui::LayoutContext & layout, i18n::StringId goal, bool done)

Draw the tutorial goal pill: the goal caption while pending, the shared "nice!" copy once the goal is reached. Clears the band first so it can be repainted in place when the goal flips. Defined in onboarding_state_tutorial.cpp.

Parameters
NameMeaning
canvasThe canvas to draw on.
layoutThe active display layout.
goalThe goal caption.
doneWhether the goal is reached.

Draw the tutorial goal pill: the goal caption while pending, the shared "nice!" copy once the goal is reached. Clears the band first so it can be repainted in place when the goal flips.

drawTutTitle() #

void kleidos::states::onboarding::drawTutTitle(ui::Canvas & canvas, const ui::LayoutContext & layout, i18n::StringId title, uint8_t number, uint8_t count)

Draw the tutorial title line: centered heading + a right-aligned "x/y" block counter so the section reads as one guided block. Defined in onboarding_state_tutorial.cpp.

Parameters
NameMeaning
canvasThe canvas to draw on.
layoutThe active display layout.
titleThe tutorial's title.
numberThe tutorial's position in the block, from 1.
countThe number of tutorials in the block.

Draw the tutorial title line: centered heading + a right-aligned "x/y" block counter so the section reads as one guided block.

drawWelcomeMark() #

void kleidos::states::onb::drawWelcomeMark(ui::Canvas & canvas, const ui::LayoutContext & layout, int16_t cx, int16_t cy, int16_t edge)

Draw the big Kleidos welcome mark (lock and keyhole) centered at (cx, cy), edge pixels across.

Color boards blit the anti-aliased asset at native size; boards without it draw the primitive key mark.

Parameters
NameDirectionMeaning
canvasin, outDrawing surface.
layoutinResponsive context.
cxinCenter x.
cyinCenter y.
edgeinMark size in pixels.

epaperControlRows() #

EpaperControlLayout kleidos::states::onb::epaperControlRows(int16_t left, int16_t top, int16_t bottom, int16_t rowH)
constexpr

Lay the controls page's five rows between top and bottom.

The rows share one pitch and are centered in the band, so the ladder reads as one block rather than as text that happens to be stacked. A band too short for five rows of rowH reports fits false instead of overlapping them: the page would rather be caught by a test than crush its own lines.

Parameters
NameDirectionMeaning
leftinLeft edge of the page's content.
topinFirst pixel the rows may use.
bottominFirst pixel they may not (the action bar's top).
rowHinHeight of one row's text.
Returns
The ladder.

epaperKeyLocator() #

EpaperLocator kleidos::states::onb::epaperKeyLocator(EpaperKeyMark mark, int16_t w, int16_t h)
constexpr

Where to point for mark on a w by h panel.

Warning
The key positions are read from the CoreInk's documented button table, not measured against a unit. They are close enough to read as "this edge, about here" and are worth re-checking on glass.
Parameters
NameDirectionMeaning
markinWhich key.
winPanel width.
hinPanel height.
Returns
Where its arrow goes.

flowFor() #

Flow kleidos::states::onb::flowFor(const ui::DeviceProfile & profile, bool hasClock)
constexpr

The flow a board with profile plays.

Parameters
NameDirectionMeaning
profileinThe board's UI profile.
hasClockinWhether the board has a clock chip that keeps the time while it is off.
Returns
Its flow.

gestureColumnRoom() #

int16_t kleidos::states::onb::gestureColumnRoom(const ui::LayoutContext & layout)
inline

Width a gesture's line may take in its third of the panel.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
A third of the panel's width less a small gap, so two neighboring lines never touch and the last never meets the glass's edge.

gestureUseFont() #

hal::display::Font kleidos::states::onb::gestureUseFont(ui::Canvas & canvas, const ui::LayoutContext & layout)
inline

The one role the three gesture uses are drawn in.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
layoutinResponsive context.
Returns
Body where every use fits gestureColumnRoom in the current language, small as soon as one would not ("cambiar pestaña" is wider than a third of a Core board at body size).

includesPage() #

bool kleidos::states::onb::includesPage(Flow flow, Page page)
constexpr

Whether flow plays page at all.

Parameters
NameDirectionMeaning
flowinThe board's flow.
pageinThe page in question.
Returns
Whether it is in that flow's order.

lineFont() #

hal::display::Font kleidos::states::onb::lineFont(ui::Canvas & canvas, const ui::LayoutContext & layout, const char * text)
inline

The role a one-line message is drawn in.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
layoutinResponsive context.
textinThe line.
Returns
Body where text fits lineRoom, small where it would not.

lineRoom() #

int16_t kleidos::states::onb::lineRoom(const ui::LayoutContext & layout)
inline

Width a one-line message of a setup page may take.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The panel's width less a medium gap on each side.

nextPage() #

Page kleidos::states::onb::nextPage(Flow flow, Page page)
constexpr

The page after page in flow, wrapping from the last to the first.

Wrapping is what the skip command needs: skipping past the end returns to the welcome page rather than leaving setup.

Parameters
NameDirectionMeaning
flowinThe board's flow.
pageinThe page on screen; one outside the flow gives its first.
Returns
The next page.

onbLayout() #

ui::LayoutContext kleidos::states::onboarding::onbLayout()

Build the per-screen responsive context once (insets / fonts / spacing scaled to the active board) so every component lays itself out correctly across every board without reading display::width() directly. Defined in onboarding_state.cpp.

Returns
The layout context of the active display.

pageOwnsRadio() #

bool kleidos::states::onb::pageOwnsRadio(Page page)
constexpr

Whether page holds the Bluetooth radio while it is on screen.

Only the pairing page brings the radio up, so only the pairing page owns it. The page that owns it stops it when it is left, which is what keeps the pairing window and any link it admitted inside setup.

Parameters
NameDirectionMeaning
pageinA page of the catalog.
Returns
Whether it owns the radio.

pagesFor() #

const PageList & kleidos::states::onb::pagesFor(Flow flow)
constexpr

The pages flow plays, in order.

Parameters
NameDirectionMeaning
flowinThe board's flow.
Returns
Its page list (the Buttons list for a value outside the table).

progressStep() #

uint8_t kleidos::states::onb::progressStep(Flow flow, Page page)
inline

The 1-based step page shows in flow's progress bar.

The button and touch flows number the eight canonical steps. The dial's flow is shorter than the catalog, so it numbers only the pages that carry a bar — a "3 of 8" on a board that never plays pages 6 and 7 would be a lie about how much is left.

Parameters
NameDirectionMeaning
flowinThe board's flow.
pageinThe page on screen.
Returns
Its step, or 0 for a page that carries no bar.

progressSteps() #

uint8_t kleidos::states::onb::progressSteps(Flow flow)
constexpr

The denominator of flow's progress bar.

Parameters
NameDirectionMeaning
flowinThe board's flow.
Returns
How many steps it counts.

skipKeyPressed() #

bool kleidos::states::onboarding::skipKeyPressed(AppContext & ctx)

The skip key of a setup page: the dedicated back key where the board has one (and only it: OK never skips there), a B hold on two buttons (a B tap moves, as in every list), a B tap on the boards with a C.

The skip key of a setup page: the dedicated back key where the board has one (and only it: OK never skips there), a B hold on two buttons (a B tap moves, as in every list), a B tap on the boards with a C. Defined in onboarding_state.cpp.

Parameters
NameMeaning
ctxThe application context whose inputs are read.
Returns
Whether the skip key was pressed this tick.

skipRects() #

SkipRects kleidos::states::onb::skipRects(const ui::LayoutContext & layout)

Where the header's Skip button goes on this board.

Parameters
NameDirectionMeaning
layoutinResponsive context.
Returns
The button and its hit box; both empty unless the board draws its own touch controls.

stepOf() #

OnboardingStep kleidos::states::onb::stepOf(Page page)
constexpr

The canonical step page belongs to.

Parameters
NameDirectionMeaning
pageinA page of the catalog.
Returns
Its step, one of the eight the progress bar counts.

stopRadioOnPageChange() #

bool kleidos::states::onb::stopRadioOnPageChange(bool leavingOwns, bool enteringOwns)
constexpr

Whether a page change has to stop the radio.

Parameters
NameDirectionMeaning
leavingOwnsinWhether the page being left owns the radio.
enteringOwnsinWhether the page being entered owns it.
Returns
Whether the radio must be stopped as part of the change.

tipsFont() #

hal::display::Font kleidos::states::onb::tipsFont(ui::Canvas & canvas, const ui::LayoutContext & layout, std::span< const i18n::StringId > tips)
inline

The one role the tips of a page are drawn in.

Parameters
NameDirectionMeaning
canvasinSurface used only to measure text.
layoutinResponsive context.
tipsinThe page's tips, one line each.
Returns
Body where every tip fits lineRoom in the current language, small as soon as one of them would not.

tutHint() #

const char * kleidos::states::onboarding::tutHint(i18n::StringId buttons, i18n::StringId threeButtons, i18n::StringId touch, bool hasC)

A tutorial's hint: the glass words where the board draws its own touch controls, the three-button words where there is a C, else the two-button words. Defined in onboarding_state_tutorial.cpp.

Parameters
NameMeaning
buttonsThe two-button words.
threeButtonsThe three-button words.
touchThe glass words.
hasCWhether the board has a C key.
Returns
The translated hint.

A tutorial's hint: the glass words where the board draws its own touch controls, the three-button words where there is a C, else the two-button words.

tutHintBand() #

ui::Rect kleidos::states::onboarding::tutHintBand(const ui::LayoutContext & layout)

Goal-pill band above the action bar, shared by all five tutorial screens.

Goal-pill band above the action bar, shared by all five tutorial screens. Defined in onboarding_state_tutorial.cpp.

Parameters
NameMeaning
layoutThe active display layout.
Returns
The band the goal pill is drawn in.

tutHintLineY() #

int16_t kleidos::states::onboarding::tutHintLineY(ui::Canvas & canvas, const ui::LayoutContext & layout)

Y of the single hint line drawn under a tutorial title.

Y of the single hint line drawn under a tutorial title. Defined in onboarding_state_tutorial.cpp.

Parameters
NameMeaning
canvasThe canvas whose fonts are measured.
layoutThe active display layout.
Returns
The hint line's center Y.

tutorialBit() #

uint8_t kleidos::tutorialBit(TutorialPhase phase)
constexpr

The mask bit that stands for phase.

Parameters
NameDirectionMeaning
phaseinA playable phase; COMPLETE has no bit.
Returns
Its bit, or 0 for COMPLETE.

tutorialMask() #

uint8_t kleidos::states::onb::tutorialMask(Flow flow)
constexpr

The tutorials flow plays, as a tutorialBit mask.

Derived from the flow's own page table, so the sequencer can never play a tutorial the flow has no page for.

Parameters
NameDirectionMeaning
flowinThe board's flow.
Returns
The mask to reset OnboardingTutorialLogic with.

tutorialOf() #

TutorialPhase kleidos::states::onb::tutorialOf(Page page)
constexpr

The tutorial page rehearses.

Parameters
NameDirectionMeaning
pageinA page of the catalog.
Returns
Its tutorial, or TutorialPhase::COMPLETE for a page that rehearses nothing.

tutTabCount() #

uint8_t kleidos::states::onboarding::tutTabCount()

Number of cells the tutorial strip draws.

Number of cells the tabs tutorial's strip draws. Defined in onboarding_state_tutorial_tabs.cpp.

Returns
The strip's cell count.

tutWritingBarFor() #

ui::ActionBarProps kleidos::states::onboarding::tutWritingBarFor(ui::CharWheelMode mode, uint8_t holdPctB, bool twoButtons)

The writing tutorial's action bar for this board: the editor's own verbs on the dial, the button bindings elsewhere. Defined in onboarding_state_tutorial_writing.cpp.

Parameters
NameMeaning
modeThe CharWheel's region (group selector or body).
holdPctBHow far the B hold has charged, filling its rule.
twoButtonsWhether the board has two buttons (no C).
Returns
The bar's props.

Back to the top

Variable Documentation

kTouchClosingTips #

std::array<i18n::StringId, 3> kleidos::states::onb::kTouchClosingTips
inlineconstexpr

The tips the closing page shows on a board that draws its own touch controls, top to bottom: the tap grammar, the swipe, the lock.

kTouchGestureUses #

std::array<i18n::StringId, 3> kleidos::states::onb::kTouchGestureUses
inlineconstexpr

What each of the three gestures of the touch introduction does, left to right under its verb: tap to choose, swipe up or down to scroll, swipe sideways to change tab.

kTutBackHoldMs #

uint32_t kleidos::states::onboarding::kTutBackHoldMs
inlineconstexpr

BtnB hold threshold for "skip this tutorial" on the commit-driven screens (dropdown / stepper) of the three-button boards: every hold is one length.

kTutBeatMs #

uint32_t kleidos::states::onboarding::kTutBeatMs
inlineconstexpr

Pause after an auto-completed goal (arc lock / all tabs visited) before the flow advances, so the success pill is seen.

kTutStepStart #

int32_t kleidos::states::onboarding::kTutStepStart
inlineconstexpr

The value the stepper tutorial starts at, inside its practice range of 0 to 10 s; stepping away from it is the goal.

Back to the top