Documentation
¶
Overview ¶
Package apple loads the CoreFoundation, CoreMedia, CoreVideo, and VideoToolbox entry points Planck needs through purego, with no cgo.
Index ¶
- Constants
- Variables
- func Bool(v bool) uintptr
- func Const(lib uintptr, name string) uintptr
- func Dict(kv ...uintptr) uintptr
- func Float(v float64) uintptr
- func HasSym(lib uintptr, name string) bool
- func Int(v int64) uintptr
- func Nanos(ticks uint64) int64
- func Now() int64
- func NumberInt64(n uintptr) (int64, bool)
- func Register(fptr any, lib uintptr, name string)
- func RunWithAnimator(x, y, size float64, work func())
- func SetThreadQoS(class uint32) error
- func String(s string) uintptr
- func Sym(lib uintptr, name string) uintptr
- type CMTime
Constants ¶
const QoSUserInteractive = 0x21
QoSUserInteractive is QOS_CLASS_USER_INTERACTIVE of <sys/qos.h>.
Variables ¶
var ( System = open("/usr/lib/libSystem.B.dylib") CoreFoundation = open("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation") CoreMedia = open("/System/Library/Frameworks/CoreMedia.framework/CoreMedia") CoreVideo = open("/System/Library/Frameworks/CoreVideo.framework/CoreVideo") VideoToolbox = open("/System/Library/Frameworks/VideoToolbox.framework/VideoToolbox") IOSurface = open("/System/Library/Frameworks/IOSurface.framework/IOSurface") CoreGraphics = open("/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics") )
var ( CFRelease func(uintptr) CFRetain func(uintptr) uintptr CFStringCreateWithCString func(alloc uintptr, s string, enc uint32) uintptr CFNumberCreate func(alloc uintptr, typ int, v unsafe.Pointer) uintptr CFNumberGetValue func(n uintptr, typ int, v unsafe.Pointer) bool CFDictionaryCreateMutable func(alloc uintptr, cap int, keyCB, valueCB uintptr) uintptr CFDictionarySetValue func(d, k, v uintptr) CFDictionaryGetValue func(d, k uintptr) uintptr CFArrayGetCount func(a uintptr) int CFArrayGetValueAtIndex func(a uintptr, i int) uintptr CFGetRetainCount func(uintptr) int MachAbsoluteTime func() uint64 KCFBooleanTrue uintptr KCFBooleanFalse uintptr )
Functions ¶
func Dict ¶
Dict builds a CFMutableDictionary from alternating keys and values. Values passed here are retained by the dictionary; the caller keeps its own refs.
func RunWithAnimator ¶
func RunWithAnimator(x, y, size float64, work func())
RunWithAnimator runs work on a goroutine while the main thread drives a small borderless window that changes color on every timer tick, so screen capture sees motion. The app uses the accessory activation policy: no Dock icon, no focus change, mouse events pass through. It must be called on the main thread and returns after work does.
func SetThreadQoS ¶
SetThreadQoS sets the calling OS thread's quality of service class, so the scheduler keeps it on the performance cores under load. The caller must hold runtime.LockOSThread for as long as the class should last.