Display and UI¶
On the device, screens are not drawn in code. The resource archive names the classes, rows, events and destinations, and the code walks them. Chikuma builds its screens the same way, and a hand-built screen counts as a bug.
From the panel up¶
The panel¶
The real LCD pipe runs with the firmware's own configuration. That includes the panel tear-effect interrupt, which the panel raises when it is safe to hand it a new frame, and a second hardware window.
The second window lets album art sit under a hole in the main UI surface. The two layers meet in the display hardware, and software never paints the art into the UI.
Granite, the compositor¶
Above the panel sits the firmware's compositor, which has its recovered name back: Granite. It owns six layer slots and one backend, chosen by kind.
| Backend | State |
|---|---|
| LCD display pipe, six windows | reproduced |
| Hardware scaler | recovered, deliberately not reproduced, since Chikuma's scaler traffic comes straight from the video decoder |
Granite paints from its own thread, the highest-priority thread on the device. The panel tear-effect interrupt only acknowledges the panel and signals that thread, and the thread runs the pump.
A Granite layer is one display window. A layer carries its own blend and alpha state, and the frame loop re-sends it from the layer's own bytes. That makes one alpha write per frame, as on the device. The device models cover the panel and scaler hardware underneath.
Retained surfaces¶
Each region of a screen renders into its own retained surface: the menu, the status bar, the preview pane, the media list, Now Playing. They are composed the way the firmware composes them.
So a push slides a surface, and the fade family runs through a region's own alpha. The whole screen never gets redrawn frame by frame.
Moving the windows¶
On the device the display pipe does most of the moving. A screen push puts a snapshot of the leaving screen on one hardware window and the arriving screen on another, then slides both by changing their positions. A cover fades in on its own window while the pipe blends.
| Transition | Chikuma today |
|---|---|
| Screen push | done with pipe windows in the emulator, each frame's window writes compared against the original's. Not yet on the device. |
| Home preview fade | drawn by the CPU, next |
| Half-screen slides | drawn by the CPU, next |
| Cover dissolve | drawn by the CPU, about 9 ms a frame with per-frame lookup tables |
The original keeps the cover dissolve at 17 ms a frame by letting the pipe blend.
The view classes¶
The view and controller class names come from the image's own runtime type information, and so does their inheritance. Views run:
TMsgHandler -> TResponder -> TView -> TCompositeView -> TListView -> TMenuView
and controllers run:
THistoryNode -> THistoryNodeSimple -> TController -> { TCntlrBasic, TSilverCntlr }
Recovery works up the chain. A subclass is understood starting from its base, so the work follows the hierarchy. For each class, recovery means four things:
- its place in the vtable relative to its base
- the geometry it computes: row heights, insets, how many items fit, how scrolling moves
- the resources it reads
- the events it raises, in the layout's own vocabulary
The source tree tracks every class beside the components, as recovered, a declared stand-in, or invented. The invented bucket is empty for the moment.
Text goes through FreeType, taken from upstream. Version 2.14.3 is Chikuma's choice, not the image's.
The controller stack¶
Screens live on a stack that the firmware calls its transition queue. A push starts the new controller at once. A controller leaves by flagging itself and running the pump, which pops it and reveals the one beneath.
A screen's action handler therefore often names no destination at all. It leaves, and the screen underneath is where the user lands.
The preview pane that follows the highlighted row works the same way. The screen switches to another of its own layouts, carried by a navigator verb in the archive's event bindings, and those layouts differ only in the canvases past the menu. Geometry and resources alone do not show it. The resource archive shows how the bindings are read.
What works¶
Each of these has a gate behind it:
- Home, Settings and Music
- the media lists, drilling Artists into Albums into Songs into Now Playing, with the aggregate "All Songs" and "All Albums" rows, and the browse scope kept on the model as the device keeps it
- Cover Flow, drawn on the CPU through the software OpenGL ES stack
- the Genius path end to end
- Playlists, Videos and Podcasts
- Photos, with its browser and slideshow
- the Extras apps: World Clock, Calendars, Alarms, Sleep Timer, Stopwatch, Notes, Games
- the disk-mode screen
- localization in all twenty shipped languages
- the status bar and battery, built from their own records
A crawl of the real iPod's menus to depth three opens every branch of the main menu.
Chikuma's own screens, as data¶
Settings > Display, with Appearance and Night Shift, is Chikuma's and not Apple's. It gets added the way the firmware would have added it: as records in the archive, with labels in all twenty languages, built by the same code as every other screen.
The dark skin is data too, a section of dark twins for the archive's colours and pictures. It takes Apple's own black variant wherever the firmware ships one. Night Shift itself is a table in the display pipe, and the views know nothing of it.
Screens not built yet¶
Contacts is not served yet. Compilations waits on its own scope over the Albums screen, and Audiobooks on a media-kind mask not yet read.
Smaller gaps remain too. The fast-scroll letter overlay is not built, Photos' slideshow transitions are not drawn, and a few of the built Extras screens have stand-in depths. The transitions above still need their window half. Status is the live account.