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>- 2types
- 7other declarations
- Guides: The native editor
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
- fn
template <typename Ret, typename... Args> inline Ret send(id target, const char* selector, Args... args)gfx::uikit::send · window_uikit.h:69 - fn
template <typename Ret, typename... Args> inline Ret sendRect(id target, const char* selector, Args... args)A message answering a struct over 16 bytes (a CGRect): through the hidden pointer on x86_64 (an Intel Mac's simulator), plainly on arm64.gfx::uikit::sendRect · window_uikit.h:77 - fn
inline id cls(const char* name)gfx::uikit::cls · window_uikit.h:86 - fn
inline const CoreGraphicsApi& coreGraphics()gfx::uikit::coreGraphics · window_uikit.h:107 - fn
inline double screenScale()gfx::uikit::screenScale · window_uikit.h:132 - fn
inline void uniqueName(const char* base, void* inThisImage, char* out, size_t cap)A runtime class name unique to this binary, as every Apple file here makes them: two plugins in one process must not share one.gfx::uikit::uniqueName · window_uikit.h:140
Constants 1
- const
constexpr uint32_t kAlphaPremultipliedLast = 1ukCGImageAlphaPremultipliedLast with the default byte order: the rasteriser's own layout.gfx::uikit::kAlphaPremultipliedLast · window_uikit.h:130