Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import Testing
@testable import ParcelAnimation
let testScreen = MotionRect(originX: 0, originY: 0, width: 1920, height: 1080)let testWindow = MotionWindowID(rawValue: 1)let testApp = MotionAppID(rawValue: 1)
func rect(_ horizontal: Double = 10, _ vertical: Double = 20, _ width: Double = 200, _ height: Double = 100) -> MotionRect{ MotionRect(originX: horizontal, originY: vertical, width: width, height: height)}
func request( window: UInt64 = 1, app: Int32 = 1, start: MotionRect = rect(), target: MotionRect = rect(500, 300, 400, 200), screen: MotionRect = testScreen, minimum: MotionSize = .zero, surface: MotionSurface = .window, token: MotionToken = .settle, index: Int = 0, velocity: MotionVelocity = .zero, startOpacity: Double = 1, targetOpacity: Double = 1, metrics: AppWriteMetrics = AppWriteMetrics(), generation: UInt64 = 0) -> MotionRequest { MotionRequest( windowID: MotionWindowID(rawValue: window), appID: MotionAppID(rawValue: app), start: start, target: target, screen: screen, minimumSize: minimum, surface: surface, token: token, staggerIndex: index, velocity: velocity, startOpacity: startOpacity, targetOpacity: targetOpacity, metrics: metrics, generation: generation )}
func near(_ lhs: Double, _ rhs: Double, tolerance: Double = 1e-8) -> Bool { abs(lhs - rhs) <= tolerance }
func frame( window: UInt64 = 1, app: Int32 = 1, at timestamp: Double = 0, revision: UInt64 = 1, origin: Double = 0, final: Bool = false, generation: UInt64 = 0) -> MotionFrame { MotionFrame( windowID: MotionWindowID(rawValue: window), appID: MotionAppID(rawValue: app), generation: generation, rect: rect(origin), opacity: 1, scale: 1, offsetHorizontal: 0, offsetVertical: 0, timestamp: timestamp, revision: revision, isFinal: final )}
func measured(_ duration: Double, timeout: Bool = false, at timestamp: Double = 0) throws -> AppWriteMetrics { var metrics = AppWriteMetrics() try metrics.record(duration: duration, timedOut: timeout, at: timestamp) return metrics}