Overview
isolen ui is the element api, layout engine and draw layer behind the isolen presentation engine. An app declares a tree of boxes each frame. The solver sizes it and a backend neutral gfx device paints it.
The layers
Each layer is its own header, and a lower layer never includes a higher one. You can stop at whichever level your code needs.
| Header | What it owns |
|---|---|
isolenui/app/app.h | The window, the device, the ui context and the frame loop, at three levels of control. |
isolenui/ui/ui.h | The element api in namespace ui: boxes, styles, input, focus, portals and interaction. |
isolenui/kit/*.h | The component kit, one header per group and one file per component. Apps include isolenui/kit/kit.h. |
isolenui/ui/layout2.h | The flexbox and grid solver underneath every box, usable on its own. |
isolenui/text/text_font.h | Atlas metrics, measuring, wrapping, elision and glyph emission. |
isolenui/gfx/gfx_list.h | The draw list every frame is recorded into, in logical units. |
isolenui/gfx/gfx.h | The device, backend selection, live switching, frames and assets. |
isolenui/gfx/gfx_vulkan.h, isolenui/gfx/gfx_metal.h, isolenui/gfx/gfx_cpu.h | Level two typed handles for native passes over the tree. |
A frame
Every frame follows the same path. ui::begin takes the input. Your code opens and closes boxes and calls widgets, and each one reads last frame's geometry to answer questions like "was I clicked". Then ui::end solves the tree, applies scrolling and records everything into a gfx_list, which the device draws. The app shell does all of this for you and only calls your view.
ui::view() body that takes the rest of the window. With chrome off, the root is itself the view. Your view callback always declares into the box that scrolls.Nothing runs when nothing changes. The shell only produces a frame for input, a resize, an animation that is still easing, or an explicit isolen_redraw. An idle app submits no work at all, which lets the driver hand its memory back. The app shell covers how to ask for more frames.