| R1 · Present |
A native window is a destination; CPU pixels are storage we own. Server depth, storage bytes, and RGB channel order are distinct. |
Read three known RGB values from a small owned buffer and inspect their bytes; demonstrate that packing unequal red and blue is observable. Show the server format query before any native upload. |
| R2 · Resize |
A dimensions change invalidates views into the old storage. Expose is a request to show content again, not necessarily permission to change the model. |
Replay two sizes and two expose requests using a small buffer owner and a fake uploader; print allocation count and upload sizes. |
| R3 · Clip a rectangle |
Row-major memory, stride versus width, half-open edges, and clipping before access. |
Change one pixel in a padded 3 × 2 buffer, print the rows including padding, then inspect an intersecting pair of 1D intervals. Combine those in the exercise, not in the example. |
| R4 · Order paints |
A recorded paint command is data, not a pixel write; order and inherited clip matter. |
Replay two writes to one color cell, reverse them, and see which wins. Trace a parent clip and one child clip before handling nested scenes. |
| L1 · Measure and place |
Desired size, permitted size, and final origin are separate values. |
Clamp the requested length of a single strip with two available lengths; print local width and a separate placement offset. |
| L2 · Compose layout |
Local coordinates become window coordinates once; padding/gap use space and clipping does not redistribute it. |
A three-node outline prints compounded origins; observe the double-offset bug by changing the child origin independently. |
| I1 · Hit a target |
Hit testing reuses resolved geometry, not source coordinates; visual order determines overlap precedence. |
Query one resolved rectangle at its left edge and its excluded right edge; vary the effective clip. Do not provide a scene hit-test implementation. |
| I2 · Route pointer actions |
OS activation is not element focus. A down/up sequence is distinct from a click and can be cancelled. |
Replay a press, leave/cancel, and release through a toy state machine, printing transitions; show the raw XCB event lifetime separately. |
| S1 · Preserve app state |
Rendering a fresh element description must not reset the application’s data. |
Rebuild disposable rows from a persistent star-rating value and show the same value appearing in successive descriptions. Use geometry/color to observe output; text has not been taught yet. |
| S2 · Coalesce redraw |
Updating, rebuilding, and presenting are separate; a dirty flag keeps work pending without recursively drawing. |
Feed a fake clock-free batch of invalidations into a counter of rebuilds and presents and compare two updates in one turn with two distinct turns. |
| I3 · Move focus |
Stable identity is not a node address; tab order is defined by the current eligible controls. |
Reorder and replace a list of named items, then compare recovering one selection by value versus position. |
| I4 · Activate by key |
X11 keycodes, key symbols, modifiers, and semantic actions are separate. |
Print one keycode, its resolved symbol, and shifted symbol on an isolated test window. Use keymap probes before asking for a full fallback or repeat handling. |
| T1 · Measure text |
A character is not a bitmap; an advance moves the pen and a space can do so without ink. |
Load one face, compare the blank space glyph’s advance and visible bounds with a printed letter, and repeat at another size. |
| T2 · Paint text |
Glyph-slot data is borrowed until the next load; baseline, bearings, and coverage are different quantities. |
Blend three synthetic coverage values over one background and print results. Follow with a one-glyph measurement, not a complete text painter. |
| A1 · Integrate an app |
The application declares elements and handles actions; the framework owns the platform, layout, and pixels. |
A miniature, non-counter consumer shows the calls through the public boundary. Trace the first frame and one action before asking for the full counter. |
| A2 · Reuse the API |
Linking a second consumer is evidence only if neither the framework nor the first app must change. |
Link two tiny programs to one small library target with separate models, then apply that structure to the second UI app. |