Search guides and the APICtrl K
  1. API reference
  2. Native GUI

gfx/window_uikit.h

The UIKit window, so the native UI runs on an iPhone and an iPad -- in a plugin's standalone app, and in an AUv3's editor inside GarageBand, AUM or Logic Pro for iPad.

#include <sonore/gfx/window_uikit.h>
On this page

Design notes

A UIView, registered at runtime

As on the Mac (window_cocoa.h): no Objective-C source anywhere, so the view is a UIView subclass registered with the runtime, its methods C functions. It draws by being given an IMAGE: each frame that changed, the rasteriser's bitmap -- R G B A premultiplied, which is CoreGraphics' kCGImageAlpha- PremultipliedLast, so nothing is converted -- becomes a CGImage and the view's layer's contents. Core Animation scales nothing: the image is made at the screen's own scale (2 or 3 device pixels to a point).

Touch

touchesBegan/Moved/Ended/Cancelled arrive with a set of UITouch objects. The first finger of a gesture is the PRIMARY pointer and goes through the router as the mouse does; the others are touches of their own (MouseInputSources), each keeping its slot for as long as it is down. The Apple Pencil is a pen with pressure; a trackpad's or mouse's pointer on an iPad is a mouse.

The clock and the popups

A CADisplayLink calls the view once a frame -- the screen's own refresh, 60 or 120 Hz -- which is the editor's tick. A menu or tooltip is a second view over the window, inside a transparent SHIELD the size of the window: a touch on the shield and not on the menu dismisses a menu that grabs the pointer, as a click outside one does on a desktop.

What it does not do yet

The software keyboard: a text field takes a hardware keyboard's keys through the router, but nothing here asks iOS to show its own. VoiceOver: the Mac's accessibility bridge is AppKit's, and UIKit's is not written.

Types 2

The few CoreGraphics calls that turn pixels into an image. Linked by UIKit into every app; found by name, as the Mac's are.

The native window peer on iOS: a UIView the editor draws into. The same surface as the other peers (native_editor.h).

Functions 6

Constants 1

↑↓ to move↵ to openEvery public name in the headers, and every guide