Skip to content

Reference

The public API, one page per module. Each page lists what the module holds, the types it exports and the calls you are expected to make; the headers themselves carry the finer detail and the reasoning.

ModuleIncludeHolds
coregbui/core/*.hppgeometry, lengths, colour, cursors, JSON, vector paths
a11ygbui/a11y/*.hpproles, names, states, relations, and the tree they are read into
stylegbui/style/*.hppstyle properties, themes and tokens, the design system
scenegbui/scene/*.hppthe node arena and the building API
layoutgbui/layout/*.hppflexbox, measurement, wrapping, hit testing
inputgbui/input/*.hpphover, press, focus, keys, text editing
animgbui/anim/*.hppthe animation clock and its curves
overlaygbui/overlay/*.hppwhere a floating box goes
paintgbui/paint/*.hppdisplay list, painters, the software rasteriser
widgetsgbui/widgets/*.hppcomponents and icons
chartsgbui/widgets/chart.hppscales, series, and nine kinds of chart
platformgbui/platform/*.hppwindow, event loop, fonts, image decoding, opening a URL

A module may depend on the ones above it and never on the ones below, with the two documented exceptions in Architecture → Modules.

Conventions across the API

  • Failure is std::optional, with an error string where the reason matters. Nothing throws, and nothing in the public API is noexcept by accident.
  • Options are structs, so call sites name what they set and defaults stay invisible. Designated initialisers must be written in declaration order.
  • kAuto is a NaN meaning "decide for me". Test it with isAuto(value).
  • Sizes are a Length, which converts implicitly from float: a plain number is pixels, Length::percent(25) is a share.
  • Colours come from Token, resolved against the active Theme.
  • Coordinates are logical pixels, with the origin at the top left. The display scale is applied once, in DisplayList::setScale.
  • State belongs to the application. A component takes the value and returns what the user did to it; nothing here remembers anything between frames except Interaction and Animator, both of which the application owns.
  • Identity is a string tag, never a NodeId: the tree is rebuilt every frame and only the tag survives it.

Released under the LGPL-3.0-or-later licence.