From 6793812a5363bbec8462b08535100bb8e11f3ef7 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 11 Nov 2024 09:37:36 +1100 Subject: [PATCH] [ffigen] Use package:dart_style (#1676) --- pkgs/ffigen/CHANGELOG.md | 2 + .../objective_c/avf_audio_bindings.dart | 12433 +--------------- .../objective_c/avf_audio_bindings.dart.m | 49 - .../example/swift/swift_api_bindings.dart | 11389 +------------- .../example/swift/swift_api_bindings.dart.m | 49 - .../lib/src/code_generator/library.dart | 23 +- pkgs/ffigen/pubspec.yaml | 3 +- pkgs/objective_c/pubspec.yaml | 2 +- 8 files changed, 533 insertions(+), 23417 deletions(-) delete mode 100644 pkgs/ffigen/example/objective_c/avf_audio_bindings.dart.m delete mode 100644 pkgs/ffigen/example/swift/swift_api_bindings.dart.m diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1c16ed2fe..77aa32042 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,6 +1,8 @@ ## 16.0.0-wip - Ensure all protocols referenced in bindings are available at runtime. +- Use `package:dart_style` directly to format generated Dart code, rather than + subprocessing to `dart format`. - Use package:objective_c 4.0.0 - Fix various small bugs todo with config filters: - https://github.com/dart-lang/native/issues/1582 diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index 47e690c3b..1949f0b09 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -11,11174 +11,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _AVFAudio_wrapListenerBlock_ksby9f( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _AVFAudio_wrapListenerBlock_l9klhe( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _AVFAudio_wrapListenerBlock_ukcdfq( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _AVFAudio_wrapListenerBlock_1tjlcwl( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _AVFAudio_wrapListenerBlock_sjfpmz( - ffi.Pointer block, -); - -final class CGPoint extends ffi.Struct { - @ffi.Double() - external double x; - - @ffi.Double() - external double y; -} - -final class CGSize extends ffi.Struct { - @ffi.Double() - external double width; - - @ffi.Double() - external double height; -} - -final class CGRect extends ffi.Struct { - external CGPoint origin; - - external CGSize size; -} - -final class __CFRunLoop extends ffi.Opaque {} - -void _ObjCBlock_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, -) => - block.ref.target - .cast>() - .asFunction()(); -ffi.Pointer _ObjCBlock_ffiVoid_fnPtrCallable = ffi.Pointer - .fromFunction)>( - _ObjCBlock_ffiVoid_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_closureTrampoline( - ffi.Pointer block, -) => - (objc.getBlockClosure(block) as void Function())(); -ffi.Pointer _ObjCBlock_ffiVoid_closureCallable = ffi.Pointer - .fromFunction)>( - _ObjCBlock_ffiVoid_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_listenerTrampoline( - ffi.Pointer block, -) { - (objc.getBlockClosure(block) as void Function())(); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable)> - _ObjCBlock_ffiVoid_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer> ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction(void Function() fn) => - objc.ObjCBlock( - objc.newClosureBlock(_ObjCBlock_ffiVoid_closureCallable, () => fn()), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener(void Function() fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_listenerCallable.nativeFunction.cast(), () => fn()); - final wrapper = _AVFAudio_wrapListenerBlock_ksby9f(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_CallExtension - on objc.ObjCBlock { - void call() => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block)>>() - .asFunction)>()( - ref.pointer, - ); -} - -final class _NSZone extends ffi.Opaque {} - -int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline, - 0) - .cast(); -int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as int Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline, - 0) - .cast(); - -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Long Function( - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => - objc.ObjCBlock< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>( - objc.newPointerBlock( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> - fromFunction(objc.NSComparisonResult Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => - objc.ObjCBlock, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true)) - .value), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_CallExtension - on objc.ObjCBlock< - ffi.Long Function( - ffi.Pointer, ffi.Pointer)> { - objc.NSComparisonResult call( - objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => - objc.NSComparisonResult.fromValue(ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer)); -} - -enum NSQualityOfService { - NSQualityOfServiceUserInteractive(33), - NSQualityOfServiceUserInitiated(25), - NSQualityOfServiceUtility(17), - NSQualityOfServiceBackground(9), - NSQualityOfServiceDefault(-1); - - final int value; - const NSQualityOfService(this.value); - - static NSQualityOfService fromValue(int value) => switch (value) { - 33 => NSQualityOfServiceUserInteractive, - 25 => NSQualityOfServiceUserInitiated, - 17 => NSQualityOfServiceUtility, - 9 => NSQualityOfServiceBackground, - -1 => NSQualityOfServiceDefault, - _ => - throw ArgumentError("Unknown value for NSQualityOfService: $value"), - }; -} - -enum NSCollectionChangeType { - NSCollectionChangeInsert(0), - NSCollectionChangeRemove(1); - - final int value; - const NSCollectionChangeType(this.value); - - static NSCollectionChangeType fromValue(int value) => switch (value) { - 0 => NSCollectionChangeInsert, - 1 => NSCollectionChangeRemove, - _ => throw ArgumentError( - "Unknown value for NSCollectionChangeType: $value"), - }; -} - -late final _class_NSOrderedCollectionChange = - objc.getClass("NSOrderedCollectionChange"); -late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); -final _objc_msgSend_l8lotg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_changeWithObject_type_index_ = - objc.registerName("changeWithObject:type:index:"); -final _objc_msgSend_klnnzp = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int)>(); -late final _sel_changeWithObject_type_index_associatedIndex_ = - objc.registerName("changeWithObject:type:index:associatedIndex:"); -final _objc_msgSend_fg75bt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.UnsignedLong, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int)>(); -late final _sel_object = objc.registerName("object"); -final _objc_msgSend_1unuoxw = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_changeType = objc.registerName("changeType"); -final _objc_msgSend_1ocvcq4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_index = objc.registerName("index"); -final _objc_msgSend_eldhrq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_associatedIndex = objc.registerName("associatedIndex"); -typedef instancetype = ffi.Pointer; -typedef Dartinstancetype = objc.ObjCObjectBase; -late final _sel_init = objc.registerName("init"); -late final _sel_initWithObject_type_index_ = - objc.registerName("initWithObject:type:index:"); -late final _sel_initWithObject_type_index_associatedIndex_ = - objc.registerName("initWithObject:type:index:associatedIndex:"); -late final _sel_new = objc.registerName("new"); -late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); -final _objc_msgSend_1b3ihd0 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); -late final _sel_alloc = objc.registerName("alloc"); -late final _sel_cancelPreviousPerformRequestsWithTarget_selector_object_ = objc - .registerName("cancelPreviousPerformRequestsWithTarget:selector:object:"); -final _objc_msgSend_1587kfn = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_cancelPreviousPerformRequestsWithTarget_ = - objc.registerName("cancelPreviousPerformRequestsWithTarget:"); -final _objc_msgSend_ukcdfq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_accessInstanceVariablesDirectly = - objc.registerName("accessInstanceVariablesDirectly"); -final _objc_msgSend_olxnu1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_useStoredAccessor = objc.registerName("useStoredAccessor"); -late final _sel_keyPathsForValuesAffectingValueForKey_ = - objc.registerName("keyPathsForValuesAffectingValueForKey:"); -final _objc_msgSend_juohf7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_automaticallyNotifiesObserversForKey_ = - objc.registerName("automaticallyNotifiesObserversForKey:"); -late final _sel_setKeys_triggerChangeNotificationsForDependentKey_ = - objc.registerName("setKeys:triggerChangeNotificationsForDependentKey:"); -final _objc_msgSend_1tjlcwl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_classFallbacksForKeyedArchiver = - objc.registerName("classFallbacksForKeyedArchiver"); -late final _sel_classForKeyedUnarchiver = - objc.registerName("classForKeyedUnarchiver"); - -/// NSOrderedCollectionChange -class NSOrderedCollectionChange extends objc.NSObject { - NSOrderedCollectionChange._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSOrderedCollectionChange] that points to the same underlying object as [other]. - NSOrderedCollectionChange.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSOrderedCollectionChange] that wraps the given raw object pointer. - NSOrderedCollectionChange.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSOrderedCollectionChange]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSOrderedCollectionChange); - } - - /// changeWithObject:type:index: - static NSOrderedCollectionChange changeWithObject_type_index_( - objc.ObjCObjectBase anObject, NSCollectionChangeType type, int index) { - final _ret = _objc_msgSend_klnnzp( - _class_NSOrderedCollectionChange, - _sel_changeWithObject_type_index_, - anObject.ref.pointer, - type.value, - index); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: true, release: true); - } - - /// changeWithObject:type:index:associatedIndex: - static NSOrderedCollectionChange changeWithObject_type_index_associatedIndex_( - objc.ObjCObjectBase anObject, - NSCollectionChangeType type, - int index, - int associatedIndex) { - final _ret = _objc_msgSend_fg75bt( - _class_NSOrderedCollectionChange, - _sel_changeWithObject_type_index_associatedIndex_, - anObject.ref.pointer, - type.value, - index, - associatedIndex); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: true, release: true); - } - - /// object - objc.ObjCObjectBase get object { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_object); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// changeType - NSCollectionChangeType get changeType { - final _ret = _objc_msgSend_1ocvcq4(this.ref.pointer, _sel_changeType); - return NSCollectionChangeType.fromValue(_ret); - } - - /// index - int get index { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_index); - } - - /// associatedIndex - int get associatedIndex { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_associatedIndex); - } - - /// init - NSOrderedCollectionChange init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithObject:type:index: - NSOrderedCollectionChange initWithObject_type_index_( - objc.ObjCObjectBase anObject, NSCollectionChangeType type, int index) { - final _ret = _objc_msgSend_klnnzp( - this.ref.retainAndReturnPointer(), - _sel_initWithObject_type_index_, - anObject.ref.pointer, - type.value, - index); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithObject:type:index:associatedIndex: - NSOrderedCollectionChange initWithObject_type_index_associatedIndex_( - objc.ObjCObjectBase anObject, - NSCollectionChangeType type, - int index, - int associatedIndex) { - final _ret = _objc_msgSend_fg75bt( - this.ref.retainAndReturnPointer(), - _sel_initWithObject_type_index_associatedIndex_, - anObject.ref.pointer, - type.value, - index, - associatedIndex); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSOrderedCollectionChange new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSOrderedCollectionChange, _sel_new); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSOrderedCollectionChange allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSOrderedCollectionChange, _sel_allocWithZone_, zone); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSOrderedCollectionChange alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSOrderedCollectionChange, _sel_alloc); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSOrderedCollectionChange, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSOrderedCollectionChange, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSOrderedCollectionChange, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSOrderedCollectionChange, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSOrderedCollectionChange, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSOrderedCollectionChange, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSOrderedCollectionChange, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSOrderedCollectionChange, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSOrderedCollectionChange, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSProgress = objc.getClass("NSProgress"); -late final _sel_currentProgress = objc.registerName("currentProgress"); -late final _sel_progressWithTotalUnitCount_ = - objc.registerName("progressWithTotalUnitCount:"); -final _objc_msgSend_n9eq1n = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_discreteProgressWithTotalUnitCount_ = - objc.registerName("discreteProgressWithTotalUnitCount:"); -late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_ = - objc.registerName("progressWithTotalUnitCount:parent:pendingUnitCount:"); -final _objc_msgSend_105mybv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ffi.Int64)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int)>(); -late final _sel_initWithParent_userInfo_ = - objc.registerName("initWithParent:userInfo:"); -final _objc_msgSend_iq11qg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_becomeCurrentWithPendingUnitCount_ = - objc.registerName("becomeCurrentWithPendingUnitCount:"); -final _objc_msgSend_rrr3q = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_ = - objc.registerName("performAsCurrentWithPendingUnitCount:usingBlock:"); -final _objc_msgSend_19q84do = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_resignCurrent = objc.registerName("resignCurrent"); -final _objc_msgSend_ksby9f = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_addChild_withPendingUnitCount_ = - objc.registerName("addChild:withPendingUnitCount:"); -final _objc_msgSend_2citz1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_totalUnitCount = objc.registerName("totalUnitCount"); -final _objc_msgSend_1voti03 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Int64 Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setTotalUnitCount_ = objc.registerName("setTotalUnitCount:"); -late final _sel_completedUnitCount = objc.registerName("completedUnitCount"); -late final _sel_setCompletedUnitCount_ = - objc.registerName("setCompletedUnitCount:"); -late final _sel_localizedDescription = - objc.registerName("localizedDescription"); -late final _sel_setLocalizedDescription_ = - objc.registerName("setLocalizedDescription:"); -late final _sel_localizedAdditionalDescription = - objc.registerName("localizedAdditionalDescription"); -late final _sel_setLocalizedAdditionalDescription_ = - objc.registerName("setLocalizedAdditionalDescription:"); -late final _sel_isCancellable = objc.registerName("isCancellable"); -late final _sel_setCancellable_ = objc.registerName("setCancellable:"); -final _objc_msgSend_117qins = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, bool)>(); -late final _sel_isPausable = objc.registerName("isPausable"); -late final _sel_setPausable_ = objc.registerName("setPausable:"); -late final _sel_isCancelled = objc.registerName("isCancelled"); -late final _sel_isPaused = objc.registerName("isPaused"); -late final _sel_cancellationHandler = objc.registerName("cancellationHandler"); -final _objc_msgSend_2osec1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setCancellationHandler_ = - objc.registerName("setCancellationHandler:"); -void _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSUInteger_bool_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function(int, ffi.Pointer))( - arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSUInteger_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSUInteger_bool_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSUInteger_bool_listenerTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function(int, ffi.Pointer))( - arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSUInteger_bool_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSUInteger_bool_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_NSUInteger_bool { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.UnsignedLong, ffi.Pointer)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.UnsignedLong, ffi.Pointer)> fromFunctionPointer( - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock)> - fromFunction(void Function(int, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Void Function(ffi.UnsignedLong, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSUInteger_bool_closureCallable, - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1)), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc - .ObjCBlock)> - listener(void Function(int, ffi.Pointer) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSUInteger_bool_listenerCallable.nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1)); - final wrapper = _AVFAudio_wrapListenerBlock_l9klhe(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.UnsignedLong, ffi.Pointer)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_NSUInteger_bool_CallExtension on objc - .ObjCBlock)> { - void call(int arg0, ffi.Pointer arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()(ref.pointer, arg0, arg1); -} - -final _objc_msgSend_4daxhl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_pausingHandler = objc.registerName("pausingHandler"); -late final _sel_setPausingHandler_ = objc.registerName("setPausingHandler:"); -late final _sel_resumingHandler = objc.registerName("resumingHandler"); -late final _sel_setResumingHandler_ = objc.registerName("setResumingHandler:"); -late final _sel_setUserInfoObject_forKey_ = - objc.registerName("setUserInfoObject:forKey:"); -late final _sel_isIndeterminate = objc.registerName("isIndeterminate"); -late final _sel_fractionCompleted = objc.registerName("fractionCompleted"); -final _objc_msgSend_10noklm = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isFinished = objc.registerName("isFinished"); -late final _sel_cancel = objc.registerName("cancel"); -late final _sel_pause = objc.registerName("pause"); -late final _sel_resume = objc.registerName("resume"); -late final _sel_userInfo = objc.registerName("userInfo"); -late final _sel_kind = objc.registerName("kind"); -late final _sel_setKind_ = objc.registerName("setKind:"); -late final _sel_estimatedTimeRemaining = - objc.registerName("estimatedTimeRemaining"); -late final _sel_setEstimatedTimeRemaining_ = - objc.registerName("setEstimatedTimeRemaining:"); -late final _sel_throughput = objc.registerName("throughput"); -late final _sel_setThroughput_ = objc.registerName("setThroughput:"); -late final _sel_fileOperationKind = objc.registerName("fileOperationKind"); -late final _sel_setFileOperationKind_ = - objc.registerName("setFileOperationKind:"); -late final _sel_fileURL = objc.registerName("fileURL"); -late final _sel_setFileURL_ = objc.registerName("setFileURL:"); -late final _sel_fileTotalCount = objc.registerName("fileTotalCount"); -late final _sel_setFileTotalCount_ = objc.registerName("setFileTotalCount:"); -late final _sel_fileCompletedCount = objc.registerName("fileCompletedCount"); -late final _sel_setFileCompletedCount_ = - objc.registerName("setFileCompletedCount:"); -late final _sel_publish = objc.registerName("publish"); -late final _sel_unpublish = objc.registerName("unpublish"); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer - Function(ffi.Pointer))(arg0); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock Function(NSProgress)>`. -abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - objc.ObjCBlock Function(NSProgress)> castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock Function(NSProgress)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(NSProgress)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock Function(NSProgress)>( - objc.newPointerBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - objc.ObjCBlock Function(NSProgress)> fromFunction( - objc.ObjCBlock Function(NSProgress) fn) => - objc.ObjCBlock Function(NSProgress)>( - objc.newClosureBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, - (ffi.Pointer arg0) => - fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) - .ref - .retainAndAutorelease()), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock Function(NSProgress)>`. -extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension - on objc - .ObjCBlock Function(NSProgress)> { - objc.ObjCBlock call(NSProgress arg0) => - ObjCBlock_ffiVoid.castFromPointer( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer), - retain: true, - release: true); -} - -late final _sel_addSubscriberForFileURL_withPublishingHandler_ = - objc.registerName("addSubscriberForFileURL:withPublishingHandler:"); -final _objc_msgSend_1kkhn3j = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_removeSubscriber_ = objc.registerName("removeSubscriber:"); -late final _sel_isOld = objc.registerName("isOld"); - -/// NSProgress -class NSProgress extends objc.NSObject { - NSProgress._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSProgress] that points to the same underlying object as [other]. - NSProgress.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSProgress] that wraps the given raw object pointer. - NSProgress.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSProgress]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSProgress); - } - - /// currentProgress - static NSProgress? currentProgress() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_currentProgress); - return _ret.address == 0 - ? null - : NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// progressWithTotalUnitCount: - static NSProgress progressWithTotalUnitCount_(int unitCount) { - final _ret = _objc_msgSend_n9eq1n( - _class_NSProgress, _sel_progressWithTotalUnitCount_, unitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// discreteProgressWithTotalUnitCount: - static NSProgress discreteProgressWithTotalUnitCount_(int unitCount) { - final _ret = _objc_msgSend_n9eq1n( - _class_NSProgress, _sel_discreteProgressWithTotalUnitCount_, unitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// progressWithTotalUnitCount:parent:pendingUnitCount: - static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( - int unitCount, NSProgress parent, int portionOfParentTotalUnitCount) { - final _ret = _objc_msgSend_105mybv( - _class_NSProgress, - _sel_progressWithTotalUnitCount_parent_pendingUnitCount_, - unitCount, - parent.ref.pointer, - portionOfParentTotalUnitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithParent:userInfo: - NSProgress initWithParent_userInfo_( - NSProgress? parentProgressOrNil, objc.ObjCObjectBase? userInfoOrNil) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithParent_userInfo_, - parentProgressOrNil?.ref.pointer ?? ffi.nullptr, - userInfoOrNil?.ref.pointer ?? ffi.nullptr); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// becomeCurrentWithPendingUnitCount: - void becomeCurrentWithPendingUnitCount_(int unitCount) { - _objc_msgSend_rrr3q( - this.ref.pointer, _sel_becomeCurrentWithPendingUnitCount_, unitCount); - } - - /// performAsCurrentWithPendingUnitCount:usingBlock: - void performAsCurrentWithPendingUnitCount_usingBlock_( - int unitCount, objc.ObjCBlock work) { - _objc_msgSend_19q84do( - this.ref.pointer, - _sel_performAsCurrentWithPendingUnitCount_usingBlock_, - unitCount, - work.ref.pointer); - } - - /// resignCurrent - void resignCurrent() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_resignCurrent); - } - - /// addChild:withPendingUnitCount: - void addChild_withPendingUnitCount_(NSProgress child, int inUnitCount) { - _objc_msgSend_2citz1(this.ref.pointer, _sel_addChild_withPendingUnitCount_, - child.ref.pointer, inUnitCount); - } - - /// totalUnitCount - int get totalUnitCount { - return _objc_msgSend_1voti03(this.ref.pointer, _sel_totalUnitCount); - } - - /// setTotalUnitCount: - set totalUnitCount(int value) { - return _objc_msgSend_rrr3q( - this.ref.pointer, _sel_setTotalUnitCount_, value); - } - - /// completedUnitCount - int get completedUnitCount { - return _objc_msgSend_1voti03(this.ref.pointer, _sel_completedUnitCount); - } - - /// setCompletedUnitCount: - set completedUnitCount(int value) { - return _objc_msgSend_rrr3q( - this.ref.pointer, _sel_setCompletedUnitCount_, value); - } - - /// localizedDescription - objc.NSString get localizedDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_localizedDescription); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setLocalizedDescription: - set localizedDescription(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setLocalizedDescription_, value.ref.pointer); - } - - /// localizedAdditionalDescription - objc.NSString get localizedAdditionalDescription { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_localizedAdditionalDescription); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setLocalizedAdditionalDescription: - set localizedAdditionalDescription(objc.NSString value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setLocalizedAdditionalDescription_, value.ref.pointer); - } - - /// isCancellable - bool get cancellable { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancellable); - } - - /// setCancellable: - set cancellable(bool value) { - return _objc_msgSend_117qins(this.ref.pointer, _sel_setCancellable_, value); - } - - /// isPausable - bool get pausable { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPausable); - } - - /// setPausable: - set pausable(bool value) { - return _objc_msgSend_117qins(this.ref.pointer, _sel_setPausable_, value); - } - - /// isCancelled - bool get cancelled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancelled); - } - - /// isPaused - bool get paused { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPaused); - } - - /// cancellationHandler - objc.ObjCBlock? get cancellationHandler { - final _ret = - _objc_msgSend_2osec1(this.ref.pointer, _sel_cancellationHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); - } - - /// setCancellationHandler: - set cancellationHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setCancellationHandler_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// pausingHandler - objc.ObjCBlock? get pausingHandler { - final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_pausingHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); - } - - /// setPausingHandler: - set pausingHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setPausingHandler_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// resumingHandler - objc.ObjCBlock? get resumingHandler { - final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_resumingHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); - } - - /// setResumingHandler: - set resumingHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setResumingHandler_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// setUserInfoObject:forKey: - void setUserInfoObject_forKey_( - objc.ObjCObjectBase? objectOrNil, objc.NSString key) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_setUserInfoObject_forKey_, - objectOrNil?.ref.pointer ?? ffi.nullptr, key.ref.pointer); - } - - /// isIndeterminate - bool get indeterminate { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isIndeterminate); - } - - /// fractionCompleted - double get fractionCompleted { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_fractionCompleted); - } - - /// isFinished - bool get finished { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isFinished); - } - - /// cancel - void cancel() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); - } - - /// pause - void pause() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_pause); - } - - /// resume - void resume() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_resume); - } - - /// userInfo - objc.ObjCObjectBase get userInfo { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// kind - objc.NSString get kind { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_kind); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setKind: - set kind(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setKind_, value.ref.pointer); - } - - /// estimatedTimeRemaining - objc.NSNumber? get estimatedTimeRemaining { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_estimatedTimeRemaining); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setEstimatedTimeRemaining: - set estimatedTimeRemaining(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setEstimatedTimeRemaining_, value?.ref.pointer ?? ffi.nullptr); - } - - /// throughput - objc.NSNumber? get throughput { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_throughput); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setThroughput: - set throughput(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setThroughput_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// fileOperationKind - objc.NSString get fileOperationKind { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileOperationKind); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileOperationKind: - set fileOperationKind(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setFileOperationKind_, value.ref.pointer); - } - - /// fileURL - objc.NSURL? get fileURL { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileURL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileURL: - set fileURL(objc.NSURL? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setFileURL_, value?.ref.pointer ?? ffi.nullptr); - } - - /// fileTotalCount - objc.NSNumber? get fileTotalCount { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileTotalCount); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileTotalCount: - set fileTotalCount(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setFileTotalCount_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// fileCompletedCount - objc.NSNumber? get fileCompletedCount { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileCompletedCount); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileCompletedCount: - set fileCompletedCount(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setFileCompletedCount_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// publish - void publish() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_publish); - } - - /// unpublish - void unpublish() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_unpublish); - } - - /// addSubscriberForFileURL:withPublishingHandler: - static objc.ObjCObjectBase addSubscriberForFileURL_withPublishingHandler_( - objc.NSURL url, - objc.ObjCBlock Function(NSProgress)> - publishingHandler) { - final _ret = _objc_msgSend_1kkhn3j( - _class_NSProgress, - _sel_addSubscriberForFileURL_withPublishingHandler_, - url.ref.pointer, - publishingHandler.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// removeSubscriber: - static void removeSubscriber_(objc.ObjCObjectBase subscriber) { - _objc_msgSend_ukcdfq( - _class_NSProgress, _sel_removeSubscriber_, subscriber.ref.pointer); - } - - /// isOld - bool get old { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isOld); - } - - /// init - NSProgress init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSProgress new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_new); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSProgress allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSProgress, _sel_allocWithZone_, zone); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSProgress alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_alloc); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSProgress, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSProgress, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSProgress, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSProgress, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSProgress, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSProgress, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSProgress, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSProgress, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSProgress, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -enum NSDecodingFailurePolicy { - NSDecodingFailurePolicyRaiseException(0), - NSDecodingFailurePolicySetErrorAndReturn(1); - - final int value; - const NSDecodingFailurePolicy(this.value); - - static NSDecodingFailurePolicy fromValue(int value) => switch (value) { - 0 => NSDecodingFailurePolicyRaiseException, - 1 => NSDecodingFailurePolicySetErrorAndReturn, - _ => throw ArgumentError( - "Unknown value for NSDecodingFailurePolicy: $value"), - }; -} - -enum NSLocaleLanguageDirection { - NSLocaleLanguageDirectionUnknown(0), - NSLocaleLanguageDirectionLeftToRight(1), - NSLocaleLanguageDirectionRightToLeft(2), - NSLocaleLanguageDirectionTopToBottom(3), - NSLocaleLanguageDirectionBottomToTop(4); - - final int value; - const NSLocaleLanguageDirection(this.value); - - static NSLocaleLanguageDirection fromValue(int value) => switch (value) { - 0 => NSLocaleLanguageDirectionUnknown, - 1 => NSLocaleLanguageDirectionLeftToRight, - 2 => NSLocaleLanguageDirectionRightToLeft, - 3 => NSLocaleLanguageDirectionTopToBottom, - 4 => NSLocaleLanguageDirectionBottomToTop, - _ => throw ArgumentError( - "Unknown value for NSLocaleLanguageDirection: $value"), - }; -} - -enum NSSearchPathDirectory { - NSApplicationDirectory(1), - NSDemoApplicationDirectory(2), - NSDeveloperApplicationDirectory(3), - NSAdminApplicationDirectory(4), - NSLibraryDirectory(5), - NSDeveloperDirectory(6), - NSUserDirectory(7), - NSDocumentationDirectory(8), - NSDocumentDirectory(9), - NSCoreServiceDirectory(10), - NSAutosavedInformationDirectory(11), - NSDesktopDirectory(12), - NSCachesDirectory(13), - NSApplicationSupportDirectory(14), - NSDownloadsDirectory(15), - NSInputMethodsDirectory(16), - NSMoviesDirectory(17), - NSMusicDirectory(18), - NSPicturesDirectory(19), - NSPrinterDescriptionDirectory(20), - NSSharedPublicDirectory(21), - NSPreferencePanesDirectory(22), - NSApplicationScriptsDirectory(23), - NSItemReplacementDirectory(99), - NSAllApplicationsDirectory(100), - NSAllLibrariesDirectory(101), - NSTrashDirectory(102); - - final int value; - const NSSearchPathDirectory(this.value); - - static NSSearchPathDirectory fromValue(int value) => switch (value) { - 1 => NSApplicationDirectory, - 2 => NSDemoApplicationDirectory, - 3 => NSDeveloperApplicationDirectory, - 4 => NSAdminApplicationDirectory, - 5 => NSLibraryDirectory, - 6 => NSDeveloperDirectory, - 7 => NSUserDirectory, - 8 => NSDocumentationDirectory, - 9 => NSDocumentDirectory, - 10 => NSCoreServiceDirectory, - 11 => NSAutosavedInformationDirectory, - 12 => NSDesktopDirectory, - 13 => NSCachesDirectory, - 14 => NSApplicationSupportDirectory, - 15 => NSDownloadsDirectory, - 16 => NSInputMethodsDirectory, - 17 => NSMoviesDirectory, - 18 => NSMusicDirectory, - 19 => NSPicturesDirectory, - 20 => NSPrinterDescriptionDirectory, - 21 => NSSharedPublicDirectory, - 22 => NSPreferencePanesDirectory, - 23 => NSApplicationScriptsDirectory, - 99 => NSItemReplacementDirectory, - 100 => NSAllApplicationsDirectory, - 101 => NSAllLibrariesDirectory, - 102 => NSTrashDirectory, - _ => throw ArgumentError( - "Unknown value for NSSearchPathDirectory: $value"), - }; -} - -enum NSSearchPathDomainMask { - NSUserDomainMask(1), - NSLocalDomainMask(2), - NSNetworkDomainMask(4), - NSSystemDomainMask(8), - NSAllDomainsMask(65535); - - final int value; - const NSSearchPathDomainMask(this.value); - - static NSSearchPathDomainMask fromValue(int value) => switch (value) { - 1 => NSUserDomainMask, - 2 => NSLocalDomainMask, - 4 => NSNetworkDomainMask, - 8 => NSSystemDomainMask, - 65535 => NSAllDomainsMask, - _ => throw ArgumentError( - "Unknown value for NSSearchPathDomainMask: $value"), - }; -} - -enum NSVolumeEnumerationOptions { - NSVolumeEnumerationSkipHiddenVolumes(2), - NSVolumeEnumerationProduceFileReferenceURLs(4); - - final int value; - const NSVolumeEnumerationOptions(this.value); - - static NSVolumeEnumerationOptions fromValue(int value) => switch (value) { - 2 => NSVolumeEnumerationSkipHiddenVolumes, - 4 => NSVolumeEnumerationProduceFileReferenceURLs, - _ => throw ArgumentError( - "Unknown value for NSVolumeEnumerationOptions: $value"), - }; -} - -enum NSDirectoryEnumerationOptions { - NSDirectoryEnumerationSkipsSubdirectoryDescendants(1), - NSDirectoryEnumerationSkipsPackageDescendants(2), - NSDirectoryEnumerationSkipsHiddenFiles(4), - NSDirectoryEnumerationIncludesDirectoriesPostOrder(8), - NSDirectoryEnumerationProducesRelativePathURLs(16); - - final int value; - const NSDirectoryEnumerationOptions(this.value); - - static NSDirectoryEnumerationOptions fromValue(int value) => switch (value) { - 1 => NSDirectoryEnumerationSkipsSubdirectoryDescendants, - 2 => NSDirectoryEnumerationSkipsPackageDescendants, - 4 => NSDirectoryEnumerationSkipsHiddenFiles, - 8 => NSDirectoryEnumerationIncludesDirectoriesPostOrder, - 16 => NSDirectoryEnumerationProducesRelativePathURLs, - _ => throw ArgumentError( - "Unknown value for NSDirectoryEnumerationOptions: $value"), - }; -} - -enum NSFileManagerItemReplacementOptions { - NSFileManagerItemReplacementUsingNewMetadataOnly(1), - NSFileManagerItemReplacementWithoutDeletingBackupItem(2); - - final int value; - const NSFileManagerItemReplacementOptions(this.value); - - static NSFileManagerItemReplacementOptions fromValue(int value) => - switch (value) { - 1 => NSFileManagerItemReplacementUsingNewMetadataOnly, - 2 => NSFileManagerItemReplacementWithoutDeletingBackupItem, - _ => throw ArgumentError( - "Unknown value for NSFileManagerItemReplacementOptions: $value"), - }; -} - -enum NSURLRelationship { - NSURLRelationshipContains(0), - NSURLRelationshipSame(1), - NSURLRelationshipOther(2); - - final int value; - const NSURLRelationship(this.value); - - static NSURLRelationship fromValue(int value) => switch (value) { - 0 => NSURLRelationshipContains, - 1 => NSURLRelationshipSame, - 2 => NSURLRelationshipOther, - _ => throw ArgumentError("Unknown value for NSURLRelationship: $value"), - }; -} - -enum NSFileManagerUnmountOptions { - NSFileManagerUnmountAllPartitionsAndEjectDisk(1), - NSFileManagerUnmountWithoutUI(2); - - final int value; - const NSFileManagerUnmountOptions(this.value); - - static NSFileManagerUnmountOptions fromValue(int value) => switch (value) { - 1 => NSFileManagerUnmountAllPartitionsAndEjectDisk, - 2 => NSFileManagerUnmountWithoutUI, - _ => throw ArgumentError( - "Unknown value for NSFileManagerUnmountOptions: $value"), - }; -} - -late final _class_NSFileManager = objc.getClass("NSFileManager"); -late final _sel_defaultManager = objc.registerName("defaultManager"); -late final _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_ = objc - .registerName("mountedVolumeURLsIncludingResourceValuesForKeys:options:"); -final _objc_msgSend_gyiq9w = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSError_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSError_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSError_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.NSError.castFromPointer(arg0, - retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(objc.NSError?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.NSError.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = _AVFAudio_wrapListenerBlock_ukcdfq(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSError? arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_unmountVolumeAtURL_options_completionHandler_ = - objc.registerName("unmountVolumeAtURL:options:completionHandler:"); -final _objc_msgSend_yuugcv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_ = - objc.registerName( - "contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:"); -final _objc_msgSend_1rn5oli = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); -late final _sel_URLsForDirectory_inDomains_ = - objc.registerName("URLsForDirectory:inDomains:"); -final _objc_msgSend_1llbjq7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int)>(); -late final _sel_URLForDirectory_inDomain_appropriateForURL_create_error_ = objc - .registerName("URLForDirectory:inDomain:appropriateForURL:create:error:"); -final _objc_msgSend_46p27t = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Bool, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - bool, - ffi.Pointer>)>(); -late final _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_ = - objc.registerName("getRelationship:ofDirectoryAtURL:toItemAtURL:error:"); -final _objc_msgSend_17s8ocw = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_ = objc - .registerName("getRelationship:ofDirectory:inDomain:toItemAtURL:error:"); -final _objc_msgSend_9p3pl8 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_ = - objc.registerName( - "createDirectoryAtURL:withIntermediateDirectories:attributes:error:"); -final _objc_msgSend_16o5u5c = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_createSymbolicLinkAtURL_withDestinationURL_error_ = - objc.registerName("createSymbolicLinkAtURL:withDestinationURL:error:"); -final _objc_msgSend_6toz8x = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_delegate = objc.registerName("delegate"); -late final _sel_setDelegate_ = objc.registerName("setDelegate:"); -late final _sel_setAttributes_ofItemAtPath_error_ = - objc.registerName("setAttributes:ofItemAtPath:error:"); -late final _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_ = - objc.registerName( - "createDirectoryAtPath:withIntermediateDirectories:attributes:error:"); -late final _sel_contentsOfDirectoryAtPath_error_ = - objc.registerName("contentsOfDirectoryAtPath:error:"); -final _objc_msgSend_1y425zh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_subpathsOfDirectoryAtPath_error_ = - objc.registerName("subpathsOfDirectoryAtPath:error:"); -late final _sel_attributesOfItemAtPath_error_ = - objc.registerName("attributesOfItemAtPath:error:"); -late final _sel_attributesOfFileSystemForPath_error_ = - objc.registerName("attributesOfFileSystemForPath:error:"); -late final _sel_createSymbolicLinkAtPath_withDestinationPath_error_ = - objc.registerName("createSymbolicLinkAtPath:withDestinationPath:error:"); -late final _sel_destinationOfSymbolicLinkAtPath_error_ = - objc.registerName("destinationOfSymbolicLinkAtPath:error:"); -late final _sel_copyItemAtPath_toPath_error_ = - objc.registerName("copyItemAtPath:toPath:error:"); -late final _sel_moveItemAtPath_toPath_error_ = - objc.registerName("moveItemAtPath:toPath:error:"); -late final _sel_linkItemAtPath_toPath_error_ = - objc.registerName("linkItemAtPath:toPath:error:"); -late final _sel_removeItemAtPath_error_ = - objc.registerName("removeItemAtPath:error:"); -final _objc_msgSend_p02k6o = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_copyItemAtURL_toURL_error_ = - objc.registerName("copyItemAtURL:toURL:error:"); -late final _sel_moveItemAtURL_toURL_error_ = - objc.registerName("moveItemAtURL:toURL:error:"); -late final _sel_linkItemAtURL_toURL_error_ = - objc.registerName("linkItemAtURL:toURL:error:"); -late final _sel_removeItemAtURL_error_ = - objc.registerName("removeItemAtURL:error:"); -late final _sel_trashItemAtURL_resultingItemURL_error_ = - objc.registerName("trashItemAtURL:resultingItemURL:error:"); -final _objc_msgSend_to8xlo = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); -late final _sel_fileAttributesAtPath_traverseLink_ = - objc.registerName("fileAttributesAtPath:traverseLink:"); -final _objc_msgSend_qqbb5y = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_changeFileAttributes_atPath_ = - objc.registerName("changeFileAttributes:atPath:"); -final _objc_msgSend_1ywe6ev = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_directoryContentsAtPath_ = - objc.registerName("directoryContentsAtPath:"); -late final _sel_fileSystemAttributesAtPath_ = - objc.registerName("fileSystemAttributesAtPath:"); -late final _sel_pathContentOfSymbolicLinkAtPath_ = - objc.registerName("pathContentOfSymbolicLinkAtPath:"); -late final _sel_createSymbolicLinkAtPath_pathContent_ = - objc.registerName("createSymbolicLinkAtPath:pathContent:"); -late final _sel_createDirectoryAtPath_attributes_ = - objc.registerName("createDirectoryAtPath:attributes:"); -late final _sel_linkPath_toPath_handler_ = - objc.registerName("linkPath:toPath:handler:"); -final _objc_msgSend_hukaf0 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_copyPath_toPath_handler_ = - objc.registerName("copyPath:toPath:handler:"); -late final _sel_movePath_toPath_handler_ = - objc.registerName("movePath:toPath:handler:"); -late final _sel_removeFileAtPath_handler_ = - objc.registerName("removeFileAtPath:handler:"); -late final _sel_currentDirectoryPath = - objc.registerName("currentDirectoryPath"); -late final _sel_changeCurrentDirectoryPath_ = - objc.registerName("changeCurrentDirectoryPath:"); -late final _sel_fileExistsAtPath_ = objc.registerName("fileExistsAtPath:"); -late final _sel_fileExistsAtPath_isDirectory_ = - objc.registerName("fileExistsAtPath:isDirectory:"); -final _objc_msgSend_rtz5p9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_isReadableFileAtPath_ = - objc.registerName("isReadableFileAtPath:"); -late final _sel_isWritableFileAtPath_ = - objc.registerName("isWritableFileAtPath:"); -late final _sel_isExecutableFileAtPath_ = - objc.registerName("isExecutableFileAtPath:"); -late final _sel_isDeletableFileAtPath_ = - objc.registerName("isDeletableFileAtPath:"); -late final _sel_contentsEqualAtPath_andPath_ = - objc.registerName("contentsEqualAtPath:andPath:"); -late final _sel_displayNameAtPath_ = objc.registerName("displayNameAtPath:"); -late final _sel_componentsToDisplayForPath_ = - objc.registerName("componentsToDisplayForPath:"); -late final _sel_enumeratorAtPath_ = objc.registerName("enumeratorAtPath:"); -bool _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_NSURL_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_NSURL_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_NSURL_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_NSURL_NSError_closureTrampoline, false) - .cast(); - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_bool_NSURL_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_bool_NSURL_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - bool Function(objc.NSURL, objc.NSError) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_bool_NSURL_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn( - objc.NSURL - .castFromPointer(arg0, retain: true, release: true), - objc.NSError.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_bool_NSURL_NSError_CallExtension - on objc.ObjCBlock { - bool call(objc.NSURL arg0, objc.NSError arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer); -} - -late final _sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_ = - objc.registerName( - "enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:"); -final _objc_msgSend_40k0lk = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_subpathsAtPath_ = objc.registerName("subpathsAtPath:"); -late final _sel_contentsAtPath_ = objc.registerName("contentsAtPath:"); -late final _sel_createFileAtPath_contents_attributes_ = - objc.registerName("createFileAtPath:contents:attributes:"); -late final _sel_fileSystemRepresentationWithPath_ = - objc.registerName("fileSystemRepresentationWithPath:"); -final _objc_msgSend_t1v5su = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_stringWithFileSystemRepresentation_length_ = - objc.registerName("stringWithFileSystemRepresentation:length:"); -final _objc_msgSend_1t5rcq1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); -late final _sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_ = - objc.registerName( - "replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:"); -final _objc_msgSend_1cu34v2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>, - ffi.Pointer>)>(); -late final _sel_setUbiquitous_itemAtURL_destinationURL_error_ = - objc.registerName("setUbiquitous:itemAtURL:destinationURL:error:"); -final _objc_msgSend_191cxmu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_isUbiquitousItemAtURL_ = - objc.registerName("isUbiquitousItemAtURL:"); -late final _sel_startDownloadingUbiquitousItemAtURL_error_ = - objc.registerName("startDownloadingUbiquitousItemAtURL:error:"); -late final _sel_evictUbiquitousItemAtURL_error_ = - objc.registerName("evictUbiquitousItemAtURL:error:"); -late final _sel_URLForUbiquityContainerIdentifier_ = - objc.registerName("URLForUbiquityContainerIdentifier:"); -late final _sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_ = objc - .registerName("URLForPublishingUbiquitousItemAtURL:expirationDate:error:"); -final _objc_msgSend_1dca44n = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); -late final _sel_ubiquityIdentityToken = - objc.registerName("ubiquityIdentityToken"); -void _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSDictionary_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSDictionary_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSDictionary_NSError_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSDictionary_NSError_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSDictionary_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSDictionary?, objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSDictionary_NSError_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : objc.NSDictionary.castFromPointer(arg0, - retain: true, release: true), - arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener(void Function(objc.NSDictionary?, objc.NSError?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSDictionary_NSError_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : objc.NSDictionary.castFromPointer(arg0, - retain: false, release: true), - arg1.address == 0 - ? null - : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _AVFAudio_wrapListenerBlock_1tjlcwl(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSDictionary_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSDictionary? arg0, objc.NSError? arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_getFileProviderServicesForItemAtURL_completionHandler_ = - objc.registerName("getFileProviderServicesForItemAtURL:completionHandler:"); -ffi.Pointer - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock? Function(objc.NSError, objc.NSString)>`. -abstract final class ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer? Function(objc.NSError, objc.NSString)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer? Function(objc.NSError, - objc.NSString)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock? Function(objc.NSError, objc.NSString)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock? Function(objc.NSError, objc.NSString)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock? Function(objc.NSError, objc.NSString)> - fromFunction( - objc.ObjCObjectBase? Function(objc.NSError, objc.NSString) fn) => - objc.ObjCBlock? Function(objc.NSError, objc.NSString)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn(objc.NSError.castFromPointer(arg0, retain: true, release: true), objc.NSString.castFromPointer(arg1, retain: true, release: true)) - ?.ref - .retainAndAutorelease() ?? - ffi.nullptr), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock? Function(objc.NSError, objc.NSString)>`. -extension ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_CallExtension - on objc.ObjCBlock< - ffi.Pointer? Function(objc.NSError, objc.NSString)> { - objc.ObjCObjectBase? call(objc.NSError arg0, objc.NSString arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>() - (ref.pointer, arg0.ref.pointer, arg1.ref.pointer) - .address == - 0 - ? null - : objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast Function(ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer), - retain: true, - release: true); -} - -final _objc_msgSend_cmbt6k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_containerURLForSecurityApplicationGroupIdentifier_ = - objc.registerName("containerURLForSecurityApplicationGroupIdentifier:"); -late final _sel_homeDirectoryForCurrentUser = - objc.registerName("homeDirectoryForCurrentUser"); -late final _sel_temporaryDirectory = objc.registerName("temporaryDirectory"); -late final _sel_homeDirectoryForUser_ = - objc.registerName("homeDirectoryForUser:"); - -/// NSFileManager -class NSFileManager extends objc.NSObject { - NSFileManager._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSFileManager] that points to the same underlying object as [other]. - NSFileManager.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSFileManager] that wraps the given raw object pointer. - NSFileManager.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSFileManager]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSFileManager); - } - - /// defaultManager - static NSFileManager getDefaultManager() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSFileManager, _sel_defaultManager); - return NSFileManager.castFromPointer(_ret, retain: true, release: true); - } - - /// mountedVolumeURLsIncludingResourceValuesForKeys:options: - objc.NSArray? mountedVolumeURLsIncludingResourceValuesForKeys_options_( - objc.NSArray? propertyKeys, NSVolumeEnumerationOptions options) { - final _ret = _objc_msgSend_gyiq9w( - this.ref.pointer, - _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_, - propertyKeys?.ref.pointer ?? ffi.nullptr, - options.value); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// unmountVolumeAtURL:options:completionHandler: - void unmountVolumeAtURL_options_completionHandler_( - objc.NSURL url, - NSFileManagerUnmountOptions mask, - objc.ObjCBlock completionHandler) { - _objc_msgSend_yuugcv( - this.ref.pointer, - _sel_unmountVolumeAtURL_options_completionHandler_, - url.ref.pointer, - mask.value, - completionHandler.ref.pointer); - } - - /// contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error: - objc.NSArray? - contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_( - objc.NSURL url, - objc.NSArray? keys, - NSDirectoryEnumerationOptions mask, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1rn5oli( - this.ref.pointer, - _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_, - url.ref.pointer, - keys?.ref.pointer ?? ffi.nullptr, - mask.value, - error); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// URLsForDirectory:inDomains: - objc.NSArray URLsForDirectory_inDomains_( - NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask) { - final _ret = _objc_msgSend_1llbjq7(this.ref.pointer, - _sel_URLsForDirectory_inDomains_, directory.value, domainMask.value); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// URLForDirectory:inDomain:appropriateForURL:create:error: - objc.NSURL? URLForDirectory_inDomain_appropriateForURL_create_error_( - NSSearchPathDirectory directory, - NSSearchPathDomainMask domain, - objc.NSURL? url, - bool shouldCreate, - ffi.Pointer> error) { - final _ret = _objc_msgSend_46p27t( - this.ref.pointer, - _sel_URLForDirectory_inDomain_appropriateForURL_create_error_, - directory.value, - domain.value, - url?.ref.pointer ?? ffi.nullptr, - shouldCreate, - error); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// getRelationship:ofDirectoryAtURL:toItemAtURL:error: - bool getRelationship_ofDirectoryAtURL_toItemAtURL_error_( - ffi.Pointer outRelationship, - objc.NSURL directoryURL, - objc.NSURL otherURL, - ffi.Pointer> error) { - return _objc_msgSend_17s8ocw( - this.ref.pointer, - _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_, - outRelationship, - directoryURL.ref.pointer, - otherURL.ref.pointer, - error); - } - - /// getRelationship:ofDirectory:inDomain:toItemAtURL:error: - bool getRelationship_ofDirectory_inDomain_toItemAtURL_error_( - ffi.Pointer outRelationship, - NSSearchPathDirectory directory, - NSSearchPathDomainMask domainMask, - objc.NSURL url, - ffi.Pointer> error) { - return _objc_msgSend_9p3pl8( - this.ref.pointer, - _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_, - outRelationship, - directory.value, - domainMask.value, - url.ref.pointer, - error); - } - - /// createDirectoryAtURL:withIntermediateDirectories:attributes:error: - bool createDirectoryAtURL_withIntermediateDirectories_attributes_error_( - objc.NSURL url, - bool createIntermediates, - objc.NSDictionary? attributes, - ffi.Pointer> error) { - return _objc_msgSend_16o5u5c( - this.ref.pointer, - _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_, - url.ref.pointer, - createIntermediates, - attributes?.ref.pointer ?? ffi.nullptr, - error); - } - - /// createSymbolicLinkAtURL:withDestinationURL:error: - bool createSymbolicLinkAtURL_withDestinationURL_error_(objc.NSURL url, - objc.NSURL destURL, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_createSymbolicLinkAtURL_withDestinationURL_error_, - url.ref.pointer, - destURL.ref.pointer, - error); - } - - /// delegate - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setDelegate: - set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); - } - - /// setAttributes:ofItemAtPath:error: - bool setAttributes_ofItemAtPath_error_(objc.NSDictionary attributes, - objc.NSString path, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_setAttributes_ofItemAtPath_error_, - attributes.ref.pointer, - path.ref.pointer, - error); - } - - /// createDirectoryAtPath:withIntermediateDirectories:attributes:error: - bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_( - objc.NSString path, - bool createIntermediates, - objc.NSDictionary? attributes, - ffi.Pointer> error) { - return _objc_msgSend_16o5u5c( - this.ref.pointer, - _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_, - path.ref.pointer, - createIntermediates, - attributes?.ref.pointer ?? ffi.nullptr, - error); - } - - /// contentsOfDirectoryAtPath:error: - objc.NSArray? contentsOfDirectoryAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_contentsOfDirectoryAtPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// subpathsOfDirectoryAtPath:error: - objc.NSArray? subpathsOfDirectoryAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_subpathsOfDirectoryAtPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// attributesOfItemAtPath:error: - objc.NSDictionary? attributesOfItemAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_attributesOfItemAtPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// attributesOfFileSystemForPath:error: - objc.NSDictionary? attributesOfFileSystemForPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_attributesOfFileSystemForPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// createSymbolicLinkAtPath:withDestinationPath:error: - bool createSymbolicLinkAtPath_withDestinationPath_error_(objc.NSString path, - objc.NSString destPath, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_createSymbolicLinkAtPath_withDestinationPath_error_, - path.ref.pointer, - destPath.ref.pointer, - error); - } - - /// destinationOfSymbolicLinkAtPath:error: - objc.NSString? destinationOfSymbolicLinkAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_destinationOfSymbolicLinkAtPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// copyItemAtPath:toPath:error: - bool copyItemAtPath_toPath_error_(objc.NSString srcPath, - objc.NSString dstPath, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_copyItemAtPath_toPath_error_, - srcPath.ref.pointer, - dstPath.ref.pointer, - error); - } - - /// moveItemAtPath:toPath:error: - bool moveItemAtPath_toPath_error_(objc.NSString srcPath, - objc.NSString dstPath, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_moveItemAtPath_toPath_error_, - srcPath.ref.pointer, - dstPath.ref.pointer, - error); - } - - /// linkItemAtPath:toPath:error: - bool linkItemAtPath_toPath_error_(objc.NSString srcPath, - objc.NSString dstPath, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_linkItemAtPath_toPath_error_, - srcPath.ref.pointer, - dstPath.ref.pointer, - error); - } - - /// removeItemAtPath:error: - bool removeItemAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - return _objc_msgSend_p02k6o(this.ref.pointer, _sel_removeItemAtPath_error_, - path.ref.pointer, error); - } - - /// copyItemAtURL:toURL:error: - bool copyItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, - ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_copyItemAtURL_toURL_error_, - srcURL.ref.pointer, - dstURL.ref.pointer, - error); - } - - /// moveItemAtURL:toURL:error: - bool moveItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, - ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_moveItemAtURL_toURL_error_, - srcURL.ref.pointer, - dstURL.ref.pointer, - error); - } - - /// linkItemAtURL:toURL:error: - bool linkItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, - ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_linkItemAtURL_toURL_error_, - srcURL.ref.pointer, - dstURL.ref.pointer, - error); - } - - /// removeItemAtURL:error: - bool removeItemAtURL_error_( - objc.NSURL URL, ffi.Pointer> error) { - return _objc_msgSend_p02k6o( - this.ref.pointer, _sel_removeItemAtURL_error_, URL.ref.pointer, error); - } - - /// trashItemAtURL:resultingItemURL:error: - bool trashItemAtURL_resultingItemURL_error_( - objc.NSURL url, - ffi.Pointer> outResultingURL, - ffi.Pointer> error) { - return _objc_msgSend_to8xlo( - this.ref.pointer, - _sel_trashItemAtURL_resultingItemURL_error_, - url.ref.pointer, - outResultingURL, - error); - } - - /// fileAttributesAtPath:traverseLink: - objc.NSDictionary? fileAttributesAtPath_traverseLink_( - objc.NSString path, bool yorn) { - final _ret = _objc_msgSend_qqbb5y(this.ref.pointer, - _sel_fileAttributesAtPath_traverseLink_, path.ref.pointer, yorn); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// changeFileAttributes:atPath: - bool changeFileAttributes_atPath_( - objc.NSDictionary attributes, objc.NSString path) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_changeFileAttributes_atPath_, - attributes.ref.pointer, - path.ref.pointer); - } - - /// directoryContentsAtPath: - objc.NSArray? directoryContentsAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_directoryContentsAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// fileSystemAttributesAtPath: - objc.NSDictionary? fileSystemAttributesAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_fileSystemAttributesAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// pathContentOfSymbolicLinkAtPath: - objc.NSString? pathContentOfSymbolicLinkAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_pathContentOfSymbolicLinkAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// createSymbolicLinkAtPath:pathContent: - bool createSymbolicLinkAtPath_pathContent_( - objc.NSString path, objc.NSString otherpath) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_createSymbolicLinkAtPath_pathContent_, - path.ref.pointer, - otherpath.ref.pointer); - } - - /// createDirectoryAtPath:attributes: - bool createDirectoryAtPath_attributes_( - objc.NSString path, objc.NSDictionary attributes) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_createDirectoryAtPath_attributes_, - path.ref.pointer, - attributes.ref.pointer); - } - - /// linkPath:toPath:handler: - bool linkPath_toPath_handler_( - objc.NSString src, objc.NSString dest, objc.ObjCObjectBase? handler) { - return _objc_msgSend_hukaf0(this.ref.pointer, _sel_linkPath_toPath_handler_, - src.ref.pointer, dest.ref.pointer, handler?.ref.pointer ?? ffi.nullptr); - } - - /// copyPath:toPath:handler: - bool copyPath_toPath_handler_( - objc.NSString src, objc.NSString dest, objc.ObjCObjectBase? handler) { - return _objc_msgSend_hukaf0(this.ref.pointer, _sel_copyPath_toPath_handler_, - src.ref.pointer, dest.ref.pointer, handler?.ref.pointer ?? ffi.nullptr); - } - - /// movePath:toPath:handler: - bool movePath_toPath_handler_( - objc.NSString src, objc.NSString dest, objc.ObjCObjectBase? handler) { - return _objc_msgSend_hukaf0(this.ref.pointer, _sel_movePath_toPath_handler_, - src.ref.pointer, dest.ref.pointer, handler?.ref.pointer ?? ffi.nullptr); - } - - /// removeFileAtPath:handler: - bool removeFileAtPath_handler_( - objc.NSString path, objc.ObjCObjectBase? handler) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_removeFileAtPath_handler_, - path.ref.pointer, - handler?.ref.pointer ?? ffi.nullptr); - } - - /// currentDirectoryPath - objc.NSString get currentDirectoryPath { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_currentDirectoryPath); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// changeCurrentDirectoryPath: - bool changeCurrentDirectoryPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_changeCurrentDirectoryPath_, path.ref.pointer); - } - - /// fileExistsAtPath: - bool fileExistsAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_fileExistsAtPath_, path.ref.pointer); - } - - /// fileExistsAtPath:isDirectory: - bool fileExistsAtPath_isDirectory_( - objc.NSString path, ffi.Pointer isDirectory) { - return _objc_msgSend_rtz5p9(this.ref.pointer, - _sel_fileExistsAtPath_isDirectory_, path.ref.pointer, isDirectory); - } - - /// isReadableFileAtPath: - bool isReadableFileAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isReadableFileAtPath_, path.ref.pointer); - } - - /// isWritableFileAtPath: - bool isWritableFileAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isWritableFileAtPath_, path.ref.pointer); - } - - /// isExecutableFileAtPath: - bool isExecutableFileAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isExecutableFileAtPath_, path.ref.pointer); - } - - /// isDeletableFileAtPath: - bool isDeletableFileAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isDeletableFileAtPath_, path.ref.pointer); - } - - /// contentsEqualAtPath:andPath: - bool contentsEqualAtPath_andPath_(objc.NSString path1, objc.NSString path2) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_contentsEqualAtPath_andPath_, - path1.ref.pointer, - path2.ref.pointer); - } - - /// displayNameAtPath: - objc.NSString displayNameAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_displayNameAtPath_, path.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// componentsToDisplayForPath: - objc.NSArray? componentsToDisplayForPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_componentsToDisplayForPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// enumeratorAtPath: - objc.ObjCObjectBase? enumeratorAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_enumeratorAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: - objc.ObjCObjectBase? - enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_( - objc.NSURL url, - objc.NSArray? keys, - NSDirectoryEnumerationOptions mask, - objc.ObjCBlock? - handler) { - final _ret = _objc_msgSend_40k0lk( - this.ref.pointer, - _sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_, - url.ref.pointer, - keys?.ref.pointer ?? ffi.nullptr, - mask.value, - handler?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// subpathsAtPath: - objc.NSArray? subpathsAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_subpathsAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// contentsAtPath: - objc.NSData? contentsAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_contentsAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// createFileAtPath:contents:attributes: - bool createFileAtPath_contents_attributes_( - objc.NSString path, objc.NSData? data, objc.NSDictionary? attr) { - return _objc_msgSend_hukaf0( - this.ref.pointer, - _sel_createFileAtPath_contents_attributes_, - path.ref.pointer, - data?.ref.pointer ?? ffi.nullptr, - attr?.ref.pointer ?? ffi.nullptr); - } - - /// fileSystemRepresentationWithPath: - ffi.Pointer fileSystemRepresentationWithPath_(objc.NSString path) { - return _objc_msgSend_t1v5su(this.ref.pointer, - _sel_fileSystemRepresentationWithPath_, path.ref.pointer); - } - - /// stringWithFileSystemRepresentation:length: - objc.NSString stringWithFileSystemRepresentation_length_( - ffi.Pointer str, int len) { - final _ret = _objc_msgSend_1t5rcq1(this.ref.pointer, - _sel_stringWithFileSystemRepresentation_length_, str, len); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: - bool - replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_( - objc.NSURL originalItemURL, - objc.NSURL newItemURL, - objc.NSString? backupItemName, - NSFileManagerItemReplacementOptions options, - ffi.Pointer> resultingURL, - ffi.Pointer> error) { - return _objc_msgSend_1cu34v2( - this.ref.pointer, - _sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_, - originalItemURL.ref.pointer, - newItemURL.ref.pointer, - backupItemName?.ref.pointer ?? ffi.nullptr, - options.value, - resultingURL, - error); - } - - /// setUbiquitous:itemAtURL:destinationURL:error: - bool setUbiquitous_itemAtURL_destinationURL_error_( - bool flag, - objc.NSURL url, - objc.NSURL destinationURL, - ffi.Pointer> error) { - return _objc_msgSend_191cxmu( - this.ref.pointer, - _sel_setUbiquitous_itemAtURL_destinationURL_error_, - flag, - url.ref.pointer, - destinationURL.ref.pointer, - error); - } - - /// isUbiquitousItemAtURL: - bool isUbiquitousItemAtURL_(objc.NSURL url) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isUbiquitousItemAtURL_, url.ref.pointer); - } - - /// startDownloadingUbiquitousItemAtURL:error: - bool startDownloadingUbiquitousItemAtURL_error_( - objc.NSURL url, ffi.Pointer> error) { - return _objc_msgSend_p02k6o( - this.ref.pointer, - _sel_startDownloadingUbiquitousItemAtURL_error_, - url.ref.pointer, - error); - } - - /// evictUbiquitousItemAtURL:error: - bool evictUbiquitousItemAtURL_error_( - objc.NSURL url, ffi.Pointer> error) { - return _objc_msgSend_p02k6o(this.ref.pointer, - _sel_evictUbiquitousItemAtURL_error_, url.ref.pointer, error); - } - - /// URLForUbiquityContainerIdentifier: - objc.NSURL? URLForUbiquityContainerIdentifier_( - objc.NSString? containerIdentifier) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, - _sel_URLForUbiquityContainerIdentifier_, - containerIdentifier?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// URLForPublishingUbiquitousItemAtURL:expirationDate:error: - objc.NSURL? URLForPublishingUbiquitousItemAtURL_expirationDate_error_( - objc.NSURL url, - ffi.Pointer> outDate, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1dca44n( - this.ref.pointer, - _sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_, - url.ref.pointer, - outDate, - error); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ubiquityIdentityToken - objc.ObjCObjectBase? get ubiquityIdentityToken { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_ubiquityIdentityToken); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// getFileProviderServicesForItemAtURL:completionHandler: - void getFileProviderServicesForItemAtURL_completionHandler_( - objc.NSURL url, - objc.ObjCBlock - completionHandler) { - _objc_msgSend_cmbt6k( - this.ref.pointer, - _sel_getFileProviderServicesForItemAtURL_completionHandler_, - url.ref.pointer, - completionHandler.ref.pointer); - } - - /// containerURLForSecurityApplicationGroupIdentifier: - objc.NSURL? containerURLForSecurityApplicationGroupIdentifier_( - objc.NSString groupIdentifier) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, - _sel_containerURLForSecurityApplicationGroupIdentifier_, - groupIdentifier.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// homeDirectoryForCurrentUser - objc.NSURL get homeDirectoryForCurrentUser { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_homeDirectoryForCurrentUser); - return objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// temporaryDirectory - objc.NSURL get temporaryDirectory { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_temporaryDirectory); - return objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// homeDirectoryForUser: - objc.NSURL? homeDirectoryForUser_(objc.NSString userName) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_homeDirectoryForUser_, userName.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSFileManager init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSFileManager.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSFileManager new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSFileManager, _sel_new); - return NSFileManager.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSFileManager allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSFileManager, _sel_allocWithZone_, zone); - return NSFileManager.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSFileManager alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSFileManager, _sel_alloc); - return NSFileManager.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSFileManager, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSFileManager, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSFileManager, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSFileManager, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSFileManager, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSFileManager, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSFileManager, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSFileManager, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSFileManager, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -enum NSPropertyListFormat { - NSPropertyListOpenStepFormat(1), - NSPropertyListXMLFormat_v1_0(100), - NSPropertyListBinaryFormat_v1_0(200); - - final int value; - const NSPropertyListFormat(this.value); - - static NSPropertyListFormat fromValue(int value) => switch (value) { - 1 => NSPropertyListOpenStepFormat, - 100 => NSPropertyListXMLFormat_v1_0, - 200 => NSPropertyListBinaryFormat_v1_0, - _ => - throw ArgumentError("Unknown value for NSPropertyListFormat: $value"), - }; -} - -final class NSEdgeInsets extends ffi.Struct { - @ffi.Double() - external double top; - - @ffi.Double() - external double left; - - @ffi.Double() - external double bottom; - - @ffi.Double() - external double right; -} - -late final _class_NSKeyedArchiver = objc.getClass("NSKeyedArchiver"); -late final _sel_initRequiringSecureCoding_ = - objc.registerName("initRequiringSecureCoding:"); -final _objc_msgSend_1upz917 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, bool)>(); -late final _sel_archivedDataWithRootObject_requiringSecureCoding_error_ = objc - .registerName("archivedDataWithRootObject:requiringSecureCoding:error:"); -final _objc_msgSend_6e0rjm = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer>)>(); -late final _sel_initForWritingWithMutableData_ = - objc.registerName("initForWritingWithMutableData:"); -late final _sel_archivedDataWithRootObject_ = - objc.registerName("archivedDataWithRootObject:"); -late final _sel_archiveRootObject_toFile_ = - objc.registerName("archiveRootObject:toFile:"); -late final _sel_outputFormat = objc.registerName("outputFormat"); -final _objc_msgSend_3y21y6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setOutputFormat_ = objc.registerName("setOutputFormat:"); -final _objc_msgSend_2xh8ml = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_encodedData = objc.registerName("encodedData"); -late final _sel_finishEncoding = objc.registerName("finishEncoding"); -late final _sel_setClassName_forClass_ = - objc.registerName("setClassName:forClass:"); -late final _sel_classNameForClass_ = objc.registerName("classNameForClass:"); -late final _sel_encodeObject_forKey_ = - objc.registerName("encodeObject:forKey:"); -late final _sel_encodeConditionalObject_forKey_ = - objc.registerName("encodeConditionalObject:forKey:"); -late final _sel_encodeBool_forKey_ = objc.registerName("encodeBool:forKey:"); -final _objc_msgSend_1ej8563 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer)>(); -late final _sel_encodeInt_forKey_ = objc.registerName("encodeInt:forKey:"); -final _objc_msgSend_1ijvd5c = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_encodeInt32_forKey_ = objc.registerName("encodeInt32:forKey:"); -final _objc_msgSend_vnkyom = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_encodeInt64_forKey_ = objc.registerName("encodeInt64:forKey:"); -final _objc_msgSend_1ruyfmt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_encodeFloat_forKey_ = objc.registerName("encodeFloat:forKey:"); -final _objc_msgSend_6n5aez = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Float, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); -late final _sel_encodeDouble_forKey_ = - objc.registerName("encodeDouble:forKey:"); -final _objc_msgSend_13ndgwe = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); -late final _sel_encodeBytes_length_forKey_ = - objc.registerName("encodeBytes:length:forKey:"); -final _objc_msgSend_6els9k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_requiresSecureCoding = - objc.registerName("requiresSecureCoding"); -late final _sel_setRequiresSecureCoding_ = - objc.registerName("setRequiresSecureCoding:"); - -/// NSKeyedArchiver -class NSKeyedArchiver extends objc.NSCoder { - NSKeyedArchiver._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSKeyedArchiver] that points to the same underlying object as [other]. - NSKeyedArchiver.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSKeyedArchiver] that wraps the given raw object pointer. - NSKeyedArchiver.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSKeyedArchiver]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSKeyedArchiver); - } - - /// initRequiringSecureCoding: - NSKeyedArchiver initRequiringSecureCoding_(bool requiresSecureCoding) { - final _ret = _objc_msgSend_1upz917(this.ref.retainAndReturnPointer(), - _sel_initRequiringSecureCoding_, requiresSecureCoding); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// archivedDataWithRootObject:requiringSecureCoding:error: - static objc.NSData? archivedDataWithRootObject_requiringSecureCoding_error_( - objc.ObjCObjectBase object, - bool requiresSecureCoding, - ffi.Pointer> error) { - final _ret = _objc_msgSend_6e0rjm( - _class_NSKeyedArchiver, - _sel_archivedDataWithRootObject_requiringSecureCoding_error_, - object.ref.pointer, - requiresSecureCoding, - error); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSKeyedArchiver init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// initForWritingWithMutableData: - NSKeyedArchiver initForWritingWithMutableData_(objc.NSMutableData data) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initForWritingWithMutableData_, data.ref.pointer); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// archivedDataWithRootObject: - static objc.NSData archivedDataWithRootObject_( - objc.ObjCObjectBase rootObject) { - final _ret = _objc_msgSend_juohf7(_class_NSKeyedArchiver, - _sel_archivedDataWithRootObject_, rootObject.ref.pointer); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// archiveRootObject:toFile: - static bool archiveRootObject_toFile_( - objc.ObjCObjectBase rootObject, objc.NSString path) { - return _objc_msgSend_1ywe6ev( - _class_NSKeyedArchiver, - _sel_archiveRootObject_toFile_, - rootObject.ref.pointer, - path.ref.pointer); - } - - /// delegate - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setDelegate: - set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); - } - - /// outputFormat - NSPropertyListFormat get outputFormat { - final _ret = _objc_msgSend_3y21y6(this.ref.pointer, _sel_outputFormat); - return NSPropertyListFormat.fromValue(_ret); - } - - /// setOutputFormat: - set outputFormat(NSPropertyListFormat value) { - return _objc_msgSend_2xh8ml( - this.ref.pointer, _sel_setOutputFormat_, value.value); - } - - /// encodedData - objc.NSData get encodedData { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_encodedData); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// finishEncoding - void finishEncoding() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_finishEncoding); - } - - /// setClassName:forClass: - void setClassName_forClass_( - objc.NSString? codedName, objc.ObjCObjectBase cls) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_setClassName_forClass_, - codedName?.ref.pointer ?? ffi.nullptr, cls.ref.pointer); - } - - /// classNameForClass: - objc.NSString? classNameForClass_(objc.ObjCObjectBase cls) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_classNameForClass_, cls.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// encodeObject:forKey: - void encodeObject_forKey_(objc.ObjCObjectBase? object, objc.NSString key) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_encodeObject_forKey_, - object?.ref.pointer ?? ffi.nullptr, key.ref.pointer); - } - - /// encodeConditionalObject:forKey: - void encodeConditionalObject_forKey_( - objc.ObjCObjectBase? object, objc.NSString key) { - _objc_msgSend_1tjlcwl( - this.ref.pointer, - _sel_encodeConditionalObject_forKey_, - object?.ref.pointer ?? ffi.nullptr, - key.ref.pointer); - } - - /// encodeBool:forKey: - void encodeBool_forKey_(bool value, objc.NSString key) { - _objc_msgSend_1ej8563( - this.ref.pointer, _sel_encodeBool_forKey_, value, key.ref.pointer); - } - - /// encodeInt:forKey: - void encodeInt_forKey_(int value, objc.NSString key) { - _objc_msgSend_1ijvd5c( - this.ref.pointer, _sel_encodeInt_forKey_, value, key.ref.pointer); - } - - /// encodeInt32:forKey: - void encodeInt32_forKey_(int value, objc.NSString key) { - _objc_msgSend_vnkyom( - this.ref.pointer, _sel_encodeInt32_forKey_, value, key.ref.pointer); - } - - /// encodeInt64:forKey: - void encodeInt64_forKey_(int value, objc.NSString key) { - _objc_msgSend_1ruyfmt( - this.ref.pointer, _sel_encodeInt64_forKey_, value, key.ref.pointer); - } - - /// encodeFloat:forKey: - void encodeFloat_forKey_(double value, objc.NSString key) { - _objc_msgSend_6n5aez( - this.ref.pointer, _sel_encodeFloat_forKey_, value, key.ref.pointer); - } - - /// encodeDouble:forKey: - void encodeDouble_forKey_(double value, objc.NSString key) { - _objc_msgSend_13ndgwe( - this.ref.pointer, _sel_encodeDouble_forKey_, value, key.ref.pointer); - } - - /// encodeBytes:length:forKey: - void encodeBytes_length_forKey_( - ffi.Pointer bytes, int length, objc.NSString key) { - _objc_msgSend_6els9k(this.ref.pointer, _sel_encodeBytes_length_forKey_, - bytes, length, key.ref.pointer); - } - - /// requiresSecureCoding - bool get requiresSecureCoding { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_requiresSecureCoding); - } - - /// setRequiresSecureCoding: - set requiresSecureCoding(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setRequiresSecureCoding_, value); - } - - /// new - static NSKeyedArchiver new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSKeyedArchiver, _sel_new); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSKeyedArchiver allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSKeyedArchiver, _sel_allocWithZone_, zone); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSKeyedArchiver alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSKeyedArchiver, _sel_alloc); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSKeyedArchiver, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSKeyedArchiver, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSKeyedArchiver, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSKeyedArchiver, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSKeyedArchiver, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSKeyedArchiver, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSKeyedArchiver, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSKeyedArchiver, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSKeyedArchiver, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSOrthography = objc.getClass("NSOrthography"); -late final _sel_dominantScript = objc.registerName("dominantScript"); -late final _sel_languageMap = objc.registerName("languageMap"); -late final _sel_initWithDominantScript_languageMap_ = - objc.registerName("initWithDominantScript:languageMap:"); -late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); -instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable = - ffi.Pointer.fromFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline) - .cast(); -instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as instancetype Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable = - ffi.Pointer.fromFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. -abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, - objc.NSCoder)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => - objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)>( - objc.newPointerBlock( - _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)> fromFunction( - Dartinstancetype? Function(ffi.Pointer, objc.NSCoder) fn) => - objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>( - objc.newClosureBlock( - _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, objc.NSCoder.castFromPointer(arg1, retain: true, release: true)) - ?.ref - .retainAndReturnPointer() ?? - ffi.nullptr), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. -extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension - on objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> { - Dartinstancetype? call(ffi.Pointer arg0, objc.NSCoder arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>() - (ref.pointer, arg0, arg1.ref.pointer) - .address == - 0 - ? null - : objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast block, ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer), - retain: false, - release: true); -} - -late final _sel_languagesForScript_ = objc.registerName("languagesForScript:"); -late final _sel_dominantLanguageForScript_ = - objc.registerName("dominantLanguageForScript:"); -late final _sel_dominantLanguage = objc.registerName("dominantLanguage"); -late final _sel_allScripts = objc.registerName("allScripts"); -late final _sel_allLanguages = objc.registerName("allLanguages"); -late final _sel_defaultOrthographyForLanguage_ = - objc.registerName("defaultOrthographyForLanguage:"); -late final _sel_orthographyWithDominantScript_languageMap_ = - objc.registerName("orthographyWithDominantScript:languageMap:"); -late final _sel_self = objc.registerName("self"); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock Function(ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(ffi.Pointer)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock Function(ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock Function(ffi.Pointer)> - fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, - (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension on objc - .ObjCBlock Function(ffi.Pointer)> { - objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0), - retain: true, - release: true); -} - -late final _sel_retain = objc.registerName("retain"); -late final _sel_autorelease = objc.registerName("autorelease"); -late final _sel_supportsSecureCoding = - objc.registerName("supportsSecureCoding"); -bool _ObjCBlock_bool_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_bool_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_bool_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_closureTrampoline, false) - .cast(); - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_bool_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunction( - bool Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock(_ObjCBlock_bool_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_bool_ffiVoid_CallExtension - on objc.ObjCBlock)> { - bool call(ffi.Pointer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0); -} - -late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, objc.NSCoder)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock, objc.NSCoder)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - objc.NSCoder)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSCoder)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, objc.NSCoder)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSCoder)> - fromFunction(void Function(ffi.Pointer, objc.NSCoder) fn) => - objc.ObjCBlock, objc.NSCoder)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0, - objc.NSCoder.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock, objc.NSCoder)> - listener(void Function(ffi.Pointer, objc.NSCoder) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); - final wrapper = _AVFAudio_wrapListenerBlock_sjfpmz(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSCoder)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, objc.NSCoder)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension - on objc.ObjCBlock, objc.NSCoder)> { - void call(ffi.Pointer arg0, objc.NSCoder arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); -} - -/// NSOrthography -class NSOrthography extends objc.NSObject { - NSOrthography._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSOrthography] that points to the same underlying object as [other]. - NSOrthography.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSOrthography] that wraps the given raw object pointer. - NSOrthography.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSOrthography]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSOrthography); - } - - /// dominantScript - objc.NSString get dominantScript { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_dominantScript); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// languageMap - objc.NSDictionary get languageMap { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_languageMap); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithDominantScript:languageMap: - NSOrthography initWithDominantScript_languageMap_( - objc.NSString script, objc.NSDictionary map) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithDominantScript_languageMap_, - script.ref.pointer, - map.ref.pointer); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCoder: - NSOrthography? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// languagesForScript: - objc.NSArray? languagesForScript_(objc.NSString script) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_languagesForScript_, script.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// dominantLanguageForScript: - objc.NSString? dominantLanguageForScript_(objc.NSString script) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_dominantLanguageForScript_, script.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// dominantLanguage - objc.NSString get dominantLanguage { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_dominantLanguage); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// allScripts - objc.NSArray get allScripts { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allScripts); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// allLanguages - objc.NSArray get allLanguages { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allLanguages); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// defaultOrthographyForLanguage: - static NSOrthography defaultOrthographyForLanguage_(objc.NSString language) { - final _ret = _objc_msgSend_juohf7(_class_NSOrthography, - _sel_defaultOrthographyForLanguage_, language.ref.pointer); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// orthographyWithDominantScript:languageMap: - static NSOrthography orthographyWithDominantScript_languageMap_( - objc.NSString script, objc.NSDictionary map) { - final _ret = _objc_msgSend_iq11qg( - _class_NSOrthography, - _sel_orthographyWithDominantScript_languageMap_, - script.ref.pointer, - map.ref.pointer); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSOrthography init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSOrthography new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOrthography, _sel_new); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSOrthography allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSOrthography, _sel_allocWithZone_, zone); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSOrthography alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOrthography, _sel_alloc); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSOrthography, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSOrthography, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSOrthography, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSOrthography, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSOrthography, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSOrthography, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSOrthography, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSOrthography, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSOrthography, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// self - NSOrthography self() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_self); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSOrthography retain() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_retain); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSOrthography autorelease() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_autorelease); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_NSOrthography, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _class_NSPort = objc.getClass("NSPort"); -late final _sel_port = objc.registerName("port"); -late final _sel_invalidate = objc.registerName("invalidate"); -late final _sel_isValid = objc.registerName("isValid"); -late final _sel_scheduleInRunLoop_forMode_ = - objc.registerName("scheduleInRunLoop:forMode:"); -late final _sel_removeFromRunLoop_forMode_ = - objc.registerName("removeFromRunLoop:forMode:"); -late final _sel_reservedSpaceLength = objc.registerName("reservedSpaceLength"); -late final _sel_sendBeforeDate_components_from_reserved_ = - objc.registerName("sendBeforeDate:components:from:reserved:"); -final _objc_msgSend_1k87i90 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_sendBeforeDate_msgid_components_from_reserved_ = - objc.registerName("sendBeforeDate:msgid:components:from:reserved:"); -final _objc_msgSend_1sldtak = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _class_NSConnection = objc.getClass("NSConnection"); -late final _sel_statistics = objc.registerName("statistics"); -late final _sel_allConnections = objc.registerName("allConnections"); -late final _sel_defaultConnection = objc.registerName("defaultConnection"); -late final _sel_connectionWithRegisteredName_host_ = - objc.registerName("connectionWithRegisteredName:host:"); -late final _class_NSPortNameServer = objc.getClass("NSPortNameServer"); -late final _sel_systemDefaultPortNameServer = - objc.registerName("systemDefaultPortNameServer"); -late final _sel_portForName_ = objc.registerName("portForName:"); -late final _sel_portForName_host_ = objc.registerName("portForName:host:"); -late final _sel_registerPort_name_ = objc.registerName("registerPort:name:"); -late final _sel_removePortForName_ = objc.registerName("removePortForName:"); - -/// NSPortNameServer -class NSPortNameServer extends objc.NSObject { - NSPortNameServer._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSPortNameServer] that points to the same underlying object as [other]. - NSPortNameServer.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSPortNameServer] that wraps the given raw object pointer. - NSPortNameServer.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSPortNameServer]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSPortNameServer); - } - - /// systemDefaultPortNameServer - static NSPortNameServer systemDefaultPortNameServer() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPortNameServer, _sel_systemDefaultPortNameServer); - return NSPortNameServer.castFromPointer(_ret, retain: true, release: true); - } - - /// portForName: - NSPort? portForName_(objc.NSString name) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_portForName_, name.ref.pointer); - return _ret.address == 0 - ? null - : NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// portForName:host: - NSPort? portForName_host_(objc.NSString name, objc.NSString? host) { - final _ret = _objc_msgSend_iq11qg(this.ref.pointer, _sel_portForName_host_, - name.ref.pointer, host?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// registerPort:name: - bool registerPort_name_(NSPort port, objc.NSString name) { - return _objc_msgSend_1ywe6ev(this.ref.pointer, _sel_registerPort_name_, - port.ref.pointer, name.ref.pointer); - } - - /// removePortForName: - bool removePortForName_(objc.NSString name) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_removePortForName_, name.ref.pointer); - } - - /// init - NSPortNameServer init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSPortNameServer.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSPortNameServer new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPortNameServer, _sel_new); - return NSPortNameServer.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSPortNameServer allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSPortNameServer, _sel_allocWithZone_, zone); - return NSPortNameServer.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSPortNameServer alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPortNameServer, _sel_alloc); - return NSPortNameServer.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSPortNameServer, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSPortNameServer, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSPortNameServer, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSPortNameServer, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSPortNameServer, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSPortNameServer, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSPortNameServer, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPortNameServer, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPortNameServer, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _sel_connectionWithRegisteredName_host_usingNameServer_ = - objc.registerName("connectionWithRegisteredName:host:usingNameServer:"); -final _objc_msgSend_aud7dn = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _class_NSDistantObject = objc.getClass("NSDistantObject"); -late final _sel_proxyWithTarget_connection_ = - objc.registerName("proxyWithTarget:connection:"); -late final _sel_initWithTarget_connection_ = - objc.registerName("initWithTarget:connection:"); -late final _sel_proxyWithLocal_connection_ = - objc.registerName("proxyWithLocal:connection:"); -late final _sel_initWithLocal_connection_ = - objc.registerName("initWithLocal:connection:"); -late final _sel_setProtocolForProxy_ = - objc.registerName("setProtocolForProxy:"); -late final _sel_connectionForProxy = objc.registerName("connectionForProxy"); - -/// NSDistantObject -class NSDistantObject extends objc.NSProxy { - NSDistantObject._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSDistantObject] that points to the same underlying object as [other]. - NSDistantObject.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSDistantObject] that wraps the given raw object pointer. - NSDistantObject.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSDistantObject]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSDistantObject); - } - - /// proxyWithTarget:connection: - static objc.ObjCObjectBase? proxyWithTarget_connection_( - objc.ObjCObjectBase target, NSConnection connection) { - final _ret = _objc_msgSend_iq11qg( - _class_NSDistantObject, - _sel_proxyWithTarget_connection_, - target.ref.pointer, - connection.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithTarget:connection: - NSDistantObject? initWithTarget_connection_( - objc.ObjCObjectBase target, NSConnection connection) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithTarget_connection_, - target.ref.pointer, - connection.ref.pointer); - return _ret.address == 0 - ? null - : NSDistantObject.castFromPointer(_ret, retain: false, release: true); - } - - /// proxyWithLocal:connection: - static objc.ObjCObjectBase proxyWithLocal_connection_( - objc.ObjCObjectBase target, NSConnection connection) { - final _ret = _objc_msgSend_iq11qg( - _class_NSDistantObject, - _sel_proxyWithLocal_connection_, - target.ref.pointer, - connection.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithLocal:connection: - NSDistantObject initWithLocal_connection_( - objc.ObjCObjectBase target, NSConnection connection) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithLocal_connection_, - target.ref.pointer, - connection.ref.pointer); - return NSDistantObject.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCoder: - NSDistantObject? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSDistantObject.castFromPointer(_ret, retain: false, release: true); - } - - /// setProtocolForProxy: - void setProtocolForProxy_(objc.Protocol? proto) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setProtocolForProxy_, - proto?.ref.pointer ?? ffi.nullptr); - } - - /// connectionForProxy - NSConnection get connectionForProxy { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_connectionForProxy); - return NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// alloc - static objc.ObjCObjectBase alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSDistantObject, _sel_alloc); - return objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// self - NSDistantObject self() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_self); - return NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSDistantObject retain() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_retain); - return NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSDistantObject autorelease() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_autorelease); - return NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _sel_rootProxyForConnectionWithRegisteredName_host_ = - objc.registerName("rootProxyForConnectionWithRegisteredName:host:"); -late final _sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_ = - objc.registerName( - "rootProxyForConnectionWithRegisteredName:host:usingNameServer:"); -late final _sel_serviceConnectionWithName_rootObject_usingNameServer_ = - objc.registerName("serviceConnectionWithName:rootObject:usingNameServer:"); -late final _sel_serviceConnectionWithName_rootObject_ = - objc.registerName("serviceConnectionWithName:rootObject:"); -late final _sel_requestTimeout = objc.registerName("requestTimeout"); -late final _sel_setRequestTimeout_ = objc.registerName("setRequestTimeout:"); -final _objc_msgSend_suh039 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_replyTimeout = objc.registerName("replyTimeout"); -late final _sel_setReplyTimeout_ = objc.registerName("setReplyTimeout:"); -late final _sel_rootObject = objc.registerName("rootObject"); -late final _sel_setRootObject_ = objc.registerName("setRootObject:"); -late final _sel_independentConversationQueueing = - objc.registerName("independentConversationQueueing"); -late final _sel_setIndependentConversationQueueing_ = - objc.registerName("setIndependentConversationQueueing:"); -late final _sel_rootProxy = objc.registerName("rootProxy"); -late final _sel_addRequestMode_ = objc.registerName("addRequestMode:"); -late final _sel_removeRequestMode_ = objc.registerName("removeRequestMode:"); -late final _sel_requestModes = objc.registerName("requestModes"); -late final _sel_registerName_ = objc.registerName("registerName:"); -late final _sel_registerName_withNameServer_ = - objc.registerName("registerName:withNameServer:"); -late final _sel_connectionWithReceivePort_sendPort_ = - objc.registerName("connectionWithReceivePort:sendPort:"); -late final _sel_currentConversation = objc.registerName("currentConversation"); -late final _sel_initWithReceivePort_sendPort_ = - objc.registerName("initWithReceivePort:sendPort:"); -late final _sel_sendPort = objc.registerName("sendPort"); -late final _sel_receivePort = objc.registerName("receivePort"); -late final _sel_enableMultipleThreads = - objc.registerName("enableMultipleThreads"); -late final _sel_multipleThreadsEnabled = - objc.registerName("multipleThreadsEnabled"); -late final _sel_addRunLoop_ = objc.registerName("addRunLoop:"); -late final _sel_removeRunLoop_ = objc.registerName("removeRunLoop:"); -late final _sel_runInNewThread = objc.registerName("runInNewThread"); -late final _sel_remoteObjects = objc.registerName("remoteObjects"); -late final _sel_localObjects = objc.registerName("localObjects"); -late final _sel_dispatchWithComponents_ = - objc.registerName("dispatchWithComponents:"); - -/// NSConnection -class NSConnection extends objc.NSObject { - NSConnection._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSConnection] that points to the same underlying object as [other]. - NSConnection.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSConnection] that wraps the given raw object pointer. - NSConnection.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSConnection]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSConnection); - } - - /// statistics - objc.NSDictionary get statistics { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_statistics); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// allConnections - static objc.NSArray allConnections() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSConnection, _sel_allConnections); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// defaultConnection - static NSConnection defaultConnection() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSConnection, _sel_defaultConnection); - return NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// connectionWithRegisteredName:host: - static NSConnection? connectionWithRegisteredName_host_( - objc.NSString name, objc.NSString? hostName) { - final _ret = _objc_msgSend_iq11qg( - _class_NSConnection, - _sel_connectionWithRegisteredName_host_, - name.ref.pointer, - hostName?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// connectionWithRegisteredName:host:usingNameServer: - static NSConnection? connectionWithRegisteredName_host_usingNameServer_( - objc.NSString name, objc.NSString? hostName, NSPortNameServer server) { - final _ret = _objc_msgSend_aud7dn( - _class_NSConnection, - _sel_connectionWithRegisteredName_host_usingNameServer_, - name.ref.pointer, - hostName?.ref.pointer ?? ffi.nullptr, - server.ref.pointer); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// rootProxyForConnectionWithRegisteredName:host: - static NSDistantObject? rootProxyForConnectionWithRegisteredName_host_( - objc.NSString name, objc.NSString? hostName) { - final _ret = _objc_msgSend_iq11qg( - _class_NSConnection, - _sel_rootProxyForConnectionWithRegisteredName_host_, - name.ref.pointer, - hostName?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// rootProxyForConnectionWithRegisteredName:host:usingNameServer: - static NSDistantObject? - rootProxyForConnectionWithRegisteredName_host_usingNameServer_( - objc.NSString name, - objc.NSString? hostName, - NSPortNameServer server) { - final _ret = _objc_msgSend_aud7dn( - _class_NSConnection, - _sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_, - name.ref.pointer, - hostName?.ref.pointer ?? ffi.nullptr, - server.ref.pointer); - return _ret.address == 0 - ? null - : NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// serviceConnectionWithName:rootObject:usingNameServer: - static NSConnection? serviceConnectionWithName_rootObject_usingNameServer_( - objc.NSString name, objc.ObjCObjectBase root, NSPortNameServer server) { - final _ret = _objc_msgSend_aud7dn( - _class_NSConnection, - _sel_serviceConnectionWithName_rootObject_usingNameServer_, - name.ref.pointer, - root.ref.pointer, - server.ref.pointer); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// serviceConnectionWithName:rootObject: - static NSConnection? serviceConnectionWithName_rootObject_( - objc.NSString name, objc.ObjCObjectBase root) { - final _ret = _objc_msgSend_iq11qg( - _class_NSConnection, - _sel_serviceConnectionWithName_rootObject_, - name.ref.pointer, - root.ref.pointer); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// requestTimeout - double get requestTimeout { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_requestTimeout); - } - - /// setRequestTimeout: - set requestTimeout(double value) { - return _objc_msgSend_suh039( - this.ref.pointer, _sel_setRequestTimeout_, value); - } - - /// replyTimeout - double get replyTimeout { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_replyTimeout); - } - - /// setReplyTimeout: - set replyTimeout(double value) { - return _objc_msgSend_suh039(this.ref.pointer, _sel_setReplyTimeout_, value); - } - - /// rootObject - objc.ObjCObjectBase? get rootObject { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_rootObject); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setRootObject: - set rootObject(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setRootObject_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// delegate - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setDelegate: - set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); - } - - /// independentConversationQueueing - bool get independentConversationQueueing { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_independentConversationQueueing); - } - - /// setIndependentConversationQueueing: - set independentConversationQueueing(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setIndependentConversationQueueing_, value); - } - - /// isValid - bool get valid { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isValid); - } - - /// rootProxy - NSDistantObject get rootProxy { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_rootProxy); - return NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// invalidate - void invalidate() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_invalidate); - } - - /// addRequestMode: - void addRequestMode_(objc.NSString rmode) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_addRequestMode_, rmode.ref.pointer); - } - - /// removeRequestMode: - void removeRequestMode_(objc.NSString rmode) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_removeRequestMode_, rmode.ref.pointer); - } - - /// requestModes - objc.NSArray get requestModes { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_requestModes); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// registerName: - bool registerName_(objc.NSString? name) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_registerName_, name?.ref.pointer ?? ffi.nullptr); - } - - /// registerName:withNameServer: - bool registerName_withNameServer_( - objc.NSString? name, NSPortNameServer server) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_registerName_withNameServer_, - name?.ref.pointer ?? ffi.nullptr, - server.ref.pointer); - } - - /// connectionWithReceivePort:sendPort: - static NSConnection? connectionWithReceivePort_sendPort_( - NSPort? receivePort, NSPort? sendPort) { - final _ret = _objc_msgSend_iq11qg( - _class_NSConnection, - _sel_connectionWithReceivePort_sendPort_, - receivePort?.ref.pointer ?? ffi.nullptr, - sendPort?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// currentConversation - static objc.ObjCObjectBase? currentConversation() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSConnection, _sel_currentConversation); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithReceivePort:sendPort: - NSConnection? initWithReceivePort_sendPort_( - NSPort? receivePort, NSPort? sendPort) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithReceivePort_sendPort_, - receivePort?.ref.pointer ?? ffi.nullptr, - sendPort?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// sendPort - NSPort get sendPort { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_sendPort); - return NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// receivePort - NSPort get receivePort { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_receivePort); - return NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// enableMultipleThreads - void enableMultipleThreads() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_enableMultipleThreads); - } - - /// multipleThreadsEnabled - bool get multipleThreadsEnabled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_multipleThreadsEnabled); - } - - /// addRunLoop: - void addRunLoop_(objc.NSRunLoop runloop) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_addRunLoop_, runloop.ref.pointer); - } - - /// removeRunLoop: - void removeRunLoop_(objc.NSRunLoop runloop) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_removeRunLoop_, runloop.ref.pointer); - } - - /// runInNewThread - void runInNewThread() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_runInNewThread); - } - - /// remoteObjects - objc.NSArray get remoteObjects { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_remoteObjects); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// localObjects - objc.NSArray get localObjects { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_localObjects); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// dispatchWithComponents: - void dispatchWithComponents_(objc.NSArray components) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_dispatchWithComponents_, components.ref.pointer); - } - - /// init - NSConnection init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSConnection new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSConnection, _sel_new); - return NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSConnection allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSConnection, _sel_allocWithZone_, zone); - return NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSConnection alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSConnection, _sel_alloc); - return NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSConnection, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSConnection, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSConnection, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSConnection, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSConnection, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSConnection, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSConnection, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSConnection, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSConnection, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _sel_addConnection_toRunLoop_forMode_ = - objc.registerName("addConnection:toRunLoop:forMode:"); -final _objc_msgSend_tenbla = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_removeConnection_fromRunLoop_forMode_ = - objc.registerName("removeConnection:fromRunLoop:forMode:"); - -/// NSPort -class NSPort extends objc.NSObject { - NSPort._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSPort] that points to the same underlying object as [other]. - NSPort.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSPort] that wraps the given raw object pointer. - NSPort.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSPort]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSPort); - } - - /// port - static NSPort port() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPort, _sel_port); - return NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// invalidate - void invalidate() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_invalidate); - } - - /// isValid - bool get valid { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isValid); - } - - /// setDelegate: - void setDelegate_(objc.ObjCObjectBase? anObject) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setDelegate_, - anObject?.ref.pointer ?? ffi.nullptr); - } - - /// delegate - objc.ObjCObjectBase? delegate() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// scheduleInRunLoop:forMode: - void scheduleInRunLoop_forMode_(objc.NSRunLoop runLoop, objc.NSString mode) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_scheduleInRunLoop_forMode_, - runLoop.ref.pointer, mode.ref.pointer); - } - - /// removeFromRunLoop:forMode: - void removeFromRunLoop_forMode_(objc.NSRunLoop runLoop, objc.NSString mode) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_removeFromRunLoop_forMode_, - runLoop.ref.pointer, mode.ref.pointer); - } - - /// reservedSpaceLength - int get reservedSpaceLength { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_reservedSpaceLength); - } - - /// sendBeforeDate:components:from:reserved: - bool sendBeforeDate_components_from_reserved_( - objc.NSDate limitDate, - objc.NSMutableArray? components, - NSPort? receivePort, - int headerSpaceReserved) { - return _objc_msgSend_1k87i90( - this.ref.pointer, - _sel_sendBeforeDate_components_from_reserved_, - limitDate.ref.pointer, - components?.ref.pointer ?? ffi.nullptr, - receivePort?.ref.pointer ?? ffi.nullptr, - headerSpaceReserved); - } - - /// sendBeforeDate:msgid:components:from:reserved: - bool sendBeforeDate_msgid_components_from_reserved_( - objc.NSDate limitDate, - int msgID, - objc.NSMutableArray? components, - NSPort? receivePort, - int headerSpaceReserved) { - return _objc_msgSend_1sldtak( - this.ref.pointer, - _sel_sendBeforeDate_msgid_components_from_reserved_, - limitDate.ref.pointer, - msgID, - components?.ref.pointer ?? ffi.nullptr, - receivePort?.ref.pointer ?? ffi.nullptr, - headerSpaceReserved); - } - - /// addConnection:toRunLoop:forMode: - void addConnection_toRunLoop_forMode_( - NSConnection conn, objc.NSRunLoop runLoop, objc.NSString mode) { - _objc_msgSend_tenbla( - this.ref.pointer, - _sel_addConnection_toRunLoop_forMode_, - conn.ref.pointer, - runLoop.ref.pointer, - mode.ref.pointer); - } - - /// removeConnection:fromRunLoop:forMode: - void removeConnection_fromRunLoop_forMode_( - NSConnection conn, objc.NSRunLoop runLoop, objc.NSString mode) { - _objc_msgSend_tenbla( - this.ref.pointer, - _sel_removeConnection_fromRunLoop_forMode_, - conn.ref.pointer, - runLoop.ref.pointer, - mode.ref.pointer); - } - - /// init - NSPort init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSPort.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSPort new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPort, _sel_new); - return NSPort.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSPort allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSPort, _sel_allocWithZone_, zone); - return NSPort.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSPort alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPort, _sel_alloc); - return NSPort.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSPort, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSPort, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSPort, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSPort, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSPort, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSPort, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSPort, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPort, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSPort, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSPort? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSPort.castFromPointer(_ret, retain: false, release: true); - } -} - -late final _class_NSThread = objc.getClass("NSThread"); -late final _sel_currentThread = objc.registerName("currentThread"); -late final _sel_detachNewThreadWithBlock_ = - objc.registerName("detachNewThreadWithBlock:"); -late final _sel_detachNewThreadSelector_toTarget_withObject_ = - objc.registerName("detachNewThreadSelector:toTarget:withObject:"); -final _objc_msgSend_wr178x = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_isMultiThreaded = objc.registerName("isMultiThreaded"); -late final _sel_threadDictionary = objc.registerName("threadDictionary"); -late final _sel_sleepUntilDate_ = objc.registerName("sleepUntilDate:"); -late final _sel_sleepForTimeInterval_ = - objc.registerName("sleepForTimeInterval:"); -late final _sel_exit = objc.registerName("exit"); -late final _sel_threadPriority = objc.registerName("threadPriority"); -late final _sel_setThreadPriority_ = objc.registerName("setThreadPriority:"); -late final _sel_qualityOfService = objc.registerName("qualityOfService"); -final _objc_msgSend_17dnyeh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setQualityOfService_ = - objc.registerName("setQualityOfService:"); -final _objc_msgSend_1fcr8u4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_callStackReturnAddresses = - objc.registerName("callStackReturnAddresses"); -late final _sel_callStackSymbols = objc.registerName("callStackSymbols"); -late final _sel_name = objc.registerName("name"); -late final _sel_setName_ = objc.registerName("setName:"); -late final _sel_stackSize = objc.registerName("stackSize"); -late final _sel_setStackSize_ = objc.registerName("setStackSize:"); -final _objc_msgSend_1k4zaz5 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_isMainThread = objc.registerName("isMainThread"); -late final _sel_mainThread = objc.registerName("mainThread"); -late final _sel_initWithTarget_selector_object_ = - objc.registerName("initWithTarget:selector:object:"); -final _objc_msgSend_yoiems = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_initWithBlock_ = objc.registerName("initWithBlock:"); -bool _ObjCBlock_bool_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_NSUInteger_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_bool_NSUInteger_bool_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_NSUInteger_bool_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function(int, ffi.Pointer))( - arg0, arg1); -ffi.Pointer _ObjCBlock_bool_NSUInteger_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_bool_NSUInteger_bool_closureTrampoline, false) - .cast(); - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_bool_NSUInteger_bool { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function(ffi.UnsignedLong, ffi.Pointer)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_bool_NSUInteger_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock)> - fromFunction(bool Function(int, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Bool Function(ffi.UnsignedLong, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_bool_NSUInteger_bool_closureCallable, - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1)), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_bool_NSUInteger_bool_CallExtension on objc - .ObjCBlock)> { - bool call(int arg0, ffi.Pointer arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer block, - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, int, - ffi.Pointer)>()(ref.pointer, arg0, arg1); -} - -final _objc_msgSend_3c0puu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isExecuting = objc.registerName("isExecuting"); -late final _sel_start = objc.registerName("start"); -late final _sel_main = objc.registerName("main"); - -/// NSThread -class NSThread extends objc.NSObject { - NSThread._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSThread] that points to the same underlying object as [other]. - NSThread.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSThread] that wraps the given raw object pointer. - NSThread.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSThread]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSThread); - } - - /// currentThread - static NSThread getCurrentThread() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_currentThread); - return NSThread.castFromPointer(_ret, retain: true, release: true); - } - - /// detachNewThreadWithBlock: - static void detachNewThreadWithBlock_( - objc.ObjCBlock block) { - _objc_msgSend_4daxhl( - _class_NSThread, _sel_detachNewThreadWithBlock_, block.ref.pointer); - } - - /// detachNewThreadSelector:toTarget:withObject: - static void detachNewThreadSelector_toTarget_withObject_( - ffi.Pointer selector, - objc.ObjCObjectBase target, - objc.ObjCObjectBase? argument) { - _objc_msgSend_wr178x( - _class_NSThread, - _sel_detachNewThreadSelector_toTarget_withObject_, - selector, - target.ref.pointer, - argument?.ref.pointer ?? ffi.nullptr); - } - - /// isMultiThreaded - static bool isMultiThreaded() { - return _objc_msgSend_olxnu1(_class_NSThread, _sel_isMultiThreaded); - } - - /// threadDictionary - objc.NSMutableDictionary get threadDictionary { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_threadDictionary); - return objc.NSMutableDictionary.castFromPointer(_ret, - retain: true, release: true); - } - - /// sleepUntilDate: - static void sleepUntilDate_(objc.NSDate date) { - _objc_msgSend_ukcdfq( - _class_NSThread, _sel_sleepUntilDate_, date.ref.pointer); - } - - /// sleepForTimeInterval: - static void sleepForTimeInterval_(double ti) { - _objc_msgSend_suh039(_class_NSThread, _sel_sleepForTimeInterval_, ti); - } - - /// exit - static void exit() { - _objc_msgSend_ksby9f(_class_NSThread, _sel_exit); - } - - /// threadPriority - double get threadPriority { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_threadPriority); - } - - /// setThreadPriority: - set threadPriority(double value) { - return _objc_msgSend_suh039( - this.ref.pointer, _sel_setThreadPriority_, value); - } - - /// qualityOfService - NSQualityOfService get qualityOfService { - final _ret = _objc_msgSend_17dnyeh(this.ref.pointer, _sel_qualityOfService); - return NSQualityOfService.fromValue(_ret); - } - - /// setQualityOfService: - set qualityOfService(NSQualityOfService value) { - return _objc_msgSend_1fcr8u4( - this.ref.pointer, _sel_setQualityOfService_, value.value); - } - - /// callStackReturnAddresses - static objc.NSArray getCallStackReturnAddresses() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSThread, _sel_callStackReturnAddresses); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// callStackSymbols - static objc.NSArray getCallStackSymbols() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_callStackSymbols); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// name - objc.NSString? get name { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setName: - set name(objc.NSString? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); - } - - /// stackSize - int get stackSize { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_stackSize); - } - - /// setStackSize: - set stackSize(int value) { - return _objc_msgSend_1k4zaz5(this.ref.pointer, _sel_setStackSize_, value); - } - - /// isMainThread - static bool getIsMainThread() { - return _objc_msgSend_olxnu1(_class_NSThread, _sel_isMainThread); - } - - /// mainThread - static NSThread getMainThread() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_mainThread); - return NSThread.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSThread init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithTarget:selector:object: - NSThread initWithTarget_selector_object_(objc.ObjCObjectBase target, - ffi.Pointer selector, objc.ObjCObjectBase? argument) { - final _ret = _objc_msgSend_yoiems( - this.ref.retainAndReturnPointer(), - _sel_initWithTarget_selector_object_, - target.ref.pointer, - selector, - argument?.ref.pointer ?? ffi.nullptr); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithBlock: - NSThread initWithBlock_(objc.ObjCBlock block) { - final _ret = _objc_msgSend_3c0puu(this.ref.retainAndReturnPointer(), - _sel_initWithBlock_, block.ref.pointer); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// isExecuting - bool get executing { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isExecuting); - } - - /// isFinished - bool get finished { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isFinished); - } - - /// isCancelled - bool get cancelled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancelled); - } - - /// cancel - void cancel() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); - } - - /// start - void start() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_start); - } - - /// main - void main() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_main); - } - - /// new - static NSThread new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_new); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSThread allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSThread, _sel_allocWithZone_, zone); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSThread alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_alloc); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSThread, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSThread, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSThread, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSThread, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSThread, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSThread, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSThread, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSThread, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSThread, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSTimeZone = objc.getClass("NSTimeZone"); -late final _sel_data = objc.registerName("data"); -late final _sel_secondsFromGMTForDate_ = - objc.registerName("secondsFromGMTForDate:"); -final _objc_msgSend_hrsqsi = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_abbreviationForDate_ = - objc.registerName("abbreviationForDate:"); -late final _sel_isDaylightSavingTimeForDate_ = - objc.registerName("isDaylightSavingTimeForDate:"); -late final _sel_daylightSavingTimeOffsetForDate_ = - objc.registerName("daylightSavingTimeOffsetForDate:"); -final _objc_msgSend_om71r5 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_nextDaylightSavingTimeTransitionAfterDate_ = - objc.registerName("nextDaylightSavingTimeTransitionAfterDate:"); -late final _sel_systemTimeZone = objc.registerName("systemTimeZone"); -late final _sel_resetSystemTimeZone = objc.registerName("resetSystemTimeZone"); -late final _sel_defaultTimeZone = objc.registerName("defaultTimeZone"); -late final _sel_setDefaultTimeZone_ = objc.registerName("setDefaultTimeZone:"); -late final _sel_localTimeZone = objc.registerName("localTimeZone"); -late final _sel_knownTimeZoneNames = objc.registerName("knownTimeZoneNames"); -late final _sel_abbreviationDictionary = - objc.registerName("abbreviationDictionary"); -late final _sel_setAbbreviationDictionary_ = - objc.registerName("setAbbreviationDictionary:"); -late final _sel_timeZoneDataVersion = objc.registerName("timeZoneDataVersion"); -late final _sel_secondsFromGMT = objc.registerName("secondsFromGMT"); -final _objc_msgSend_z1fx1b = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_abbreviation = objc.registerName("abbreviation"); -late final _sel_isDaylightSavingTime = - objc.registerName("isDaylightSavingTime"); -late final _sel_daylightSavingTimeOffset = - objc.registerName("daylightSavingTimeOffset"); -late final _sel_nextDaylightSavingTimeTransition = - objc.registerName("nextDaylightSavingTimeTransition"); -late final _sel_description = objc.registerName("description"); -late final _sel_isEqualToTimeZone_ = objc.registerName("isEqualToTimeZone:"); - -enum NSTimeZoneNameStyle { - NSTimeZoneNameStyleStandard(0), - NSTimeZoneNameStyleShortStandard(1), - NSTimeZoneNameStyleDaylightSaving(2), - NSTimeZoneNameStyleShortDaylightSaving(3), - NSTimeZoneNameStyleGeneric(4), - NSTimeZoneNameStyleShortGeneric(5); - - final int value; - const NSTimeZoneNameStyle(this.value); - - static NSTimeZoneNameStyle fromValue(int value) => switch (value) { - 0 => NSTimeZoneNameStyleStandard, - 1 => NSTimeZoneNameStyleShortStandard, - 2 => NSTimeZoneNameStyleDaylightSaving, - 3 => NSTimeZoneNameStyleShortDaylightSaving, - 4 => NSTimeZoneNameStyleGeneric, - 5 => NSTimeZoneNameStyleShortGeneric, - _ => - throw ArgumentError("Unknown value for NSTimeZoneNameStyle: $value"), - }; -} - -late final _sel_localizedName_locale_ = - objc.registerName("localizedName:locale:"); -final _objc_msgSend_1c91ngg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_timeZoneWithName_ = objc.registerName("timeZoneWithName:"); -late final _sel_timeZoneWithName_data_ = - objc.registerName("timeZoneWithName:data:"); -late final _sel_initWithName_ = objc.registerName("initWithName:"); -late final _sel_initWithName_data_ = objc.registerName("initWithName:data:"); -late final _sel_timeZoneForSecondsFromGMT_ = - objc.registerName("timeZoneForSecondsFromGMT:"); -final _objc_msgSend_crtxa9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_timeZoneWithAbbreviation_ = - objc.registerName("timeZoneWithAbbreviation:"); - -/// NSTimeZone -class NSTimeZone extends objc.NSObject { - NSTimeZone._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSTimeZone] that points to the same underlying object as [other]. - NSTimeZone.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSTimeZone] that wraps the given raw object pointer. - NSTimeZone.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSTimeZone]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSTimeZone); - } - - /// name - objc.NSString get name { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// data - objc.NSData get data { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// secondsFromGMTForDate: - int secondsFromGMTForDate_(objc.NSDate aDate) { - return _objc_msgSend_hrsqsi( - this.ref.pointer, _sel_secondsFromGMTForDate_, aDate.ref.pointer); - } - - /// abbreviationForDate: - objc.NSString? abbreviationForDate_(objc.NSDate aDate) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_abbreviationForDate_, aDate.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isDaylightSavingTimeForDate: - bool isDaylightSavingTimeForDate_(objc.NSDate aDate) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isDaylightSavingTimeForDate_, aDate.ref.pointer); - } - - /// daylightSavingTimeOffsetForDate: - double daylightSavingTimeOffsetForDate_(objc.NSDate aDate) { - return _objc_msgSend_om71r5(this.ref.pointer, - _sel_daylightSavingTimeOffsetForDate_, aDate.ref.pointer); - } - - /// nextDaylightSavingTimeTransitionAfterDate: - objc.NSDate? nextDaylightSavingTimeTransitionAfterDate_(objc.NSDate aDate) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_nextDaylightSavingTimeTransitionAfterDate_, aDate.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// systemTimeZone - static NSTimeZone getSystemTimeZone() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_systemTimeZone); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// resetSystemTimeZone - static void resetSystemTimeZone() { - _objc_msgSend_ksby9f(_class_NSTimeZone, _sel_resetSystemTimeZone); - } - - /// defaultTimeZone - static NSTimeZone getDefaultTimeZone() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_defaultTimeZone); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// setDefaultTimeZone: - static void setDefaultTimeZone(NSTimeZone value) { - return _objc_msgSend_ukcdfq( - _class_NSTimeZone, _sel_setDefaultTimeZone_, value.ref.pointer); - } - - /// localTimeZone - static NSTimeZone getLocalTimeZone() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_localTimeZone); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// knownTimeZoneNames - static objc.NSArray getKnownTimeZoneNames() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_knownTimeZoneNames); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// abbreviationDictionary - static objc.NSDictionary getAbbreviationDictionary() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_abbreviationDictionary); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// setAbbreviationDictionary: - static void setAbbreviationDictionary(objc.NSDictionary value) { - return _objc_msgSend_ukcdfq( - _class_NSTimeZone, _sel_setAbbreviationDictionary_, value.ref.pointer); - } - - /// timeZoneDataVersion - static objc.NSString getTimeZoneDataVersion() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_timeZoneDataVersion); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// secondsFromGMT - int get secondsFromGMT { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_secondsFromGMT); - } - - /// abbreviation - objc.NSString? get abbreviation { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_abbreviation); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isDaylightSavingTime - bool get daylightSavingTime { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isDaylightSavingTime); - } - - /// daylightSavingTimeOffset - double get daylightSavingTimeOffset { - return _objc_msgSend_10noklm( - this.ref.pointer, _sel_daylightSavingTimeOffset); - } - - /// nextDaylightSavingTimeTransition - objc.NSDate? get nextDaylightSavingTimeTransition { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_nextDaylightSavingTimeTransition); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// description - objc.NSString get description { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_description); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isEqualToTimeZone: - bool isEqualToTimeZone_(NSTimeZone aTimeZone) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isEqualToTimeZone_, aTimeZone.ref.pointer); - } - - /// localizedName:locale: - objc.NSString? localizedName_locale_( - NSTimeZoneNameStyle style, objc.NSLocale? locale) { - final _ret = _objc_msgSend_1c91ngg( - this.ref.pointer, - _sel_localizedName_locale_, - style.value, - locale?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// timeZoneWithName: - static NSTimeZone? timeZoneWithName_(objc.NSString tzName) { - final _ret = _objc_msgSend_juohf7( - _class_NSTimeZone, _sel_timeZoneWithName_, tzName.ref.pointer); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// timeZoneWithName:data: - static NSTimeZone? timeZoneWithName_data_( - objc.NSString tzName, objc.NSData? aData) { - final _ret = _objc_msgSend_iq11qg( - _class_NSTimeZone, - _sel_timeZoneWithName_data_, - tzName.ref.pointer, - aData?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithName: - NSTimeZone? initWithName_(objc.NSString tzName) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithName_, tzName.ref.pointer); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithName:data: - NSTimeZone? initWithName_data_(objc.NSString tzName, objc.NSData? aData) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithName_data_, - tzName.ref.pointer, - aData?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// timeZoneForSecondsFromGMT: - static NSTimeZone timeZoneForSecondsFromGMT_(int seconds) { - final _ret = _objc_msgSend_crtxa9( - _class_NSTimeZone, _sel_timeZoneForSecondsFromGMT_, seconds); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// timeZoneWithAbbreviation: - static NSTimeZone? timeZoneWithAbbreviation_(objc.NSString abbreviation) { - final _ret = _objc_msgSend_juohf7(_class_NSTimeZone, - _sel_timeZoneWithAbbreviation_, abbreviation.ref.pointer); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSTimeZone init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSTimeZone new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_new); - return NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSTimeZone allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSTimeZone, _sel_allocWithZone_, zone); - return NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSTimeZone alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_alloc); - return NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSTimeZone, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSTimeZone, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSTimeZone, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSTimeZone, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSTimeZone, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSTimeZone, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSTimeZone, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSTimeZone, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1(_class_NSTimeZone, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSTimeZone? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } -} - -late final _class_NSTimer = objc.getClass("NSTimer"); -late final _sel_timerWithTimeInterval_invocation_repeats_ = - objc.registerName("timerWithTimeInterval:invocation:repeats:"); -final _objc_msgSend_1dbp0rg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer, - bool)>(); -late final _sel_scheduledTimerWithTimeInterval_invocation_repeats_ = - objc.registerName("scheduledTimerWithTimeInterval:invocation:repeats:"); -late final _sel_timerWithTimeInterval_target_selector_userInfo_repeats_ = objc - .registerName("timerWithTimeInterval:target:selector:userInfo:repeats:"); -final _objc_msgSend_hkb6jt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_ = - objc.registerName( - "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"); -void _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSTimer_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSTimer_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSTimer_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTimer_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSTimer_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSTimer_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSTimer_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSTimer { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSTimer_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(NSTimer) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSTimer_closureCallable, - (ffi.Pointer arg0) => fn( - NSTimer.castFromPointer(arg0, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSTimer) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSTimer_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => - fn(NSTimer.castFromPointer(arg0, retain: false, release: true))); - final wrapper = _AVFAudio_wrapListenerBlock_ukcdfq(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSTimer_CallExtension - on objc.ObjCBlock { - void call(NSTimer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0.ref.pointer); -} - -late final _sel_timerWithTimeInterval_repeats_block_ = - objc.registerName("timerWithTimeInterval:repeats:block:"); -final _objc_msgSend_1t6yrah = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Bool, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - double, - bool, - ffi.Pointer)>(); -late final _sel_scheduledTimerWithTimeInterval_repeats_block_ = - objc.registerName("scheduledTimerWithTimeInterval:repeats:block:"); -late final _sel_initWithFireDate_interval_repeats_block_ = - objc.registerName("initWithFireDate:interval:repeats:block:"); -final _objc_msgSend_tzx95k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Bool, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - double, - bool, - ffi.Pointer)>(); -late final _sel_initWithFireDate_interval_target_selector_userInfo_repeats_ = - objc.registerName( - "initWithFireDate:interval:target:selector:userInfo:repeats:"); -final _objc_msgSend_1mx2fnc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_fire = objc.registerName("fire"); -late final _sel_fireDate = objc.registerName("fireDate"); -late final _sel_setFireDate_ = objc.registerName("setFireDate:"); -late final _sel_timeInterval = objc.registerName("timeInterval"); -late final _sel_tolerance = objc.registerName("tolerance"); -late final _sel_setTolerance_ = objc.registerName("setTolerance:"); - -/// NSTimer -class NSTimer extends objc.NSObject { - NSTimer._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSTimer] that points to the same underlying object as [other]. - NSTimer.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSTimer] that wraps the given raw object pointer. - NSTimer.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSTimer]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSTimer); - } - - /// timerWithTimeInterval:invocation:repeats: - static NSTimer timerWithTimeInterval_invocation_repeats_( - double ti, objc.NSInvocation invocation, bool yesOrNo) { - final _ret = _objc_msgSend_1dbp0rg( - _class_NSTimer, - _sel_timerWithTimeInterval_invocation_repeats_, - ti, - invocation.ref.pointer, - yesOrNo); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// scheduledTimerWithTimeInterval:invocation:repeats: - static NSTimer scheduledTimerWithTimeInterval_invocation_repeats_( - double ti, objc.NSInvocation invocation, bool yesOrNo) { - final _ret = _objc_msgSend_1dbp0rg( - _class_NSTimer, - _sel_scheduledTimerWithTimeInterval_invocation_repeats_, - ti, - invocation.ref.pointer, - yesOrNo); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// timerWithTimeInterval:target:selector:userInfo:repeats: - static NSTimer timerWithTimeInterval_target_selector_userInfo_repeats_( - double ti, - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? userInfo, - bool yesOrNo) { - final _ret = _objc_msgSend_hkb6jt( - _class_NSTimer, - _sel_timerWithTimeInterval_target_selector_userInfo_repeats_, - ti, - aTarget.ref.pointer, - aSelector, - userInfo?.ref.pointer ?? ffi.nullptr, - yesOrNo); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: - static NSTimer - scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( - double ti, - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? userInfo, - bool yesOrNo) { - final _ret = _objc_msgSend_hkb6jt( - _class_NSTimer, - _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_, - ti, - aTarget.ref.pointer, - aSelector, - userInfo?.ref.pointer ?? ffi.nullptr, - yesOrNo); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// timerWithTimeInterval:repeats:block: - static NSTimer timerWithTimeInterval_repeats_block_(double interval, - bool repeats, objc.ObjCBlock block) { - final _ret = _objc_msgSend_1t6yrah( - _class_NSTimer, - _sel_timerWithTimeInterval_repeats_block_, - interval, - repeats, - block.ref.pointer); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// scheduledTimerWithTimeInterval:repeats:block: - static NSTimer scheduledTimerWithTimeInterval_repeats_block_(double interval, - bool repeats, objc.ObjCBlock block) { - final _ret = _objc_msgSend_1t6yrah( - _class_NSTimer, - _sel_scheduledTimerWithTimeInterval_repeats_block_, - interval, - repeats, - block.ref.pointer); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithFireDate:interval:repeats:block: - NSTimer initWithFireDate_interval_repeats_block_( - objc.NSDate date, - double interval, - bool repeats, - objc.ObjCBlock block) { - final _ret = _objc_msgSend_tzx95k( - this.ref.retainAndReturnPointer(), - _sel_initWithFireDate_interval_repeats_block_, - date.ref.pointer, - interval, - repeats, - block.ref.pointer); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithFireDate:interval:target:selector:userInfo:repeats: - NSTimer initWithFireDate_interval_target_selector_userInfo_repeats_( - objc.NSDate date, - double ti, - objc.ObjCObjectBase t, - ffi.Pointer s, - objc.ObjCObjectBase? ui, - bool rep) { - final _ret = _objc_msgSend_1mx2fnc( - this.ref.retainAndReturnPointer(), - _sel_initWithFireDate_interval_target_selector_userInfo_repeats_, - date.ref.pointer, - ti, - t.ref.pointer, - s, - ui?.ref.pointer ?? ffi.nullptr, - rep); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// fire - void fire() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_fire); - } - - /// fireDate - objc.NSDate get fireDate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fireDate); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// setFireDate: - set fireDate(objc.NSDate value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setFireDate_, value.ref.pointer); - } - - /// timeInterval - double get timeInterval { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_timeInterval); - } - - /// tolerance - double get tolerance { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_tolerance); - } - - /// setTolerance: - set tolerance(double value) { - return _objc_msgSend_suh039(this.ref.pointer, _sel_setTolerance_, value); - } - - /// invalidate - void invalidate() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_invalidate); - } - - /// isValid - bool get valid { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isValid); - } - - /// userInfo - objc.ObjCObjectBase? get userInfo { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// init - NSTimer init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSTimer new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimer, _sel_new); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSTimer allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSTimer, _sel_allocWithZone_, zone); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSTimer alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimer, _sel_alloc); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSTimer, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSTimer, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSTimer, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSTimer, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSTimer, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSTimer, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSTimer, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSTimer, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimer, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -final class OpaqueAEDataStorageType extends ffi.Opaque {} - -@ffi.Packed(2) -final class AEDesc extends ffi.Struct { - @ffi.UnsignedInt() - external int descriptorType; - - external ffi.Pointer> dataHandle; -} - -late final _class_NSPredicate = objc.getClass("NSPredicate"); -late final _sel_predicateWithFormat_argumentArray_ = - objc.registerName("predicateWithFormat:argumentArray:"); -late final _sel_predicateWithFormat_ = - objc.registerName("predicateWithFormat:"); -late final _sel_predicateFromMetadataQueryString_ = - objc.registerName("predicateFromMetadataQueryString:"); -late final _sel_predicateWithValue_ = objc.registerName("predicateWithValue:"); -bool _ObjCBlock_bool_objcObjCObject_NSDictionary_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_NSDictionary_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_NSDictionary_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_objcObjCObject_NSDictionary_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_NSDictionary_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_NSDictionary_closureTrampoline, - false) - .cast(); - -/// Construction methods for `objc.ObjCBlock?, objc.NSDictionary?)>`. -abstract final class ObjCBlock_bool_objcObjCObject_NSDictionary { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer?, objc.NSDictionary?)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer?, objc.NSDictionary?)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?, objc.NSDictionary?)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock?, objc.NSDictionary?)>( - objc.newPointerBlock(_ObjCBlock_bool_objcObjCObject_NSDictionary_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?, objc.NSDictionary?)> fromFunction( - bool Function(objc.ObjCObjectBase?, objc.NSDictionary?) fn) => - objc.ObjCBlock?, objc.NSDictionary?)>( - objc.newClosureBlock( - _ObjCBlock_bool_objcObjCObject_NSDictionary_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : objc.ObjCObjectBase(arg0, retain: true, release: true), - arg1.address == 0 - ? null - : objc.NSDictionary.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock?, objc.NSDictionary?)>`. -extension ObjCBlock_bool_objcObjCObject_NSDictionary_CallExtension - on objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer?, objc.NSDictionary?)> { - bool call(objc.ObjCObjectBase? arg0, objc.NSDictionary? arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_predicateWithBlock_ = objc.registerName("predicateWithBlock:"); -late final _sel_predicateFormat = objc.registerName("predicateFormat"); -late final _sel_predicateWithSubstitutionVariables_ = - objc.registerName("predicateWithSubstitutionVariables:"); -late final _sel_evaluateWithObject_ = objc.registerName("evaluateWithObject:"); -late final _sel_evaluateWithObject_substitutionVariables_ = - objc.registerName("evaluateWithObject:substitutionVariables:"); -late final _sel_allowEvaluation = objc.registerName("allowEvaluation"); - -/// NSPredicate -class NSPredicate extends objc.NSObject { - NSPredicate._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSPredicate] that points to the same underlying object as [other]. - NSPredicate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSPredicate] that wraps the given raw object pointer. - NSPredicate.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSPredicate]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSPredicate); - } - - /// predicateWithFormat:argumentArray: - static NSPredicate predicateWithFormat_argumentArray_( - objc.NSString predicateFormat, objc.NSArray? arguments) { - final _ret = _objc_msgSend_iq11qg( - _class_NSPredicate, - _sel_predicateWithFormat_argumentArray_, - predicateFormat.ref.pointer, - arguments?.ref.pointer ?? ffi.nullptr); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateWithFormat: - static NSPredicate predicateWithFormat_(objc.NSString predicateFormat) { - final _ret = _objc_msgSend_juohf7(_class_NSPredicate, - _sel_predicateWithFormat_, predicateFormat.ref.pointer); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateFromMetadataQueryString: - static NSPredicate? predicateFromMetadataQueryString_( - objc.NSString queryString) { - final _ret = _objc_msgSend_juohf7(_class_NSPredicate, - _sel_predicateFromMetadataQueryString_, queryString.ref.pointer); - return _ret.address == 0 - ? null - : NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateWithValue: - static NSPredicate predicateWithValue_(bool value) { - final _ret = _objc_msgSend_1upz917( - _class_NSPredicate, _sel_predicateWithValue_, value); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateWithBlock: - static NSPredicate predicateWithBlock_( - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer?, objc.NSDictionary?)> - block) { - final _ret = _objc_msgSend_3c0puu( - _class_NSPredicate, _sel_predicateWithBlock_, block.ref.pointer); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateFormat - objc.NSString get predicateFormat { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_predicateFormat); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateWithSubstitutionVariables: - NSPredicate predicateWithSubstitutionVariables_(objc.NSDictionary variables) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_predicateWithSubstitutionVariables_, variables.ref.pointer); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// evaluateWithObject: - bool evaluateWithObject_(objc.ObjCObjectBase? object) { - return _objc_msgSend_l8lotg(this.ref.pointer, _sel_evaluateWithObject_, - object?.ref.pointer ?? ffi.nullptr); - } - - /// evaluateWithObject:substitutionVariables: - bool evaluateWithObject_substitutionVariables_( - objc.ObjCObjectBase? object, objc.NSDictionary? bindings) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_evaluateWithObject_substitutionVariables_, - object?.ref.pointer ?? ffi.nullptr, - bindings?.ref.pointer ?? ffi.nullptr); - } - - /// allowEvaluation - void allowEvaluation() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_allowEvaluation); - } - - /// init - NSPredicate init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSPredicate.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSPredicate new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPredicate, _sel_new); - return NSPredicate.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSPredicate allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSPredicate, _sel_allocWithZone_, zone); - return NSPredicate.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSPredicate alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPredicate, _sel_alloc); - return NSPredicate.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSPredicate, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSPredicate, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSPredicate, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSPredicate, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSPredicate, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSPredicate, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSPredicate, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPredicate, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSPredicate, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1(_class_NSPredicate, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSPredicate? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSPredicate.castFromPointer(_ret, retain: false, release: true); - } -} - -enum NSLinguisticTaggerOptions { - NSLinguisticTaggerOmitWords(1), - NSLinguisticTaggerOmitPunctuation(2), - NSLinguisticTaggerOmitWhitespace(4), - NSLinguisticTaggerOmitOther(8), - NSLinguisticTaggerJoinNames(16); - - final int value; - const NSLinguisticTaggerOptions(this.value); - - static NSLinguisticTaggerOptions fromValue(int value) => switch (value) { - 1 => NSLinguisticTaggerOmitWords, - 2 => NSLinguisticTaggerOmitPunctuation, - 4 => NSLinguisticTaggerOmitWhitespace, - 8 => NSLinguisticTaggerOmitOther, - 16 => NSLinguisticTaggerJoinNames, - _ => throw ArgumentError( - "Unknown value for NSLinguisticTaggerOptions: $value"), - }; -} - -late final _class_NSArchiver = objc.getClass("NSArchiver"); -late final _sel_archiverData = objc.registerName("archiverData"); -late final _sel_encodeRootObject_ = objc.registerName("encodeRootObject:"); -late final _sel_encodeConditionalObject_ = - objc.registerName("encodeConditionalObject:"); -late final _sel_encodeClassName_intoClassName_ = - objc.registerName("encodeClassName:intoClassName:"); -late final _sel_classNameEncodedForTrueClassName_ = - objc.registerName("classNameEncodedForTrueClassName:"); -late final _sel_replaceObject_withObject_ = - objc.registerName("replaceObject:withObject:"); - -/// NSArchiver -class NSArchiver extends objc.NSCoder { - NSArchiver._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSArchiver] that points to the same underlying object as [other]. - NSArchiver.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSArchiver] that wraps the given raw object pointer. - NSArchiver.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSArchiver]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSArchiver); - } - - /// initForWritingWithMutableData: - NSArchiver initForWritingWithMutableData_(objc.NSMutableData mdata) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initForWritingWithMutableData_, mdata.ref.pointer); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// archiverData - objc.NSMutableData get archiverData { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_archiverData); - return objc.NSMutableData.castFromPointer(_ret, - retain: true, release: true); - } - - /// encodeRootObject: - void encodeRootObject_(objc.ObjCObjectBase rootObject) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeRootObject_, rootObject.ref.pointer); - } - - /// encodeConditionalObject: - void encodeConditionalObject_(objc.ObjCObjectBase? object) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_encodeConditionalObject_, - object?.ref.pointer ?? ffi.nullptr); - } - - /// archivedDataWithRootObject: - static objc.NSData archivedDataWithRootObject_( - objc.ObjCObjectBase rootObject) { - final _ret = _objc_msgSend_juohf7(_class_NSArchiver, - _sel_archivedDataWithRootObject_, rootObject.ref.pointer); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// archiveRootObject:toFile: - static bool archiveRootObject_toFile_( - objc.ObjCObjectBase rootObject, objc.NSString path) { - return _objc_msgSend_1ywe6ev( - _class_NSArchiver, - _sel_archiveRootObject_toFile_, - rootObject.ref.pointer, - path.ref.pointer); - } - - /// encodeClassName:intoClassName: - void encodeClassName_intoClassName_( - objc.NSString trueName, objc.NSString inArchiveName) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_encodeClassName_intoClassName_, - trueName.ref.pointer, inArchiveName.ref.pointer); - } - - /// classNameEncodedForTrueClassName: - objc.NSString? classNameEncodedForTrueClassName_(objc.NSString trueName) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_classNameEncodedForTrueClassName_, trueName.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// replaceObject:withObject: - void replaceObject_withObject_( - objc.ObjCObjectBase object, objc.ObjCObjectBase newObject) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_replaceObject_withObject_, - object.ref.pointer, newObject.ref.pointer); - } - - /// init - NSArchiver init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSArchiver new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSArchiver, _sel_new); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSArchiver allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSArchiver, _sel_allocWithZone_, zone); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSArchiver alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSArchiver, _sel_alloc); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSArchiver, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSArchiver, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSArchiver, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSArchiver, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSArchiver, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSArchiver, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSArchiver, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSArchiver, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSArchiver, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSCalendarDate = objc.getClass("NSCalendarDate"); -late final _sel_calendarDate = objc.registerName("calendarDate"); -late final _sel_dateWithString_calendarFormat_locale_ = - objc.registerName("dateWithString:calendarFormat:locale:"); -late final _sel_dateWithString_calendarFormat_ = - objc.registerName("dateWithString:calendarFormat:"); -late final _sel_dateWithYear_month_day_hour_minute_second_timeZone_ = - objc.registerName("dateWithYear:month:day:hour:minute:second:timeZone:"); -final _objc_msgSend_12rwmwu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - int, - int, - int, - ffi.Pointer)>(); -late final _sel_dateByAddingYears_months_days_hours_minutes_seconds_ = - objc.registerName("dateByAddingYears:months:days:hours:minutes:seconds:"); -final _objc_msgSend_1kw3lvq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, int, int, int, int)>(); -late final _sel_dayOfCommonEra = objc.registerName("dayOfCommonEra"); -late final _sel_dayOfMonth = objc.registerName("dayOfMonth"); -late final _sel_dayOfWeek = objc.registerName("dayOfWeek"); -late final _sel_dayOfYear = objc.registerName("dayOfYear"); -late final _sel_hourOfDay = objc.registerName("hourOfDay"); -late final _sel_minuteOfHour = objc.registerName("minuteOfHour"); -late final _sel_monthOfYear = objc.registerName("monthOfYear"); -late final _sel_secondOfMinute = objc.registerName("secondOfMinute"); -late final _sel_yearOfCommonEra = objc.registerName("yearOfCommonEra"); -late final _sel_calendarFormat = objc.registerName("calendarFormat"); -late final _sel_descriptionWithCalendarFormat_locale_ = - objc.registerName("descriptionWithCalendarFormat:locale:"); -late final _sel_descriptionWithCalendarFormat_ = - objc.registerName("descriptionWithCalendarFormat:"); -late final _sel_descriptionWithLocale_ = - objc.registerName("descriptionWithLocale:"); -late final _sel_timeZone = objc.registerName("timeZone"); -late final _sel_initWithString_calendarFormat_locale_ = - objc.registerName("initWithString:calendarFormat:locale:"); -late final _sel_initWithString_calendarFormat_ = - objc.registerName("initWithString:calendarFormat:"); -late final _sel_initWithString_ = objc.registerName("initWithString:"); -late final _sel_initWithYear_month_day_hour_minute_second_timeZone_ = - objc.registerName("initWithYear:month:day:hour:minute:second:timeZone:"); -late final _sel_setCalendarFormat_ = objc.registerName("setCalendarFormat:"); -late final _sel_setTimeZone_ = objc.registerName("setTimeZone:"); -late final _sel_years_months_days_hours_minutes_seconds_sinceDate_ = - objc.registerName("years:months:days:hours:minutes:seconds:sinceDate:"); -final _objc_msgSend_1lu4cmc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_distantFuture = objc.registerName("distantFuture"); -late final _sel_distantPast = objc.registerName("distantPast"); -late final _sel_timeIntervalSinceReferenceDate = - objc.registerName("timeIntervalSinceReferenceDate"); -late final _sel_initWithTimeIntervalSinceReferenceDate_ = - objc.registerName("initWithTimeIntervalSinceReferenceDate:"); -final _objc_msgSend_m7jc8y = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_dateByAddingTimeInterval_ = - objc.registerName("dateByAddingTimeInterval:"); -late final _sel_date = objc.registerName("date"); -late final _sel_dateWithTimeIntervalSinceNow_ = - objc.registerName("dateWithTimeIntervalSinceNow:"); -late final _sel_dateWithTimeIntervalSinceReferenceDate_ = - objc.registerName("dateWithTimeIntervalSinceReferenceDate:"); -late final _sel_dateWithTimeIntervalSince1970_ = - objc.registerName("dateWithTimeIntervalSince1970:"); -late final _sel_dateWithTimeInterval_sinceDate_ = - objc.registerName("dateWithTimeInterval:sinceDate:"); -final _objc_msgSend_m6z6pt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); -late final _sel_now = objc.registerName("now"); -late final _sel_initWithTimeIntervalSinceNow_ = - objc.registerName("initWithTimeIntervalSinceNow:"); -late final _sel_initWithTimeIntervalSince1970_ = - objc.registerName("initWithTimeIntervalSince1970:"); -late final _sel_initWithTimeInterval_sinceDate_ = - objc.registerName("initWithTimeInterval:sinceDate:"); -late final _sel_dateWithNaturalLanguageString_locale_ = - objc.registerName("dateWithNaturalLanguageString:locale:"); -late final _sel_dateWithNaturalLanguageString_ = - objc.registerName("dateWithNaturalLanguageString:"); -late final _sel_dateWithString_ = objc.registerName("dateWithString:"); - -/// NSCalendarDate -class NSCalendarDate extends objc.NSDate { - NSCalendarDate._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSCalendarDate] that points to the same underlying object as [other]. - NSCalendarDate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSCalendarDate] that wraps the given raw object pointer. - NSCalendarDate.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSCalendarDate]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSCalendarDate); - } - - /// calendarDate - static objc.ObjCObjectBase calendarDate() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_calendarDate); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithString:calendarFormat:locale: - static objc.ObjCObjectBase? dateWithString_calendarFormat_locale_( - objc.NSString description, - objc.NSString format, - objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_aud7dn( - _class_NSCalendarDate, - _sel_dateWithString_calendarFormat_locale_, - description.ref.pointer, - format.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithString:calendarFormat: - static objc.ObjCObjectBase? dateWithString_calendarFormat_( - objc.NSString description, objc.NSString format) { - final _ret = _objc_msgSend_iq11qg( - _class_NSCalendarDate, - _sel_dateWithString_calendarFormat_, - description.ref.pointer, - format.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithYear:month:day:hour:minute:second:timeZone: - static objc.ObjCObjectBase - dateWithYear_month_day_hour_minute_second_timeZone_(int year, int month, - int day, int hour, int minute, int second, NSTimeZone? aTimeZone) { - final _ret = _objc_msgSend_12rwmwu( - _class_NSCalendarDate, - _sel_dateWithYear_month_day_hour_minute_second_timeZone_, - year, - month, - day, - hour, - minute, - second, - aTimeZone?.ref.pointer ?? ffi.nullptr); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateByAddingYears:months:days:hours:minutes:seconds: - NSCalendarDate dateByAddingYears_months_days_hours_minutes_seconds_( - int year, int month, int day, int hour, int minute, int second) { - final _ret = _objc_msgSend_1kw3lvq( - this.ref.pointer, - _sel_dateByAddingYears_months_days_hours_minutes_seconds_, - year, - month, - day, - hour, - minute, - second); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dayOfCommonEra - int dayOfCommonEra() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_dayOfCommonEra); - } - - /// dayOfMonth - int dayOfMonth() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_dayOfMonth); - } - - /// dayOfWeek - int dayOfWeek() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_dayOfWeek); - } - - /// dayOfYear - int dayOfYear() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_dayOfYear); - } - - /// hourOfDay - int hourOfDay() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_hourOfDay); - } - - /// minuteOfHour - int minuteOfHour() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_minuteOfHour); - } - - /// monthOfYear - int monthOfYear() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_monthOfYear); - } - - /// secondOfMinute - int secondOfMinute() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_secondOfMinute); - } - - /// yearOfCommonEra - int yearOfCommonEra() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_yearOfCommonEra); - } - - /// calendarFormat - objc.NSString calendarFormat() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_calendarFormat); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithCalendarFormat:locale: - objc.NSString descriptionWithCalendarFormat_locale_( - objc.NSString format, objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_iq11qg( - this.ref.pointer, - _sel_descriptionWithCalendarFormat_locale_, - format.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithCalendarFormat: - objc.NSString descriptionWithCalendarFormat_(objc.NSString format) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_descriptionWithCalendarFormat_, format.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithLocale: - objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// timeZone - NSTimeZone timeZone() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_timeZone); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithString:calendarFormat:locale: - objc.ObjCObjectBase? initWithString_calendarFormat_locale_( - objc.NSString description, - objc.NSString format, - objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithString_calendarFormat_locale_, - description.ref.pointer, - format.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithString:calendarFormat: - objc.ObjCObjectBase? initWithString_calendarFormat_( - objc.NSString description, objc.NSString format) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithString_calendarFormat_, - description.ref.pointer, - format.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithString: - objc.ObjCObjectBase? initWithString_(objc.NSString description) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithString_, description.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithYear:month:day:hour:minute:second:timeZone: - objc.ObjCObjectBase initWithYear_month_day_hour_minute_second_timeZone_( - int year, - int month, - int day, - int hour, - int minute, - int second, - NSTimeZone? aTimeZone) { - final _ret = _objc_msgSend_12rwmwu( - this.ref.retainAndReturnPointer(), - _sel_initWithYear_month_day_hour_minute_second_timeZone_, - year, - month, - day, - hour, - minute, - second, - aTimeZone?.ref.pointer ?? ffi.nullptr); - return objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// setCalendarFormat: - void setCalendarFormat_(objc.NSString? format) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setCalendarFormat_, - format?.ref.pointer ?? ffi.nullptr); - } - - /// setTimeZone: - void setTimeZone_(NSTimeZone? aTimeZone) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setTimeZone_, - aTimeZone?.ref.pointer ?? ffi.nullptr); - } - - /// years:months:days:hours:minutes:seconds:sinceDate: - void years_months_days_hours_minutes_seconds_sinceDate_( - ffi.Pointer yp, - ffi.Pointer mop, - ffi.Pointer dp, - ffi.Pointer hp, - ffi.Pointer mip, - ffi.Pointer sp, - NSCalendarDate date) { - _objc_msgSend_1lu4cmc( - this.ref.pointer, - _sel_years_months_days_hours_minutes_seconds_sinceDate_, - yp, - mop, - dp, - hp, - mip, - sp, - date.ref.pointer); - } - - /// distantFuture - static objc.NSDate getDistantFuture() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_distantFuture); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// distantPast - static objc.NSDate getDistantPast() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_distantPast); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// timeIntervalSinceReferenceDate - static double getTimeIntervalSinceReferenceDate() { - return _objc_msgSend_10noklm( - _class_NSCalendarDate, _sel_timeIntervalSinceReferenceDate); - } - - /// init - NSCalendarDate init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithTimeIntervalSinceReferenceDate: - NSCalendarDate initWithTimeIntervalSinceReferenceDate_(double ti) { - final _ret = _objc_msgSend_m7jc8y(this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSinceReferenceDate_, ti); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCoder: - NSCalendarDate? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// dateByAddingTimeInterval: - NSCalendarDate dateByAddingTimeInterval_(double ti) { - final _ret = _objc_msgSend_m7jc8y( - this.ref.pointer, _sel_dateByAddingTimeInterval_, ti); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// date - static NSCalendarDate date() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_date); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dateWithTimeIntervalSinceNow: - static NSCalendarDate dateWithTimeIntervalSinceNow_(double secs) { - final _ret = _objc_msgSend_m7jc8y( - _class_NSCalendarDate, _sel_dateWithTimeIntervalSinceNow_, secs); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dateWithTimeIntervalSinceReferenceDate: - static NSCalendarDate dateWithTimeIntervalSinceReferenceDate_(double ti) { - final _ret = _objc_msgSend_m7jc8y(_class_NSCalendarDate, - _sel_dateWithTimeIntervalSinceReferenceDate_, ti); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dateWithTimeIntervalSince1970: - static NSCalendarDate dateWithTimeIntervalSince1970_(double secs) { - final _ret = _objc_msgSend_m7jc8y( - _class_NSCalendarDate, _sel_dateWithTimeIntervalSince1970_, secs); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dateWithTimeInterval:sinceDate: - static NSCalendarDate dateWithTimeInterval_sinceDate_( - double secsToBeAdded, objc.NSDate date) { - final _ret = _objc_msgSend_m6z6pt(_class_NSCalendarDate, - _sel_dateWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// now - static objc.NSDate getNow() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_now); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithTimeIntervalSinceNow: - NSCalendarDate initWithTimeIntervalSinceNow_(double secs) { - final _ret = _objc_msgSend_m7jc8y(this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSinceNow_, secs); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithTimeIntervalSince1970: - NSCalendarDate initWithTimeIntervalSince1970_(double secs) { - final _ret = _objc_msgSend_m7jc8y(this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSince1970_, secs); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithTimeInterval:sinceDate: - NSCalendarDate initWithTimeInterval_sinceDate_( - double secsToBeAdded, objc.NSDate date) { - final _ret = _objc_msgSend_m6z6pt(this.ref.retainAndReturnPointer(), - _sel_initWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// dateWithNaturalLanguageString:locale: - static objc.ObjCObjectBase? dateWithNaturalLanguageString_locale_( - objc.NSString string, objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_iq11qg( - _class_NSCalendarDate, - _sel_dateWithNaturalLanguageString_locale_, - string.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithNaturalLanguageString: - static objc.ObjCObjectBase? dateWithNaturalLanguageString_( - objc.NSString string) { - final _ret = _objc_msgSend_juohf7(_class_NSCalendarDate, - _sel_dateWithNaturalLanguageString_, string.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithString: - static objc.ObjCObjectBase dateWithString_(objc.NSString aString) { - final _ret = _objc_msgSend_juohf7( - _class_NSCalendarDate, _sel_dateWithString_, aString.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSPortCoder = objc.getClass("NSPortCoder"); -late final _sel_isBycopy = objc.registerName("isBycopy"); -late final _sel_isByref = objc.registerName("isByref"); -late final _sel_encodePortObject_ = objc.registerName("encodePortObject:"); -late final _sel_decodePortObject = objc.registerName("decodePortObject"); -late final _sel_connection = objc.registerName("connection"); -late final _sel_portCoderWithReceivePort_sendPort_components_ = - objc.registerName("portCoderWithReceivePort:sendPort:components:"); -late final _sel_initWithReceivePort_sendPort_components_ = - objc.registerName("initWithReceivePort:sendPort:components:"); -late final _sel_dispatch = objc.registerName("dispatch"); - -/// NSPortCoder -class NSPortCoder extends objc.NSCoder { - NSPortCoder._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSPortCoder] that points to the same underlying object as [other]. - NSPortCoder.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSPortCoder] that wraps the given raw object pointer. - NSPortCoder.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSPortCoder]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSPortCoder); - } - - /// isBycopy - bool isBycopy() { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isBycopy); - } - - /// isByref - bool isByref() { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isByref); - } - - /// encodePortObject: - void encodePortObject_(NSPort aport) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodePortObject_, aport.ref.pointer); - } - - /// decodePortObject - NSPort? decodePortObject() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_decodePortObject); - return _ret.address == 0 - ? null - : NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// connection - NSConnection? connection() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_connection); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// portCoderWithReceivePort:sendPort:components: - static objc.ObjCObjectBase portCoderWithReceivePort_sendPort_components_( - NSPort? rcvPort, NSPort? sndPort, objc.NSArray? comps) { - final _ret = _objc_msgSend_aud7dn( - _class_NSPortCoder, - _sel_portCoderWithReceivePort_sendPort_components_, - rcvPort?.ref.pointer ?? ffi.nullptr, - sndPort?.ref.pointer ?? ffi.nullptr, - comps?.ref.pointer ?? ffi.nullptr); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithReceivePort:sendPort:components: - objc.ObjCObjectBase initWithReceivePort_sendPort_components_( - NSPort? rcvPort, NSPort? sndPort, objc.NSArray? comps) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithReceivePort_sendPort_components_, - rcvPort?.ref.pointer ?? ffi.nullptr, - sndPort?.ref.pointer ?? ffi.nullptr, - comps?.ref.pointer ?? ffi.nullptr); - return objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// dispatch - void dispatch() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_dispatch); - } - - /// init - NSPortCoder init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSPortCoder.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSPortCoder new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPortCoder, _sel_new); - return NSPortCoder.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSPortCoder allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSPortCoder, _sel_allocWithZone_, zone); - return NSPortCoder.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSPortCoder alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPortCoder, _sel_alloc); - return NSPortCoder.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSPortCoder, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSPortCoder, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSPortCoder, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSPortCoder, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSPortCoder, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSPortCoder, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSPortCoder, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPortCoder, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSPortCoder, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -enum NSAppleEventSendOptions { - NSAppleEventSendNoReply(1), - NSAppleEventSendQueueReply(2), - NSAppleEventSendWaitForReply(3), - NSAppleEventSendNeverInteract(16), - NSAppleEventSendCanInteract(32), - NSAppleEventSendAlwaysInteract(48), - NSAppleEventSendCanSwitchLayer(64), - NSAppleEventSendDontRecord(4096), - NSAppleEventSendDontExecute(8192), - NSAppleEventSendDontAnnotate(65536), - NSAppleEventSendDefaultOptions(35); - - final int value; - const NSAppleEventSendOptions(this.value); - - static NSAppleEventSendOptions fromValue(int value) => switch (value) { - 1 => NSAppleEventSendNoReply, - 2 => NSAppleEventSendQueueReply, - 3 => NSAppleEventSendWaitForReply, - 16 => NSAppleEventSendNeverInteract, - 32 => NSAppleEventSendCanInteract, - 48 => NSAppleEventSendAlwaysInteract, - 64 => NSAppleEventSendCanSwitchLayer, - 4096 => NSAppleEventSendDontRecord, - 8192 => NSAppleEventSendDontExecute, - 65536 => NSAppleEventSendDontAnnotate, - 35 => NSAppleEventSendDefaultOptions, - _ => throw ArgumentError( - "Unknown value for NSAppleEventSendOptions: $value"), - }; -} - -late final _class_NSAppleEventDescriptor = - objc.getClass("NSAppleEventDescriptor"); -late final _sel_nullDescriptor = objc.registerName("nullDescriptor"); -late final _sel_descriptorWithDescriptorType_bytes_length_ = - objc.registerName("descriptorWithDescriptorType:bytes:length:"); -final _objc_msgSend_unctjf = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); -late final _sel_descriptorWithDescriptorType_data_ = - objc.registerName("descriptorWithDescriptorType:data:"); -final _objc_msgSend_1k5vjgv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_descriptorWithBoolean_ = - objc.registerName("descriptorWithBoolean:"); -final _objc_msgSend_1ar9f5m = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedChar)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_descriptorWithEnumCode_ = - objc.registerName("descriptorWithEnumCode:"); -final _objc_msgSend_pxgym4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_descriptorWithInt32_ = - objc.registerName("descriptorWithInt32:"); -final _objc_msgSend_105o5we = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_descriptorWithDouble_ = - objc.registerName("descriptorWithDouble:"); -late final _sel_descriptorWithTypeCode_ = - objc.registerName("descriptorWithTypeCode:"); -late final _sel_descriptorWithString_ = - objc.registerName("descriptorWithString:"); -late final _sel_descriptorWithDate_ = objc.registerName("descriptorWithDate:"); -late final _sel_descriptorWithFileURL_ = - objc.registerName("descriptorWithFileURL:"); -late final _sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_ = - objc.registerName( - "appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); -final _objc_msgSend_1iwlq4o = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.UnsignedInt, - ffi.Pointer, - ffi.Short, - ffi.Int)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - int, - int)>(); -late final _sel_listDescriptor = objc.registerName("listDescriptor"); -late final _sel_recordDescriptor = objc.registerName("recordDescriptor"); -late final _sel_currentProcessDescriptor = - objc.registerName("currentProcessDescriptor"); -late final _sel_descriptorWithProcessIdentifier_ = - objc.registerName("descriptorWithProcessIdentifier:"); -late final _sel_descriptorWithBundleIdentifier_ = - objc.registerName("descriptorWithBundleIdentifier:"); -late final _sel_descriptorWithApplicationURL_ = - objc.registerName("descriptorWithApplicationURL:"); -late final _sel_initWithAEDescNoCopy_ = - objc.registerName("initWithAEDescNoCopy:"); -final _objc_msgSend_10xxpbh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_initWithDescriptorType_bytes_length_ = - objc.registerName("initWithDescriptorType:bytes:length:"); -late final _sel_initWithDescriptorType_data_ = - objc.registerName("initWithDescriptorType:data:"); -late final _sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_ = - objc.registerName( - "initWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); -late final _sel_initListDescriptor = objc.registerName("initListDescriptor"); -late final _sel_initRecordDescriptor = - objc.registerName("initRecordDescriptor"); -late final _sel_aeDesc = objc.registerName("aeDesc"); -final _objc_msgSend_jg6irx = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_descriptorType = objc.registerName("descriptorType"); -final _objc_msgSend_dzloj4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_booleanValue = objc.registerName("booleanValue"); -final _objc_msgSend_1cswds = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedChar Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_enumCodeValue = objc.registerName("enumCodeValue"); -late final _sel_int32Value = objc.registerName("int32Value"); -final _objc_msgSend_1tf0yjs = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_doubleValue = objc.registerName("doubleValue"); -late final _sel_typeCodeValue = objc.registerName("typeCodeValue"); -late final _sel_stringValue = objc.registerName("stringValue"); -late final _sel_dateValue = objc.registerName("dateValue"); -late final _sel_fileURLValue = objc.registerName("fileURLValue"); -late final _sel_eventClass = objc.registerName("eventClass"); -late final _sel_eventID = objc.registerName("eventID"); -late final _sel_returnID = objc.registerName("returnID"); -final _objc_msgSend_157j54x = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Short Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_transactionID = objc.registerName("transactionID"); -late final _sel_setParamDescriptor_forKeyword_ = - objc.registerName("setParamDescriptor:forKeyword:"); -final _objc_msgSend_1dzwu6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_paramDescriptorForKeyword_ = - objc.registerName("paramDescriptorForKeyword:"); -late final _sel_removeParamDescriptorWithKeyword_ = - objc.registerName("removeParamDescriptorWithKeyword:"); -final _objc_msgSend_l6g8fv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setAttributeDescriptor_forKeyword_ = - objc.registerName("setAttributeDescriptor:forKeyword:"); -late final _sel_attributeDescriptorForKeyword_ = - objc.registerName("attributeDescriptorForKeyword:"); -late final _sel_sendEventWithOptions_timeout_error_ = - objc.registerName("sendEventWithOptions:timeout:error:"); -final _objc_msgSend_19xj9w = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Double, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - double, - ffi.Pointer>)>(); -late final _sel_isRecordDescriptor = objc.registerName("isRecordDescriptor"); -late final _sel_numberOfItems = objc.registerName("numberOfItems"); -late final _sel_insertDescriptor_atIndex_ = - objc.registerName("insertDescriptor:atIndex:"); -final _objc_msgSend_da94db = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_descriptorAtIndex_ = objc.registerName("descriptorAtIndex:"); -late final _sel_removeDescriptorAtIndex_ = - objc.registerName("removeDescriptorAtIndex:"); -final _objc_msgSend_ke7qz2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setDescriptor_forKeyword_ = - objc.registerName("setDescriptor:forKeyword:"); -late final _sel_descriptorForKeyword_ = - objc.registerName("descriptorForKeyword:"); -late final _sel_removeDescriptorWithKeyword_ = - objc.registerName("removeDescriptorWithKeyword:"); -late final _sel_keywordForDescriptorAtIndex_ = - objc.registerName("keywordForDescriptorAtIndex:"); -final _objc_msgSend_hkgvph = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_coerceToDescriptorType_ = - objc.registerName("coerceToDescriptorType:"); - -/// NSAppleEventDescriptor -class NSAppleEventDescriptor extends objc.NSObject { - NSAppleEventDescriptor._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSAppleEventDescriptor] that points to the same underlying object as [other]. - NSAppleEventDescriptor.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSAppleEventDescriptor] that wraps the given raw object pointer. - NSAppleEventDescriptor.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSAppleEventDescriptor]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSAppleEventDescriptor); - } - - /// nullDescriptor - static NSAppleEventDescriptor nullDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_nullDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithDescriptorType:bytes:length: - static NSAppleEventDescriptor? descriptorWithDescriptorType_bytes_length_( - int descriptorType, ffi.Pointer bytes, int byteCount) { - final _ret = _objc_msgSend_unctjf( - _class_NSAppleEventDescriptor, - _sel_descriptorWithDescriptorType_bytes_length_, - descriptorType, - bytes, - byteCount); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithDescriptorType:data: - static NSAppleEventDescriptor? descriptorWithDescriptorType_data_( - int descriptorType, objc.NSData? data) { - final _ret = _objc_msgSend_1k5vjgv( - _class_NSAppleEventDescriptor, - _sel_descriptorWithDescriptorType_data_, - descriptorType, - data?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithBoolean: - static NSAppleEventDescriptor descriptorWithBoolean_(int boolean) { - final _ret = _objc_msgSend_1ar9f5m( - _class_NSAppleEventDescriptor, _sel_descriptorWithBoolean_, boolean); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithEnumCode: - static NSAppleEventDescriptor descriptorWithEnumCode_(int enumerator) { - final _ret = _objc_msgSend_pxgym4(_class_NSAppleEventDescriptor, - _sel_descriptorWithEnumCode_, enumerator); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithInt32: - static NSAppleEventDescriptor descriptorWithInt32_(int signedInt) { - final _ret = _objc_msgSend_105o5we( - _class_NSAppleEventDescriptor, _sel_descriptorWithInt32_, signedInt); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithDouble: - static NSAppleEventDescriptor descriptorWithDouble_(double doubleValue) { - final _ret = _objc_msgSend_m7jc8y( - _class_NSAppleEventDescriptor, _sel_descriptorWithDouble_, doubleValue); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithTypeCode: - static NSAppleEventDescriptor descriptorWithTypeCode_(int typeCode) { - final _ret = _objc_msgSend_pxgym4( - _class_NSAppleEventDescriptor, _sel_descriptorWithTypeCode_, typeCode); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithString: - static NSAppleEventDescriptor descriptorWithString_(objc.NSString string) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithString_, string.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithDate: - static NSAppleEventDescriptor descriptorWithDate_(objc.NSDate date) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithDate_, date.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithFileURL: - static NSAppleEventDescriptor descriptorWithFileURL_(objc.NSURL fileURL) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithFileURL_, fileURL.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID: - static NSAppleEventDescriptor - appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_( - int eventClass, - int eventID, - NSAppleEventDescriptor? targetDescriptor, - int returnID, - int transactionID) { - final _ret = _objc_msgSend_1iwlq4o( - _class_NSAppleEventDescriptor, - _sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_, - eventClass, - eventID, - targetDescriptor?.ref.pointer ?? ffi.nullptr, - returnID, - transactionID); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// listDescriptor - static NSAppleEventDescriptor listDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_listDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// recordDescriptor - static NSAppleEventDescriptor recordDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_recordDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// currentProcessDescriptor - static NSAppleEventDescriptor currentProcessDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_currentProcessDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithProcessIdentifier: - static NSAppleEventDescriptor descriptorWithProcessIdentifier_( - int processIdentifier) { - final _ret = _objc_msgSend_105o5we(_class_NSAppleEventDescriptor, - _sel_descriptorWithProcessIdentifier_, processIdentifier); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithBundleIdentifier: - static NSAppleEventDescriptor descriptorWithBundleIdentifier_( - objc.NSString bundleIdentifier) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithBundleIdentifier_, bundleIdentifier.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithApplicationURL: - static NSAppleEventDescriptor descriptorWithApplicationURL_( - objc.NSURL applicationURL) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithApplicationURL_, applicationURL.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// initWithAEDescNoCopy: - NSAppleEventDescriptor initWithAEDescNoCopy_(ffi.Pointer aeDesc) { - final _ret = _objc_msgSend_10xxpbh( - this.ref.retainAndReturnPointer(), _sel_initWithAEDescNoCopy_, aeDesc); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithDescriptorType:bytes:length: - NSAppleEventDescriptor? initWithDescriptorType_bytes_length_( - int descriptorType, ffi.Pointer bytes, int byteCount) { - final _ret = _objc_msgSend_unctjf( - this.ref.retainAndReturnPointer(), - _sel_initWithDescriptorType_bytes_length_, - descriptorType, - bytes, - byteCount); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithDescriptorType:data: - NSAppleEventDescriptor? initWithDescriptorType_data_( - int descriptorType, objc.NSData? data) { - final _ret = _objc_msgSend_1k5vjgv( - this.ref.retainAndReturnPointer(), - _sel_initWithDescriptorType_data_, - descriptorType, - data?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithEventClass:eventID:targetDescriptor:returnID:transactionID: - NSAppleEventDescriptor - initWithEventClass_eventID_targetDescriptor_returnID_transactionID_( - int eventClass, - int eventID, - NSAppleEventDescriptor? targetDescriptor, - int returnID, - int transactionID) { - final _ret = _objc_msgSend_1iwlq4o( - this.ref.retainAndReturnPointer(), - _sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_, - eventClass, - eventID, - targetDescriptor?.ref.pointer ?? ffi.nullptr, - returnID, - transactionID); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initListDescriptor - NSAppleEventDescriptor initListDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - this.ref.retainAndReturnPointer(), _sel_initListDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initRecordDescriptor - NSAppleEventDescriptor initRecordDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - this.ref.retainAndReturnPointer(), _sel_initRecordDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// aeDesc - ffi.Pointer get aeDesc { - return _objc_msgSend_jg6irx(this.ref.pointer, _sel_aeDesc); - } - - /// descriptorType - int get descriptorType { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_descriptorType); - } - - /// data - objc.NSData get data { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// booleanValue - int get booleanValue { - return _objc_msgSend_1cswds(this.ref.pointer, _sel_booleanValue); - } - - /// enumCodeValue - int get enumCodeValue { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_enumCodeValue); - } - - /// int32Value - int get int32Value { - return _objc_msgSend_1tf0yjs(this.ref.pointer, _sel_int32Value); - } - - /// doubleValue - double get doubleValue { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_doubleValue); - } - - /// typeCodeValue - int get typeCodeValue { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_typeCodeValue); - } - - /// stringValue - objc.NSString? get stringValue { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_stringValue); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// dateValue - objc.NSDate? get dateValue { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_dateValue); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// fileURLValue - objc.NSURL? get fileURLValue { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileURLValue); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// eventClass - int get eventClass { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_eventClass); - } - - /// eventID - int get eventID { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_eventID); - } - - /// returnID - int get returnID { - return _objc_msgSend_157j54x(this.ref.pointer, _sel_returnID); - } - - /// transactionID - int get transactionID { - return _objc_msgSend_1tf0yjs(this.ref.pointer, _sel_transactionID); - } - - /// setParamDescriptor:forKeyword: - void setParamDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _objc_msgSend_1dzwu6(this.ref.pointer, _sel_setParamDescriptor_forKeyword_, - descriptor.ref.pointer, keyword); - } - - /// paramDescriptorForKeyword: - NSAppleEventDescriptor? paramDescriptorForKeyword_(int keyword) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_paramDescriptorForKeyword_, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// removeParamDescriptorWithKeyword: - void removeParamDescriptorWithKeyword_(int keyword) { - _objc_msgSend_l6g8fv( - this.ref.pointer, _sel_removeParamDescriptorWithKeyword_, keyword); - } - - /// setAttributeDescriptor:forKeyword: - void setAttributeDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _objc_msgSend_1dzwu6( - this.ref.pointer, - _sel_setAttributeDescriptor_forKeyword_, - descriptor.ref.pointer, - keyword); - } - - /// attributeDescriptorForKeyword: - NSAppleEventDescriptor? attributeDescriptorForKeyword_(int keyword) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_attributeDescriptorForKeyword_, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// sendEventWithOptions:timeout:error: - NSAppleEventDescriptor? sendEventWithOptions_timeout_error_( - NSAppleEventSendOptions sendOptions, - double timeoutInSeconds, - ffi.Pointer> error) { - final _ret = _objc_msgSend_19xj9w( - this.ref.pointer, - _sel_sendEventWithOptions_timeout_error_, - sendOptions.value, - timeoutInSeconds, - error); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// isRecordDescriptor - bool get isRecordDescriptor { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isRecordDescriptor); - } - - /// numberOfItems - int get numberOfItems { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_numberOfItems); - } - - /// insertDescriptor:atIndex: - void insertDescriptor_atIndex_(NSAppleEventDescriptor descriptor, int index) { - _objc_msgSend_da94db(this.ref.pointer, _sel_insertDescriptor_atIndex_, - descriptor.ref.pointer, index); - } - - /// descriptorAtIndex: - NSAppleEventDescriptor? descriptorAtIndex_(int index) { - final _ret = - _objc_msgSend_crtxa9(this.ref.pointer, _sel_descriptorAtIndex_, index); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// removeDescriptorAtIndex: - void removeDescriptorAtIndex_(int index) { - _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_removeDescriptorAtIndex_, index); - } - - /// setDescriptor:forKeyword: - void setDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _objc_msgSend_1dzwu6(this.ref.pointer, _sel_setDescriptor_forKeyword_, - descriptor.ref.pointer, keyword); - } - - /// descriptorForKeyword: - NSAppleEventDescriptor? descriptorForKeyword_(int keyword) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_descriptorForKeyword_, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// removeDescriptorWithKeyword: - void removeDescriptorWithKeyword_(int keyword) { - _objc_msgSend_l6g8fv( - this.ref.pointer, _sel_removeDescriptorWithKeyword_, keyword); - } - - /// keywordForDescriptorAtIndex: - int keywordForDescriptorAtIndex_(int index) { - return _objc_msgSend_hkgvph( - this.ref.pointer, _sel_keywordForDescriptorAtIndex_, index); - } - - /// coerceToDescriptorType: - NSAppleEventDescriptor? coerceToDescriptorType_(int descriptorType) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_coerceToDescriptorType_, descriptorType); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// init - NSAppleEventDescriptor init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSAppleEventDescriptor new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSAppleEventDescriptor, _sel_new); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSAppleEventDescriptor allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSAppleEventDescriptor, _sel_allocWithZone_, zone); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSAppleEventDescriptor alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSAppleEventDescriptor, _sel_alloc); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSAppleEventDescriptor, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSAppleEventDescriptor, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSAppleEventDescriptor, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSAppleEventDescriptor, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSAppleEventDescriptor, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSAppleEventDescriptor, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_NSAppleEventDescriptor, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSAppleEventDescriptor? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } -} - -late final _class_NSClassDescription = objc.getClass("NSClassDescription"); -late final _sel_registerClassDescription_forClass_ = - objc.registerName("registerClassDescription:forClass:"); -late final _sel_invalidateClassDescriptionCache = - objc.registerName("invalidateClassDescriptionCache"); -late final _sel_classDescriptionForClass_ = - objc.registerName("classDescriptionForClass:"); -late final _sel_attributeKeys = objc.registerName("attributeKeys"); -late final _sel_toOneRelationshipKeys = - objc.registerName("toOneRelationshipKeys"); -late final _sel_toManyRelationshipKeys = - objc.registerName("toManyRelationshipKeys"); -late final _sel_inverseForRelationshipKey_ = - objc.registerName("inverseForRelationshipKey:"); - -/// NSClassDescription -class NSClassDescription extends objc.NSObject { - NSClassDescription._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSClassDescription] that points to the same underlying object as [other]. - NSClassDescription.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSClassDescription] that wraps the given raw object pointer. - NSClassDescription.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSClassDescription]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSClassDescription); - } - - /// registerClassDescription:forClass: - static void registerClassDescription_forClass_( - NSClassDescription description, objc.ObjCObjectBase aClass) { - _objc_msgSend_1tjlcwl( - _class_NSClassDescription, - _sel_registerClassDescription_forClass_, - description.ref.pointer, - aClass.ref.pointer); - } - - /// invalidateClassDescriptionCache - static void invalidateClassDescriptionCache() { - _objc_msgSend_ksby9f( - _class_NSClassDescription, _sel_invalidateClassDescriptionCache); - } - - /// classDescriptionForClass: - static NSClassDescription? classDescriptionForClass_( - objc.ObjCObjectBase aClass) { - final _ret = _objc_msgSend_juohf7(_class_NSClassDescription, - _sel_classDescriptionForClass_, aClass.ref.pointer); - return _ret.address == 0 - ? null - : NSClassDescription.castFromPointer(_ret, retain: true, release: true); - } - - /// attributeKeys - objc.NSArray get attributeKeys { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_attributeKeys); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// toOneRelationshipKeys - objc.NSArray get toOneRelationshipKeys { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_toOneRelationshipKeys); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// toManyRelationshipKeys - objc.NSArray get toManyRelationshipKeys { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_toManyRelationshipKeys); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// inverseForRelationshipKey: - objc.NSString? inverseForRelationshipKey_(objc.NSString relationshipKey) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_inverseForRelationshipKey_, relationshipKey.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSClassDescription init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSClassDescription new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSClassDescription, _sel_new); - return NSClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSClassDescription allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSClassDescription, _sel_allocWithZone_, zone); - return NSClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSClassDescription alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSClassDescription, _sel_alloc); - return NSClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSClassDescription, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSClassDescription, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSClassDescription, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSClassDescription, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSClassDescription, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSClassDescription, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSClassDescription, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSClassDescription, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSClassDescription, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSScriptClassDescription = - objc.getClass("NSScriptClassDescription"); -late final _sel_initWithSuiteName_className_dictionary_ = - objc.registerName("initWithSuiteName:className:dictionary:"); -late final _sel_suiteName = objc.registerName("suiteName"); -late final _sel_className = objc.registerName("className"); -late final _sel_implementationClassName = - objc.registerName("implementationClassName"); -late final _sel_superclassDescription = - objc.registerName("superclassDescription"); -late final _sel_appleEventCode = objc.registerName("appleEventCode"); -late final _sel_matchesAppleEventCode_ = - objc.registerName("matchesAppleEventCode:"); -final _objc_msgSend_1n8vqu1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _class_NSScriptCommandDescription = - objc.getClass("NSScriptCommandDescription"); -late final _sel_initWithSuiteName_commandName_dictionary_ = - objc.registerName("initWithSuiteName:commandName:dictionary:"); -late final _sel_commandName = objc.registerName("commandName"); -late final _sel_appleEventClassCode = objc.registerName("appleEventClassCode"); -late final _sel_commandClassName = objc.registerName("commandClassName"); -late final _sel_returnType = objc.registerName("returnType"); -late final _sel_appleEventCodeForReturnType = - objc.registerName("appleEventCodeForReturnType"); -late final _sel_argumentNames = objc.registerName("argumentNames"); -late final _sel_typeForArgumentWithName_ = - objc.registerName("typeForArgumentWithName:"); -late final _sel_appleEventCodeForArgumentWithName_ = - objc.registerName("appleEventCodeForArgumentWithName:"); -final _objc_msgSend_t2sarz = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedInt Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isOptionalArgumentWithName_ = - objc.registerName("isOptionalArgumentWithName:"); -late final _class_NSScriptCommand = objc.getClass("NSScriptCommand"); -late final _sel_initWithCommandDescription_ = - objc.registerName("initWithCommandDescription:"); -late final _sel_commandDescription = objc.registerName("commandDescription"); -late final _sel_directParameter = objc.registerName("directParameter"); -late final _sel_setDirectParameter_ = objc.registerName("setDirectParameter:"); -late final _class_NSScriptObjectSpecifier = - objc.getClass("NSScriptObjectSpecifier"); -late final _sel_objectSpecifierWithDescriptor_ = - objc.registerName("objectSpecifierWithDescriptor:"); -late final _sel_initWithContainerSpecifier_key_ = - objc.registerName("initWithContainerSpecifier:key:"); -late final _sel_initWithContainerClassDescription_containerSpecifier_key_ = objc - .registerName("initWithContainerClassDescription:containerSpecifier:key:"); -late final _sel_childSpecifier = objc.registerName("childSpecifier"); -late final _sel_setChildSpecifier_ = objc.registerName("setChildSpecifier:"); -late final _sel_containerSpecifier = objc.registerName("containerSpecifier"); -late final _sel_setContainerSpecifier_ = - objc.registerName("setContainerSpecifier:"); -late final _sel_containerIsObjectBeingTested = - objc.registerName("containerIsObjectBeingTested"); -late final _sel_setContainerIsObjectBeingTested_ = - objc.registerName("setContainerIsObjectBeingTested:"); -late final _sel_containerIsRangeContainerObject = - objc.registerName("containerIsRangeContainerObject"); -late final _sel_setContainerIsRangeContainerObject_ = - objc.registerName("setContainerIsRangeContainerObject:"); -late final _sel_key = objc.registerName("key"); -late final _sel_setKey_ = objc.registerName("setKey:"); -late final _sel_containerClassDescription = - objc.registerName("containerClassDescription"); -late final _sel_setContainerClassDescription_ = - objc.registerName("setContainerClassDescription:"); -late final _sel_keyClassDescription = objc.registerName("keyClassDescription"); -late final _sel_indicesOfObjectsByEvaluatingWithContainer_count_ = - objc.registerName("indicesOfObjectsByEvaluatingWithContainer:count:"); -final _objc_msgSend_1e2yezv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_objectsByEvaluatingWithContainers_ = - objc.registerName("objectsByEvaluatingWithContainers:"); -late final _sel_objectsByEvaluatingSpecifier = - objc.registerName("objectsByEvaluatingSpecifier"); -late final _sel_evaluationErrorNumber = - objc.registerName("evaluationErrorNumber"); -late final _sel_setEvaluationErrorNumber_ = - objc.registerName("setEvaluationErrorNumber:"); -late final _sel_evaluationErrorSpecifier = - objc.registerName("evaluationErrorSpecifier"); -late final _sel_descriptor = objc.registerName("descriptor"); - -/// NSScriptObjectSpecifier -class NSScriptObjectSpecifier extends objc.NSObject { - NSScriptObjectSpecifier._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSScriptObjectSpecifier] that points to the same underlying object as [other]. - NSScriptObjectSpecifier.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSScriptObjectSpecifier] that wraps the given raw object pointer. - NSScriptObjectSpecifier.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSScriptObjectSpecifier]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSScriptObjectSpecifier); - } - - /// objectSpecifierWithDescriptor: - static NSScriptObjectSpecifier? objectSpecifierWithDescriptor_( - NSAppleEventDescriptor descriptor) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptObjectSpecifier, - _sel_objectSpecifierWithDescriptor_, descriptor.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// initWithContainerSpecifier:key: - NSScriptObjectSpecifier initWithContainerSpecifier_key_( - NSScriptObjectSpecifier container, objc.NSString property) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithContainerSpecifier_key_, - container.ref.pointer, - property.ref.pointer); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithContainerClassDescription:containerSpecifier:key: - NSScriptObjectSpecifier - initWithContainerClassDescription_containerSpecifier_key_( - NSScriptClassDescription classDesc, - NSScriptObjectSpecifier? container, - objc.NSString property) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithContainerClassDescription_containerSpecifier_key_, - classDesc.ref.pointer, - container?.ref.pointer ?? ffi.nullptr, - property.ref.pointer); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithCoder: - NSScriptObjectSpecifier? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// childSpecifier - NSScriptObjectSpecifier? get childSpecifier { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_childSpecifier); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// setChildSpecifier: - set childSpecifier(NSScriptObjectSpecifier? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setChildSpecifier_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// containerSpecifier - NSScriptObjectSpecifier? get containerSpecifier { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_containerSpecifier); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// setContainerSpecifier: - set containerSpecifier(NSScriptObjectSpecifier? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setContainerSpecifier_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// containerIsObjectBeingTested - bool get containerIsObjectBeingTested { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_containerIsObjectBeingTested); - } - - /// setContainerIsObjectBeingTested: - set containerIsObjectBeingTested(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setContainerIsObjectBeingTested_, value); - } - - /// containerIsRangeContainerObject - bool get containerIsRangeContainerObject { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_containerIsRangeContainerObject); - } - - /// setContainerIsRangeContainerObject: - set containerIsRangeContainerObject(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setContainerIsRangeContainerObject_, value); - } - - /// key - objc.NSString get key { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_key); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setKey: - set key(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setKey_, value.ref.pointer); - } - - /// containerClassDescription - NSScriptClassDescription? get containerClassDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_containerClassDescription); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// setContainerClassDescription: - set containerClassDescription(NSScriptClassDescription? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setContainerClassDescription_, value?.ref.pointer ?? ffi.nullptr); - } - - /// keyClassDescription - NSScriptClassDescription? get keyClassDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_keyClassDescription); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// indicesOfObjectsByEvaluatingWithContainer:count: - ffi.Pointer indicesOfObjectsByEvaluatingWithContainer_count_( - objc.ObjCObjectBase container, ffi.Pointer count) { - return _objc_msgSend_1e2yezv( - this.ref.pointer, - _sel_indicesOfObjectsByEvaluatingWithContainer_count_, - container.ref.pointer, - count); - } - - /// objectsByEvaluatingWithContainers: - objc.ObjCObjectBase? objectsByEvaluatingWithContainers_( - objc.ObjCObjectBase containers) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_objectsByEvaluatingWithContainers_, containers.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// objectsByEvaluatingSpecifier - objc.ObjCObjectBase? get objectsByEvaluatingSpecifier { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_objectsByEvaluatingSpecifier); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// evaluationErrorNumber - int get evaluationErrorNumber { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_evaluationErrorNumber); - } - - /// setEvaluationErrorNumber: - set evaluationErrorNumber(int value) { - return _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_setEvaluationErrorNumber_, value); - } - - /// evaluationErrorSpecifier - NSScriptObjectSpecifier? get evaluationErrorSpecifier { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_evaluationErrorSpecifier); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptor - NSAppleEventDescriptor? get descriptor { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_descriptor); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// init - NSScriptObjectSpecifier init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSScriptObjectSpecifier new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptObjectSpecifier, _sel_new); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSScriptObjectSpecifier allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSScriptObjectSpecifier, _sel_allocWithZone_, zone); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSScriptObjectSpecifier alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptObjectSpecifier, _sel_alloc); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSScriptObjectSpecifier, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSScriptObjectSpecifier, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSScriptObjectSpecifier, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSScriptObjectSpecifier, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptObjectSpecifier, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSScriptObjectSpecifier, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSScriptObjectSpecifier, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptObjectSpecifier, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptObjectSpecifier, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _sel_receiversSpecifier = objc.registerName("receiversSpecifier"); -late final _sel_setReceiversSpecifier_ = - objc.registerName("setReceiversSpecifier:"); -late final _sel_evaluatedReceivers = objc.registerName("evaluatedReceivers"); -late final _sel_arguments = objc.registerName("arguments"); -late final _sel_setArguments_ = objc.registerName("setArguments:"); -late final _sel_evaluatedArguments = objc.registerName("evaluatedArguments"); -late final _sel_isWellFormed = objc.registerName("isWellFormed"); -late final _sel_performDefaultImplementation = - objc.registerName("performDefaultImplementation"); -late final _sel_executeCommand = objc.registerName("executeCommand"); -late final _sel_scriptErrorNumber = objc.registerName("scriptErrorNumber"); -late final _sel_setScriptErrorNumber_ = - objc.registerName("setScriptErrorNumber:"); -late final _sel_scriptErrorOffendingObjectDescriptor = - objc.registerName("scriptErrorOffendingObjectDescriptor"); -late final _sel_setScriptErrorOffendingObjectDescriptor_ = - objc.registerName("setScriptErrorOffendingObjectDescriptor:"); -late final _sel_scriptErrorExpectedTypeDescriptor = - objc.registerName("scriptErrorExpectedTypeDescriptor"); -late final _sel_setScriptErrorExpectedTypeDescriptor_ = - objc.registerName("setScriptErrorExpectedTypeDescriptor:"); -late final _sel_scriptErrorString = objc.registerName("scriptErrorString"); -late final _sel_setScriptErrorString_ = - objc.registerName("setScriptErrorString:"); -late final _sel_currentCommand = objc.registerName("currentCommand"); -late final _sel_appleEvent = objc.registerName("appleEvent"); -late final _sel_suspendExecution = objc.registerName("suspendExecution"); -late final _sel_resumeExecutionWithResult_ = - objc.registerName("resumeExecutionWithResult:"); - -/// NSScriptCommand -class NSScriptCommand extends objc.NSObject { - NSScriptCommand._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSScriptCommand] that points to the same underlying object as [other]. - NSScriptCommand.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSScriptCommand] that wraps the given raw object pointer. - NSScriptCommand.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSScriptCommand]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSScriptCommand); - } - - /// initWithCommandDescription: - NSScriptCommand initWithCommandDescription_( - NSScriptCommandDescription commandDef) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCommandDescription_, commandDef.ref.pointer); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCoder: - NSScriptCommand? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// commandDescription - NSScriptCommandDescription get commandDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_commandDescription); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// directParameter - objc.ObjCObjectBase? get directParameter { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_directParameter); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setDirectParameter: - set directParameter(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setDirectParameter_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// receiversSpecifier - NSScriptObjectSpecifier? get receiversSpecifier { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_receiversSpecifier); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// setReceiversSpecifier: - set receiversSpecifier(NSScriptObjectSpecifier? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setReceiversSpecifier_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// evaluatedReceivers - objc.ObjCObjectBase? get evaluatedReceivers { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_evaluatedReceivers); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// arguments - objc.NSDictionary? get arguments { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_arguments); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// setArguments: - set arguments(objc.NSDictionary? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setArguments_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// evaluatedArguments - objc.NSDictionary? get evaluatedArguments { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_evaluatedArguments); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// isWellFormed - bool get wellFormed { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isWellFormed); - } - - /// performDefaultImplementation - objc.ObjCObjectBase? performDefaultImplementation() { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_performDefaultImplementation); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// executeCommand - objc.ObjCObjectBase? executeCommand() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_executeCommand); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// scriptErrorNumber - int get scriptErrorNumber { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_scriptErrorNumber); - } - - /// setScriptErrorNumber: - set scriptErrorNumber(int value) { - return _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_setScriptErrorNumber_, value); - } - - /// scriptErrorOffendingObjectDescriptor - NSAppleEventDescriptor? get scriptErrorOffendingObjectDescriptor { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_scriptErrorOffendingObjectDescriptor); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// setScriptErrorOffendingObjectDescriptor: - set scriptErrorOffendingObjectDescriptor(NSAppleEventDescriptor? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, - _sel_setScriptErrorOffendingObjectDescriptor_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// scriptErrorExpectedTypeDescriptor - NSAppleEventDescriptor? get scriptErrorExpectedTypeDescriptor { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_scriptErrorExpectedTypeDescriptor); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// setScriptErrorExpectedTypeDescriptor: - set scriptErrorExpectedTypeDescriptor(NSAppleEventDescriptor? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, - _sel_setScriptErrorExpectedTypeDescriptor_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// scriptErrorString - objc.NSString? get scriptErrorString { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_scriptErrorString); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setScriptErrorString: - set scriptErrorString(objc.NSString? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setScriptErrorString_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// currentCommand - static NSScriptCommand? currentCommand() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptCommand, _sel_currentCommand); - return _ret.address == 0 - ? null - : NSScriptCommand.castFromPointer(_ret, retain: true, release: true); - } - - /// appleEvent - NSAppleEventDescriptor? get appleEvent { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_appleEvent); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// suspendExecution - void suspendExecution() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_suspendExecution); - } - - /// resumeExecutionWithResult: - void resumeExecutionWithResult_(objc.ObjCObjectBase? result) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_resumeExecutionWithResult_, - result?.ref.pointer ?? ffi.nullptr); - } - - /// init - NSScriptCommand init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSScriptCommand new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSScriptCommand, _sel_new); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSScriptCommand allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSScriptCommand, _sel_allocWithZone_, zone); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSScriptCommand alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSScriptCommand, _sel_alloc); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSScriptCommand, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSScriptCommand, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSScriptCommand, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSScriptCommand, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptCommand, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSScriptCommand, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSScriptCommand, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptCommand, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptCommand, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _sel_createCommandInstance = - objc.registerName("createCommandInstance"); -late final _sel_createCommandInstanceWithZone_ = - objc.registerName("createCommandInstanceWithZone:"); - -/// NSScriptCommandDescription -class NSScriptCommandDescription extends objc.NSObject { - NSScriptCommandDescription._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSScriptCommandDescription] that points to the same underlying object as [other]. - NSScriptCommandDescription.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSScriptCommandDescription] that wraps the given raw object pointer. - NSScriptCommandDescription.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSScriptCommandDescription]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg(obj.ref.pointer, _sel_isKindOfClass_, - _class_NSScriptCommandDescription); - } - - /// init - NSScriptCommandDescription init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithSuiteName:commandName:dictionary: - NSScriptCommandDescription? initWithSuiteName_commandName_dictionary_( - objc.NSString suiteName, - objc.NSString commandName, - objc.NSDictionary? commandDeclaration) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithSuiteName_commandName_dictionary_, - suiteName.ref.pointer, - commandName.ref.pointer, - commandDeclaration?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithCoder: - NSScriptCommandDescription? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// suiteName - objc.NSString get suiteName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_suiteName); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// commandName - objc.NSString get commandName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_commandName); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// appleEventClassCode - int get appleEventClassCode { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_appleEventClassCode); - } - - /// appleEventCode - int get appleEventCode { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_appleEventCode); - } - - /// commandClassName - objc.NSString get commandClassName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_commandClassName); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// returnType - objc.NSString? get returnType { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_returnType); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// appleEventCodeForReturnType - int get appleEventCodeForReturnType { - return _objc_msgSend_dzloj4( - this.ref.pointer, _sel_appleEventCodeForReturnType); - } - - /// argumentNames - objc.NSArray get argumentNames { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_argumentNames); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// typeForArgumentWithName: - objc.NSString? typeForArgumentWithName_(objc.NSString argumentName) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_typeForArgumentWithName_, argumentName.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// appleEventCodeForArgumentWithName: - int appleEventCodeForArgumentWithName_(objc.NSString argumentName) { - return _objc_msgSend_t2sarz(this.ref.pointer, - _sel_appleEventCodeForArgumentWithName_, argumentName.ref.pointer); - } - - /// isOptionalArgumentWithName: - bool isOptionalArgumentWithName_(objc.NSString argumentName) { - return _objc_msgSend_l8lotg(this.ref.pointer, - _sel_isOptionalArgumentWithName_, argumentName.ref.pointer); - } - - /// createCommandInstance - NSScriptCommand createCommandInstance() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_createCommandInstance); - return NSScriptCommand.castFromPointer(_ret, retain: true, release: true); - } - - /// createCommandInstanceWithZone: - NSScriptCommand createCommandInstanceWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - this.ref.pointer, _sel_createCommandInstanceWithZone_, zone); - return NSScriptCommand.castFromPointer(_ret, retain: true, release: true); - } - - /// new - static NSScriptCommandDescription new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptCommandDescription, _sel_new); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSScriptCommandDescription allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSScriptCommandDescription, _sel_allocWithZone_, zone); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSScriptCommandDescription alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptCommandDescription, _sel_alloc); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSScriptCommandDescription, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSScriptCommandDescription, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1(_class_NSScriptCommandDescription, - _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSScriptCommandDescription, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptCommandDescription, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSScriptCommandDescription, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSScriptCommandDescription, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptCommandDescription, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptCommandDescription, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _sel_supportsCommand_ = objc.registerName("supportsCommand:"); -late final _sel_selectorForCommand_ = objc.registerName("selectorForCommand:"); -final _objc_msgSend_12vuupl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_typeForKey_ = objc.registerName("typeForKey:"); -late final _sel_classDescriptionForKey_ = - objc.registerName("classDescriptionForKey:"); -late final _sel_appleEventCodeForKey_ = - objc.registerName("appleEventCodeForKey:"); -late final _sel_keyWithAppleEventCode_ = - objc.registerName("keyWithAppleEventCode:"); -late final _sel_defaultSubcontainerAttributeKey = - objc.registerName("defaultSubcontainerAttributeKey"); -late final _sel_isLocationRequiredToCreateForKey_ = - objc.registerName("isLocationRequiredToCreateForKey:"); -late final _sel_hasPropertyForKey_ = objc.registerName("hasPropertyForKey:"); -late final _sel_hasOrderedToManyRelationshipForKey_ = - objc.registerName("hasOrderedToManyRelationshipForKey:"); -late final _sel_hasReadablePropertyForKey_ = - objc.registerName("hasReadablePropertyForKey:"); -late final _sel_hasWritablePropertyForKey_ = - objc.registerName("hasWritablePropertyForKey:"); -late final _sel_isReadOnlyKey_ = objc.registerName("isReadOnlyKey:"); - -/// NSScriptClassDescription -class NSScriptClassDescription extends NSClassDescription { - NSScriptClassDescription._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSScriptClassDescription] that points to the same underlying object as [other]. - NSScriptClassDescription.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSScriptClassDescription] that wraps the given raw object pointer. - NSScriptClassDescription.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSScriptClassDescription]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSScriptClassDescription); - } - - /// classDescriptionForClass: - static NSClassDescription? classDescriptionForClass_( - objc.ObjCObjectBase aClass) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptClassDescription, - _sel_classDescriptionForClass_, aClass.ref.pointer); - return _ret.address == 0 - ? null - : NSClassDescription.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithSuiteName:className:dictionary: - NSScriptClassDescription? initWithSuiteName_className_dictionary_( - objc.NSString suiteName, - objc.NSString className, - objc.NSDictionary? classDeclaration) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithSuiteName_className_dictionary_, - suiteName.ref.pointer, - className.ref.pointer, - classDeclaration?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// suiteName - objc.NSString? get suiteName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_suiteName); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// className - objc.NSString? get className { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_className); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// implementationClassName - objc.NSString? get implementationClassName { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_implementationClassName); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// superclassDescription - NSScriptClassDescription? get superclassDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_superclassDescription); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// appleEventCode - int get appleEventCode { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_appleEventCode); - } - - /// matchesAppleEventCode: - bool matchesAppleEventCode_(int appleEventCode) { - return _objc_msgSend_1n8vqu1( - this.ref.pointer, _sel_matchesAppleEventCode_, appleEventCode); - } - - /// supportsCommand: - bool supportsCommand_(NSScriptCommandDescription commandDescription) { - return _objc_msgSend_l8lotg(this.ref.pointer, _sel_supportsCommand_, - commandDescription.ref.pointer); - } - - /// selectorForCommand: - ffi.Pointer selectorForCommand_( - NSScriptCommandDescription commandDescription) { - return _objc_msgSend_12vuupl(this.ref.pointer, _sel_selectorForCommand_, - commandDescription.ref.pointer); - } - - /// typeForKey: - objc.NSString? typeForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_typeForKey_, key.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// classDescriptionForKey: - NSScriptClassDescription? classDescriptionForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_classDescriptionForKey_, key.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// appleEventCodeForKey: - int appleEventCodeForKey_(objc.NSString key) { - return _objc_msgSend_t2sarz( - this.ref.pointer, _sel_appleEventCodeForKey_, key.ref.pointer); - } - - /// keyWithAppleEventCode: - objc.NSString? keyWithAppleEventCode_(int appleEventCode) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_keyWithAppleEventCode_, appleEventCode); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// defaultSubcontainerAttributeKey - objc.NSString? get defaultSubcontainerAttributeKey { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_defaultSubcontainerAttributeKey); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isLocationRequiredToCreateForKey: - bool isLocationRequiredToCreateForKey_(objc.NSString toManyRelationshipKey) { - return _objc_msgSend_l8lotg( - this.ref.pointer, - _sel_isLocationRequiredToCreateForKey_, - toManyRelationshipKey.ref.pointer); - } - - /// hasPropertyForKey: - bool hasPropertyForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_hasPropertyForKey_, key.ref.pointer); - } - - /// hasOrderedToManyRelationshipForKey: - bool hasOrderedToManyRelationshipForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(this.ref.pointer, - _sel_hasOrderedToManyRelationshipForKey_, key.ref.pointer); - } - - /// hasReadablePropertyForKey: - bool hasReadablePropertyForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_hasReadablePropertyForKey_, key.ref.pointer); - } - - /// hasWritablePropertyForKey: - bool hasWritablePropertyForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_hasWritablePropertyForKey_, key.ref.pointer); - } - - /// isReadOnlyKey: - bool isReadOnlyKey_(objc.NSString key) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isReadOnlyKey_, key.ref.pointer); - } - - /// registerClassDescription:forClass: - static void registerClassDescription_forClass_( - NSClassDescription description, objc.ObjCObjectBase aClass) { - _objc_msgSend_1tjlcwl( - _class_NSScriptClassDescription, - _sel_registerClassDescription_forClass_, - description.ref.pointer, - aClass.ref.pointer); - } - - /// invalidateClassDescriptionCache - static void invalidateClassDescriptionCache() { - _objc_msgSend_ksby9f( - _class_NSScriptClassDescription, _sel_invalidateClassDescriptionCache); - } - - /// init - NSScriptClassDescription init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSScriptClassDescription new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptClassDescription, _sel_new); - return NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSScriptClassDescription allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSScriptClassDescription, _sel_allocWithZone_, zone); - return NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSScriptClassDescription alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptClassDescription, _sel_alloc); - return NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSScriptClassDescription, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSScriptClassDescription, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSScriptClassDescription, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSScriptClassDescription, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptClassDescription, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSScriptClassDescription, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSScriptClassDescription, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptClassDescription, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptClassDescription, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} +final class _NSZone extends ffi.Opaque {} final class AudioStreamBasicDescription extends ffi.Struct { @ffi.Double() @@ -11266,333 +99,75 @@ enum AudioChannelBitmap { 65536 => kAudioChannelBit_TopBackCenter, 131072 => kAudioChannelBit_TopBackRight, 2097152 => kAudioChannelBit_LeftTopMiddle, - 8388608 => kAudioChannelBit_RightTopMiddle, - 16777216 => kAudioChannelBit_LeftTopRear, - 33554432 => kAudioChannelBit_CenterTopRear, - 67108864 => kAudioChannelBit_RightTopRear, - _ => - throw ArgumentError("Unknown value for AudioChannelBitmap: $value"), - }; - - @override - String toString() { - if (this == kAudioChannelBit_TopCenterSurround) - return "AudioChannelBitmap.kAudioChannelBit_TopCenterSurround, AudioChannelBitmap.kAudioChannelBit_CenterTopMiddle"; - if (this == kAudioChannelBit_VerticalHeightLeft) - return "AudioChannelBitmap.kAudioChannelBit_VerticalHeightLeft, AudioChannelBitmap.kAudioChannelBit_LeftTopFront"; - if (this == kAudioChannelBit_VerticalHeightCenter) - return "AudioChannelBitmap.kAudioChannelBit_VerticalHeightCenter, AudioChannelBitmap.kAudioChannelBit_CenterTopFront"; - if (this == kAudioChannelBit_VerticalHeightRight) - return "AudioChannelBitmap.kAudioChannelBit_VerticalHeightRight, AudioChannelBitmap.kAudioChannelBit_RightTopFront"; - return super.toString(); - } -} - -enum AudioChannelFlags { - kAudioChannelFlags_AllOff(0), - kAudioChannelFlags_RectangularCoordinates(1), - kAudioChannelFlags_SphericalCoordinates(2), - kAudioChannelFlags_Meters(4); - - final int value; - const AudioChannelFlags(this.value); - - static AudioChannelFlags fromValue(int value) => switch (value) { - 0 => kAudioChannelFlags_AllOff, - 1 => kAudioChannelFlags_RectangularCoordinates, - 2 => kAudioChannelFlags_SphericalCoordinates, - 4 => kAudioChannelFlags_Meters, - _ => throw ArgumentError("Unknown value for AudioChannelFlags: $value"), - }; -} - -final class AudioChannelDescription extends ffi.Struct { - @ffi.UnsignedInt() - external int mChannelLabel; - - @ffi.UnsignedInt() - external int mChannelFlagsAsInt; - - AudioChannelFlags get mChannelFlags => - AudioChannelFlags.fromValue(mChannelFlagsAsInt); - - @ffi.Array.multi([3]) - external ffi.Array mCoordinates; -} - -final class AudioChannelLayout extends ffi.Struct { - @ffi.UnsignedInt() - external int mChannelLayoutTag; - - @ffi.UnsignedInt() - external int mChannelBitmapAsInt; - - AudioChannelBitmap get mChannelBitmap => - AudioChannelBitmap.fromValue(mChannelBitmapAsInt); - - @ffi.UnsignedInt() - external int mNumberChannelDescriptions; - - @ffi.Array.multi([1]) - external ffi.Array mChannelDescriptions; -} - -late final _class_AVAudioChannelLayout = objc.getClass("AVAudioChannelLayout"); -late final _sel_initWithLayoutTag_ = objc.registerName("initWithLayoutTag:"); -late final _sel_initWithLayout_ = objc.registerName("initWithLayout:"); -final _objc_msgSend_tk4ypl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isEqual_ = objc.registerName("isEqual:"); -late final _sel_layoutWithLayoutTag_ = - objc.registerName("layoutWithLayoutTag:"); -late final _sel_layoutWithLayout_ = objc.registerName("layoutWithLayout:"); -late final _sel_layoutTag = objc.registerName("layoutTag"); -late final _sel_layout = objc.registerName("layout"); -final _objc_msgSend_1ice9o9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_channelCount = objc.registerName("channelCount"); -final _objc_msgSend_tfd317 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Uint32 Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); - -/// AVAudioChannelLayout -class AVAudioChannelLayout extends objc.NSObject { - AVAudioChannelLayout._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [AVAudioChannelLayout] that points to the same underlying object as [other]. - AVAudioChannelLayout.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [AVAudioChannelLayout] that wraps the given raw object pointer. - AVAudioChannelLayout.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [AVAudioChannelLayout]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_AVAudioChannelLayout); - } - - /// init - AVAudioChannelLayout init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithLayoutTag: - AVAudioChannelLayout? initWithLayoutTag_(int layoutTag) { - final _ret = _objc_msgSend_pxgym4( - this.ref.retainAndReturnPointer(), _sel_initWithLayoutTag_, layoutTag); - return _ret.address == 0 - ? null - : AVAudioChannelLayout.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithLayout: - AVAudioChannelLayout initWithLayout_(ffi.Pointer layout) { - final _ret = _objc_msgSend_tk4ypl( - this.ref.retainAndReturnPointer(), _sel_initWithLayout_, layout); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: false, release: true); - } - - /// isEqual: - bool isEqual_(objc.ObjCObjectBase object) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isEqual_, object.ref.pointer); - } - - /// layoutWithLayoutTag: - static AVAudioChannelLayout layoutWithLayoutTag_(int layoutTag) { - final _ret = _objc_msgSend_pxgym4( - _class_AVAudioChannelLayout, _sel_layoutWithLayoutTag_, layoutTag); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: true, release: true); - } - - /// layoutWithLayout: - static AVAudioChannelLayout layoutWithLayout_( - ffi.Pointer layout) { - final _ret = _objc_msgSend_tk4ypl( - _class_AVAudioChannelLayout, _sel_layoutWithLayout_, layout); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: true, release: true); - } - - /// layoutTag - int get layoutTag { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_layoutTag); - } - - /// layout - ffi.Pointer get layout { - return _objc_msgSend_1ice9o9(this.ref.pointer, _sel_layout); - } - - /// channelCount - int get channelCount { - return _objc_msgSend_tfd317(this.ref.pointer, _sel_channelCount); - } - - /// new - static AVAudioChannelLayout new1() { - final _ret = _objc_msgSend_1unuoxw(_class_AVAudioChannelLayout, _sel_new); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static AVAudioChannelLayout allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_AVAudioChannelLayout, _sel_allocWithZone_, zone); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static AVAudioChannelLayout alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_AVAudioChannelLayout, _sel_alloc); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_AVAudioChannelLayout, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_AVAudioChannelLayout, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } + 8388608 => kAudioChannelBit_RightTopMiddle, + 16777216 => kAudioChannelBit_LeftTopRear, + 33554432 => kAudioChannelBit_CenterTopRear, + 67108864 => kAudioChannelBit_RightTopRear, + _ => + throw ArgumentError("Unknown value for AudioChannelBitmap: $value"), + }; - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_AVAudioChannelLayout, _sel_accessInstanceVariablesDirectly); + @override + String toString() { + if (this == kAudioChannelBit_TopCenterSurround) + return "AudioChannelBitmap.kAudioChannelBit_TopCenterSurround, AudioChannelBitmap.kAudioChannelBit_CenterTopMiddle"; + if (this == kAudioChannelBit_VerticalHeightLeft) + return "AudioChannelBitmap.kAudioChannelBit_VerticalHeightLeft, AudioChannelBitmap.kAudioChannelBit_LeftTopFront"; + if (this == kAudioChannelBit_VerticalHeightCenter) + return "AudioChannelBitmap.kAudioChannelBit_VerticalHeightCenter, AudioChannelBitmap.kAudioChannelBit_CenterTopFront"; + if (this == kAudioChannelBit_VerticalHeightRight) + return "AudioChannelBitmap.kAudioChannelBit_VerticalHeightRight, AudioChannelBitmap.kAudioChannelBit_RightTopFront"; + return super.toString(); } +} - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_AVAudioChannelLayout, _sel_useStoredAccessor); - } +enum AudioChannelFlags { + kAudioChannelFlags_AllOff(0), + kAudioChannelFlags_RectangularCoordinates(1), + kAudioChannelFlags_SphericalCoordinates(2), + kAudioChannelFlags_Meters(4); - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_AVAudioChannelLayout, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } + final int value; + const AudioChannelFlags(this.value); - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_AVAudioChannelLayout, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } + static AudioChannelFlags fromValue(int value) => switch (value) { + 0 => kAudioChannelFlags_AllOff, + 1 => kAudioChannelFlags_RectangularCoordinates, + 2 => kAudioChannelFlags_SphericalCoordinates, + 4 => kAudioChannelFlags_Meters, + _ => throw ArgumentError("Unknown value for AudioChannelFlags: $value"), + }; +} - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_AVAudioChannelLayout, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } +final class AudioChannelDescription extends ffi.Struct { + @ffi.UnsignedInt() + external int mChannelLabel; - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_AVAudioChannelLayout, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } + @ffi.UnsignedInt() + external int mChannelFlagsAsInt; - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_AVAudioChannelLayout, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } + AudioChannelFlags get mChannelFlags => + AudioChannelFlags.fromValue(mChannelFlagsAsInt); - /// self - AVAudioChannelLayout self() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_self); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: true, release: true); - } + @ffi.Array.multi([3]) + external ffi.Array mCoordinates; +} - /// retain - AVAudioChannelLayout retain() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_retain); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: true, release: true); - } +final class AudioChannelLayout extends ffi.Struct { + @ffi.UnsignedInt() + external int mChannelLayoutTag; - /// autorelease - AVAudioChannelLayout autorelease() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_autorelease); - return AVAudioChannelLayout.castFromPointer(_ret, - retain: true, release: true); - } + @ffi.UnsignedInt() + external int mChannelBitmapAsInt; - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_AVAudioChannelLayout, _sel_supportsSecureCoding); - } + AudioChannelBitmap get mChannelBitmap => + AudioChannelBitmap.fromValue(mChannelBitmapAsInt); - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } + @ffi.UnsignedInt() + external int mNumberChannelDescriptions; - /// initWithCoder: - AVAudioChannelLayout? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : AVAudioChannelLayout.castFromPointer(_ret, - retain: false, release: true); - } + @ffi.Array.multi([1]) + external ffi.Array mChannelDescriptions; } final class opaqueCMFormatDescription extends ffi.Opaque {} @@ -11618,476 +193,69 @@ enum AVAudioCommonFormat { }; } -late final _class_AVAudioFormat = objc.getClass("AVAudioFormat"); -late final _sel_initWithStreamDescription_ = - objc.registerName("initWithStreamDescription:"); -final _objc_msgSend_1ndg23i = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_initWithStreamDescription_channelLayout_ = - objc.registerName("initWithStreamDescription:channelLayout:"); -final _objc_msgSend_18zr4wd = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_initStandardFormatWithSampleRate_channels_ = - objc.registerName("initStandardFormatWithSampleRate:channels:"); -final _objc_msgSend_17dsvlf = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Double, ffi.Uint32)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, double, int)>(); -late final _sel_initStandardFormatWithSampleRate_channelLayout_ = - objc.registerName("initStandardFormatWithSampleRate:channelLayout:"); -late final _sel_initWithCommonFormat_sampleRate_channels_interleaved_ = - objc.registerName("initWithCommonFormat:sampleRate:channels:interleaved:"); -final _objc_msgSend_mosbvw = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Double, - ffi.Uint32, - ffi.Bool)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, int, double, int, bool)>(); -late final _sel_initWithCommonFormat_sampleRate_interleaved_channelLayout_ = - objc.registerName( - "initWithCommonFormat:sampleRate:interleaved:channelLayout:"); -final _objc_msgSend_1kvbzfo = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Double, - ffi.Bool, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - int, - double, - bool, - ffi.Pointer)>(); -late final _sel_initWithSettings_ = objc.registerName("initWithSettings:"); -late final _sel_initWithCMAudioFormatDescription_ = - objc.registerName("initWithCMAudioFormatDescription:"); -final _objc_msgSend_nbwfhi = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_isStandard = objc.registerName("isStandard"); -late final _sel_commonFormat = objc.registerName("commonFormat"); -final _objc_msgSend_115fnjc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_sampleRate = objc.registerName("sampleRate"); -late final _sel_isInterleaved = objc.registerName("isInterleaved"); -late final _sel_streamDescription = objc.registerName("streamDescription"); -final _objc_msgSend_irgetq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_channelLayout = objc.registerName("channelLayout"); -late final _sel_magicCookie = objc.registerName("magicCookie"); -late final _sel_setMagicCookie_ = objc.registerName("setMagicCookie:"); -late final _sel_settings = objc.registerName("settings"); -late final _sel_formatDescription = objc.registerName("formatDescription"); -final _objc_msgSend_1ot92k6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - +/// WARNING: AVAudioFormat is a stub. To generate bindings for this class, include +/// AVAudioFormat in your config's objc-interfaces list. +/// /// AVAudioFormat -class AVAudioFormat extends objc.NSObject { - AVAudioFormat._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [AVAudioFormat] that points to the same underlying object as [other]. - AVAudioFormat.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [AVAudioFormat] that wraps the given raw object pointer. - AVAudioFormat.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [AVAudioFormat]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_AVAudioFormat); - } - - /// initWithStreamDescription: - AVAudioFormat? initWithStreamDescription_( - ffi.Pointer asbd) { - final _ret = _objc_msgSend_1ndg23i(this.ref.retainAndReturnPointer(), - _sel_initWithStreamDescription_, asbd); - return _ret.address == 0 - ? null - : AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithStreamDescription:channelLayout: - AVAudioFormat? initWithStreamDescription_channelLayout_( - ffi.Pointer asbd, - AVAudioChannelLayout? layout) { - final _ret = _objc_msgSend_18zr4wd( - this.ref.retainAndReturnPointer(), - _sel_initWithStreamDescription_channelLayout_, - asbd, - layout?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// initStandardFormatWithSampleRate:channels: - AVAudioFormat? initStandardFormatWithSampleRate_channels_( - double sampleRate, int channels) { - final _ret = _objc_msgSend_17dsvlf(this.ref.retainAndReturnPointer(), - _sel_initStandardFormatWithSampleRate_channels_, sampleRate, channels); - return _ret.address == 0 - ? null - : AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// initStandardFormatWithSampleRate:channelLayout: - AVAudioFormat initStandardFormatWithSampleRate_channelLayout_( - double sampleRate, AVAudioChannelLayout layout) { - final _ret = _objc_msgSend_m6z6pt( - this.ref.retainAndReturnPointer(), - _sel_initStandardFormatWithSampleRate_channelLayout_, - sampleRate, - layout.ref.pointer); - return AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCommonFormat:sampleRate:channels:interleaved: - AVAudioFormat? initWithCommonFormat_sampleRate_channels_interleaved_( - AVAudioCommonFormat format, - double sampleRate, - int channels, - bool interleaved) { - final _ret = _objc_msgSend_mosbvw( - this.ref.retainAndReturnPointer(), - _sel_initWithCommonFormat_sampleRate_channels_interleaved_, - format.value, - sampleRate, - channels, - interleaved); - return _ret.address == 0 - ? null - : AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCommonFormat:sampleRate:interleaved:channelLayout: - AVAudioFormat initWithCommonFormat_sampleRate_interleaved_channelLayout_( - AVAudioCommonFormat format, - double sampleRate, - bool interleaved, - AVAudioChannelLayout layout) { - final _ret = _objc_msgSend_1kvbzfo( - this.ref.retainAndReturnPointer(), - _sel_initWithCommonFormat_sampleRate_interleaved_channelLayout_, - format.value, - sampleRate, - interleaved, - layout.ref.pointer); - return AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithSettings: - AVAudioFormat? initWithSettings_(objc.NSDictionary settings) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithSettings_, settings.ref.pointer); - return _ret.address == 0 - ? null - : AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCMAudioFormatDescription: - AVAudioFormat initWithCMAudioFormatDescription_( - ffi.Pointer formatDescription) { - final _ret = _objc_msgSend_nbwfhi(this.ref.retainAndReturnPointer(), - _sel_initWithCMAudioFormatDescription_, formatDescription); - return AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// isEqual: - bool isEqual_(objc.ObjCObjectBase object) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isEqual_, object.ref.pointer); - } - - /// isStandard - bool get standard { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isStandard); - } - - /// commonFormat - AVAudioCommonFormat get commonFormat { - final _ret = _objc_msgSend_115fnjc(this.ref.pointer, _sel_commonFormat); - return AVAudioCommonFormat.fromValue(_ret); - } - - /// channelCount - int get channelCount { - return _objc_msgSend_tfd317(this.ref.pointer, _sel_channelCount); - } - - /// sampleRate - double get sampleRate { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_sampleRate); - } - - /// isInterleaved - bool get interleaved { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isInterleaved); - } - - /// streamDescription - ffi.Pointer get streamDescription { - return _objc_msgSend_irgetq(this.ref.pointer, _sel_streamDescription); - } - - /// channelLayout - AVAudioChannelLayout? get channelLayout { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_channelLayout); - return _ret.address == 0 - ? null - : AVAudioChannelLayout.castFromPointer(_ret, - retain: true, release: true); - } - - /// magicCookie - objc.NSData? get magicCookie { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_magicCookie); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// setMagicCookie: - set magicCookie(objc.NSData? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setMagicCookie_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// settings - objc.NSDictionary get settings { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_settings); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// formatDescription - ffi.Pointer get formatDescription { - return _objc_msgSend_1ot92k6(this.ref.pointer, _sel_formatDescription); - } - - /// init - AVAudioFormat init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static AVAudioFormat new1() { - final _ret = _objc_msgSend_1unuoxw(_class_AVAudioFormat, _sel_new); - return AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static AVAudioFormat allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_AVAudioFormat, _sel_allocWithZone_, zone); - return AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static AVAudioFormat alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_AVAudioFormat, _sel_alloc); - return AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_AVAudioFormat, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_AVAudioFormat, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_AVAudioFormat, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_AVAudioFormat, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_AVAudioFormat, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_AVAudioFormat, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_AVAudioFormat, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_AVAudioFormat, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_AVAudioFormat, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// self - AVAudioFormat self() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_self); - return AVAudioFormat.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - AVAudioFormat retain() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_retain); - return AVAudioFormat.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - AVAudioFormat autorelease() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_autorelease); - return AVAudioFormat.castFromPointer(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_AVAudioFormat, _sel_supportsSecureCoding); - } +class AVAudioFormat extends objc.NSObject { + AVAudioFormat._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } + /// Constructs a [AVAudioFormat] that points to the same underlying object as [other]. + AVAudioFormat.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// initWithCoder: - AVAudioFormat? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : AVAudioFormat.castFromPointer(_ret, retain: false, release: true); - } + /// Constructs a [AVAudioFormat] that wraps the given raw object pointer. + AVAudioFormat.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); } late final _class_AVAudioPlayer = objc.getClass("AVAudioPlayer"); +late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); +final _objc_msgSend_69e0x1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +typedef instancetype = ffi.Pointer; +typedef Dartinstancetype = objc.ObjCObjectBase; late final _sel_initWithContentsOfURL_error_ = objc.registerName("initWithContentsOfURL:error:"); +final _objc_msgSend_1705co6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); late final _sel_initWithData_error_ = objc.registerName("initWithData:error:"); late final _sel_initWithContentsOfURL_fileTypeHint_error_ = objc.registerName("initWithContentsOfURL:fileTypeHint:error:"); -final _objc_msgSend_1lpsn5w = objc.msgSendPointer +final _objc_msgSend_bo6ep4 = objc.msgSendPointer .cast< ffi.NativeFunction< - instancetype Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>() .asFunction< - instancetype Function( + ffi.Pointer Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -12096,9 +264,17 @@ final _objc_msgSend_1lpsn5w = objc.msgSendPointer late final _sel_initWithData_fileTypeHint_error_ = objc.registerName("initWithData:fileTypeHint:error:"); late final _sel_prepareToPlay = objc.registerName("prepareToPlay"); +final _objc_msgSend_91o635 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, ffi.Pointer)>(); late final _sel_play = objc.registerName("play"); late final _sel_playAtTime_ = objc.registerName("playAtTime:"); -final _objc_msgSend_1hnh3lf = objc.msgSendPointer +final _objc_msgSend_18chyc = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Bool Function(ffi.Pointer, @@ -12106,15 +282,69 @@ final _objc_msgSend_1hnh3lf = objc.msgSendPointer .asFunction< bool Function(ffi.Pointer, ffi.Pointer, double)>(); +late final _sel_pause = objc.registerName("pause"); +final _objc_msgSend_1pl9qdv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>(); late final _sel_stop = objc.registerName("stop"); late final _sel_isPlaying = objc.registerName("isPlaying"); late final _sel_numberOfChannels = objc.registerName("numberOfChannels"); +final _objc_msgSend_xw2lbc = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); late final _sel_duration = objc.registerName("duration"); +final _objc_msgSend_1ukqyt8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); late final _sel_currentDevice = objc.registerName("currentDevice"); +final _objc_msgSend_1x359cv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); late final _sel_setCurrentDevice_ = objc.registerName("setCurrentDevice:"); +final _objc_msgSend_1jdvcbf = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_delegate = objc.registerName("delegate"); +late final _sel_setDelegate_ = objc.registerName("setDelegate:"); late final _sel_url = objc.registerName("url"); +late final _sel_data = objc.registerName("data"); late final _sel_pan = objc.registerName("pan"); -final _objc_msgSend_fcilgx = objc.msgSendPointer +final _objc_msgSend_2cgrxl = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Float Function(ffi.Pointer, @@ -12122,7 +352,7 @@ final _objc_msgSend_fcilgx = objc.msgSendPointer .asFunction< double Function( ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_fcilgxFpret = objc.msgSendFpretPointer +final _objc_msgSend_2cgrxlFpret = objc.msgSendFpretPointer .cast< ffi.NativeFunction< ffi.Float Function(ffi.Pointer, @@ -12131,7 +361,7 @@ final _objc_msgSend_fcilgxFpret = objc.msgSendFpretPointer double Function( ffi.Pointer, ffi.Pointer)>(); late final _sel_setPan_ = objc.registerName("setPan:"); -final _objc_msgSend_s9gjzc = objc.msgSendPointer +final _objc_msgSend_v5hmet = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, @@ -12143,7 +373,7 @@ late final _sel_volume = objc.registerName("volume"); late final _sel_setVolume_ = objc.registerName("setVolume:"); late final _sel_setVolume_fadeDuration_ = objc.registerName("setVolume:fadeDuration:"); -final _objc_msgSend_1kev0m2 = objc.msgSendPointer +final _objc_msgSend_1p4uk9e = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, @@ -12153,20 +383,53 @@ final _objc_msgSend_1kev0m2 = objc.msgSendPointer ffi.Pointer, double, double)>(); late final _sel_enableRate = objc.registerName("enableRate"); late final _sel_setEnableRate_ = objc.registerName("setEnableRate:"); +final _objc_msgSend_1s56lr9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, bool)>(); late final _sel_rate = objc.registerName("rate"); late final _sel_setRate_ = objc.registerName("setRate:"); late final _sel_currentTime = objc.registerName("currentTime"); late final _sel_setCurrentTime_ = objc.registerName("setCurrentTime:"); +final _objc_msgSend_hwm8nu = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Double)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, double)>(); late final _sel_deviceCurrentTime = objc.registerName("deviceCurrentTime"); late final _sel_numberOfLoops = objc.registerName("numberOfLoops"); +final _objc_msgSend_1hz7y9r = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); late final _sel_setNumberOfLoops_ = objc.registerName("setNumberOfLoops:"); +final _objc_msgSend_4sp4xj = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_settings = objc.registerName("settings"); late final _sel_format = objc.registerName("format"); late final _sel_isMeteringEnabled = objc.registerName("isMeteringEnabled"); late final _sel_setMeteringEnabled_ = objc.registerName("setMeteringEnabled:"); late final _sel_updateMeters = objc.registerName("updateMeters"); late final _sel_peakPowerForChannel_ = objc.registerName("peakPowerForChannel:"); -final _objc_msgSend_imxjxz = objc.msgSendPointer +final _objc_msgSend_65s5yw = objc.msgSendPointer .cast< ffi.NativeFunction< ffi.Float Function(ffi.Pointer, @@ -12174,7 +437,7 @@ final _objc_msgSend_imxjxz = objc.msgSendPointer .asFunction< double Function(ffi.Pointer, ffi.Pointer, int)>(); -final _objc_msgSend_imxjxzFpret = objc.msgSendFpretPointer +final _objc_msgSend_65s5ywFpret = objc.msgSendFpretPointer .cast< ffi.NativeFunction< ffi.Float Function(ffi.Pointer, @@ -12187,6 +450,116 @@ late final _sel_averagePowerForChannel_ = late final _sel_channelAssignments = objc.registerName("channelAssignments"); late final _sel_setChannelAssignments_ = objc.registerName("setChannelAssignments:"); +late final _sel_init = objc.registerName("init"); +late final _sel_new = objc.registerName("new"); +late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); +final _objc_msgSend_hzlb60 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); +late final _sel_alloc = objc.registerName("alloc"); +late final _sel_self = objc.registerName("self"); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock Function(ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer)>( + pointer, + retain: retain, + release: release); + + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock Function(ffi.Pointer)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock Function(ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock Function(ffi.Pointer)> + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension on objc + .ObjCBlock Function(ffi.Pointer)> { + objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); +} + +late final _sel_retain = objc.registerName("retain"); +late final _sel_autorelease = objc.registerName("autorelease"); /// AVAudioPlayer class AVAudioPlayer extends objc.NSObject { @@ -12205,14 +578,14 @@ class AVAudioPlayer extends objc.NSObject { /// Returns whether [obj] is an instance of [AVAudioPlayer]. static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( + return _objc_msgSend_69e0x1( obj.ref.pointer, _sel_isKindOfClass_, _class_AVAudioPlayer); } /// initWithContentsOfURL:error: AVAudioPlayer? initWithContentsOfURL_error_( objc.NSURL url, ffi.Pointer> outError) { - final _ret = _objc_msgSend_1y425zh(this.ref.retainAndReturnPointer(), + final _ret = _objc_msgSend_1705co6(this.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_error_, url.ref.pointer, outError); return _ret.address == 0 ? null @@ -12222,7 +595,7 @@ class AVAudioPlayer extends objc.NSObject { /// initWithData:error: AVAudioPlayer? initWithData_error_( objc.NSData data, ffi.Pointer> outError) { - final _ret = _objc_msgSend_1y425zh(this.ref.retainAndReturnPointer(), + final _ret = _objc_msgSend_1705co6(this.ref.retainAndReturnPointer(), _sel_initWithData_error_, data.ref.pointer, outError); return _ret.address == 0 ? null @@ -12234,7 +607,7 @@ class AVAudioPlayer extends objc.NSObject { objc.NSURL url, objc.NSString? utiString, ffi.Pointer> outError) { - final _ret = _objc_msgSend_1lpsn5w( + final _ret = _objc_msgSend_bo6ep4( this.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_fileTypeHint_error_, url.ref.pointer, @@ -12250,7 +623,7 @@ class AVAudioPlayer extends objc.NSObject { objc.NSData data, objc.NSString? utiString, ffi.Pointer> outError) { - final _ret = _objc_msgSend_1lpsn5w( + final _ret = _objc_msgSend_bo6ep4( this.ref.retainAndReturnPointer(), _sel_initWithData_fileTypeHint_error_, data.ref.pointer, @@ -12263,47 +636,49 @@ class AVAudioPlayer extends objc.NSObject { /// prepareToPlay bool prepareToPlay() { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_prepareToPlay); + return _objc_msgSend_91o635(this.ref.pointer, _sel_prepareToPlay); } /// play bool play() { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_play); + return _objc_msgSend_91o635(this.ref.pointer, _sel_play); } /// playAtTime: bool playAtTime_(double time) { - return _objc_msgSend_1hnh3lf(this.ref.pointer, _sel_playAtTime_, time); + return _objc_msgSend_18chyc(this.ref.pointer, _sel_playAtTime_, time); } /// pause void pause() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_pause); + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_pause); } /// stop void stop() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_stop); + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_stop); } /// isPlaying bool get playing { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPlaying); + return _objc_msgSend_91o635(this.ref.pointer, _sel_isPlaying); } /// numberOfChannels int get numberOfChannels { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_numberOfChannels); + return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_numberOfChannels); } /// duration double get duration { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_duration); + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_duration) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_duration); } /// currentDevice objc.NSString? get currentDevice { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_currentDevice); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_currentDevice); return _ret.address == 0 ? null : objc.NSString.castFromPointer(_ret, retain: true, release: true); @@ -12311,13 +686,13 @@ class AVAudioPlayer extends objc.NSObject { /// setCurrentDevice: set currentDevice(objc.NSString? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setCurrentDevice_, + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setCurrentDevice_, value?.ref.pointer ?? ffi.nullptr); } /// delegate objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_delegate); return _ret.address == 0 ? null : objc.ObjCObjectBase(_ret, retain: true, release: true); @@ -12325,13 +700,13 @@ class AVAudioPlayer extends objc.NSObject { /// setDelegate: set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq( + return _objc_msgSend_1jdvcbf( this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); } /// url objc.NSURL? get url { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_url); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_url); return _ret.address == 0 ? null : objc.NSURL.castFromPointer(_ret, retain: true, release: true); @@ -12339,7 +714,7 @@ class AVAudioPlayer extends objc.NSObject { /// data objc.NSData? get data { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_data); return _ret.address == 0 ? null : objc.NSData.castFromPointer(_ret, retain: true, release: true); @@ -12348,131 +723,135 @@ class AVAudioPlayer extends objc.NSObject { /// pan double get pan { return objc.useMsgSendVariants - ? _objc_msgSend_fcilgxFpret(this.ref.pointer, _sel_pan) - : _objc_msgSend_fcilgx(this.ref.pointer, _sel_pan); + ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_pan) + : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_pan); } /// setPan: set pan(double value) { - return _objc_msgSend_s9gjzc(this.ref.pointer, _sel_setPan_, value); + return _objc_msgSend_v5hmet(this.ref.pointer, _sel_setPan_, value); } /// volume double get volume { return objc.useMsgSendVariants - ? _objc_msgSend_fcilgxFpret(this.ref.pointer, _sel_volume) - : _objc_msgSend_fcilgx(this.ref.pointer, _sel_volume); + ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_volume) + : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_volume); } /// setVolume: set volume(double value) { - return _objc_msgSend_s9gjzc(this.ref.pointer, _sel_setVolume_, value); + return _objc_msgSend_v5hmet(this.ref.pointer, _sel_setVolume_, value); } /// setVolume:fadeDuration: void setVolume_fadeDuration_(double volume, double duration) { - _objc_msgSend_1kev0m2( + _objc_msgSend_1p4uk9e( this.ref.pointer, _sel_setVolume_fadeDuration_, volume, duration); } /// enableRate bool get enableRate { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_enableRate); + return _objc_msgSend_91o635(this.ref.pointer, _sel_enableRate); } /// setEnableRate: set enableRate(bool value) { - return _objc_msgSend_117qins(this.ref.pointer, _sel_setEnableRate_, value); + return _objc_msgSend_1s56lr9(this.ref.pointer, _sel_setEnableRate_, value); } /// rate double get rate { return objc.useMsgSendVariants - ? _objc_msgSend_fcilgxFpret(this.ref.pointer, _sel_rate) - : _objc_msgSend_fcilgx(this.ref.pointer, _sel_rate); + ? _objc_msgSend_2cgrxlFpret(this.ref.pointer, _sel_rate) + : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_rate); } /// setRate: set rate(double value) { - return _objc_msgSend_s9gjzc(this.ref.pointer, _sel_setRate_, value); + return _objc_msgSend_v5hmet(this.ref.pointer, _sel_setRate_, value); } /// currentTime double get currentTime { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_currentTime); + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_currentTime) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_currentTime); } /// setCurrentTime: set currentTime(double value) { - return _objc_msgSend_suh039(this.ref.pointer, _sel_setCurrentTime_, value); + return _objc_msgSend_hwm8nu(this.ref.pointer, _sel_setCurrentTime_, value); } /// deviceCurrentTime double get deviceCurrentTime { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_deviceCurrentTime); + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(this.ref.pointer, _sel_deviceCurrentTime) + : _objc_msgSend_1ukqyt8(this.ref.pointer, _sel_deviceCurrentTime); } /// numberOfLoops int get numberOfLoops { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_numberOfLoops); + return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_numberOfLoops); } /// setNumberOfLoops: set numberOfLoops(int value) { - return _objc_msgSend_ke7qz2( + return _objc_msgSend_4sp4xj( this.ref.pointer, _sel_setNumberOfLoops_, value); } /// settings objc.NSDictionary get settings { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_settings); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_settings); return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } /// format AVAudioFormat get format { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_format); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_format); return AVAudioFormat.castFromPointer(_ret, retain: true, release: true); } /// isMeteringEnabled bool get meteringEnabled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isMeteringEnabled); + return _objc_msgSend_91o635(this.ref.pointer, _sel_isMeteringEnabled); } /// setMeteringEnabled: set meteringEnabled(bool value) { - return _objc_msgSend_117qins( + return _objc_msgSend_1s56lr9( this.ref.pointer, _sel_setMeteringEnabled_, value); } /// updateMeters void updateMeters() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_updateMeters); + _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_updateMeters); } /// peakPowerForChannel: double peakPowerForChannel_(int channelNumber) { return objc.useMsgSendVariants - ? _objc_msgSend_imxjxzFpret( + ? _objc_msgSend_65s5ywFpret( this.ref.pointer, _sel_peakPowerForChannel_, channelNumber) - : _objc_msgSend_imxjxz( + : _objc_msgSend_65s5yw( this.ref.pointer, _sel_peakPowerForChannel_, channelNumber); } /// averagePowerForChannel: double averagePowerForChannel_(int channelNumber) { return objc.useMsgSendVariants - ? _objc_msgSend_imxjxzFpret( + ? _objc_msgSend_65s5ywFpret( this.ref.pointer, _sel_averagePowerForChannel_, channelNumber) - : _objc_msgSend_imxjxz( + : _objc_msgSend_65s5yw( this.ref.pointer, _sel_averagePowerForChannel_, channelNumber); } /// channelAssignments objc.NSArray? get channelAssignments { final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_channelAssignments); + _objc_msgSend_1x359cv(this.ref.pointer, _sel_channelAssignments); return _ret.address == 0 ? null : objc.NSArray.castFromPointer(_ret, retain: true, release: true); @@ -12480,119 +859,51 @@ class AVAudioPlayer extends objc.NSObject { /// setChannelAssignments: set channelAssignments(objc.NSArray? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setChannelAssignments_, + return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setChannelAssignments_, value?.ref.pointer ?? ffi.nullptr); } /// init AVAudioPlayer init() { final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); return AVAudioPlayer.castFromPointer(_ret, retain: false, release: true); } /// new static AVAudioPlayer new1() { - final _ret = _objc_msgSend_1unuoxw(_class_AVAudioPlayer, _sel_new); + final _ret = _objc_msgSend_1x359cv(_class_AVAudioPlayer, _sel_new); return AVAudioPlayer.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: static AVAudioPlayer allocWithZone_(ffi.Pointer<_NSZone> zone) { final _ret = - _objc_msgSend_1b3ihd0(_class_AVAudioPlayer, _sel_allocWithZone_, zone); + _objc_msgSend_hzlb60(_class_AVAudioPlayer, _sel_allocWithZone_, zone); return AVAudioPlayer.castFromPointer(_ret, retain: false, release: true); } /// alloc static AVAudioPlayer alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_AVAudioPlayer, _sel_alloc); + final _ret = _objc_msgSend_1x359cv(_class_AVAudioPlayer, _sel_alloc); return AVAudioPlayer.castFromPointer(_ret, retain: false, release: true); } - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_AVAudioPlayer, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_AVAudioPlayer, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_AVAudioPlayer, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_AVAudioPlayer, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_AVAudioPlayer, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_AVAudioPlayer, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_AVAudioPlayer, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_AVAudioPlayer, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_AVAudioPlayer, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - /// self AVAudioPlayer self() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_self); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); return AVAudioPlayer.castFromPointer(_ret, retain: true, release: true); } /// retain AVAudioPlayer retain() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_retain); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); return AVAudioPlayer.castFromPointer(_ret, retain: true, release: true); } /// autorelease AVAudioPlayer autorelease() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_autorelease); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); return AVAudioPlayer.castFromPointer(_ret, retain: true, release: true); } } diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart.m b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart.m deleted file mode 100644 index d998e61da..000000000 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart.m +++ /dev/null @@ -1,49 +0,0 @@ -#include -#import - -#if !__has_feature(objc_arc) -#error "This file must be compiled with ARC enabled" -#endif - -id objc_retain(id); -id objc_retainBlock(id); - -typedef void (^_ListenerTrampoline)(); -_ListenerTrampoline _AVFAudio_wrapListenerBlock_ksby9f(_ListenerTrampoline block) NS_RETURNS_RETAINED { - return ^void() { - objc_retainBlock(block); - block(); - }; -} - -typedef void (^_ListenerTrampoline1)(unsigned long arg0, BOOL * arg1); -_ListenerTrampoline1 _AVFAudio_wrapListenerBlock_l9klhe(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { - return ^void(unsigned long arg0, BOOL * arg1) { - objc_retainBlock(block); - block(arg0, arg1); - }; -} - -typedef void (^_ListenerTrampoline2)(id arg0); -_ListenerTrampoline2 _AVFAudio_wrapListenerBlock_ukcdfq(_ListenerTrampoline2 block) NS_RETURNS_RETAINED { - return ^void(id arg0) { - objc_retainBlock(block); - block(objc_retain(arg0)); - }; -} - -typedef void (^_ListenerTrampoline3)(id arg0, id arg1); -_ListenerTrampoline3 _AVFAudio_wrapListenerBlock_1tjlcwl(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { - return ^void(id arg0, id arg1) { - objc_retainBlock(block); - block(objc_retain(arg0), objc_retain(arg1)); - }; -} - -typedef void (^_ListenerTrampoline4)(void * arg0, id arg1); -_ListenerTrampoline4 _AVFAudio_wrapListenerBlock_sjfpmz(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1) { - objc_retainBlock(block); - block(arg0, objc_retain(arg1)); - }; -} diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index 771581b44..8f3b41625 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -15,11180 +15,159 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _SwiftLibrary_wrapListenerBlock_ksby9f( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _SwiftLibrary_wrapListenerBlock_l9klhe( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _SwiftLibrary_wrapListenerBlock_ukcdfq( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer - _SwiftLibrary_wrapListenerBlock_1tjlcwl( - ffi.Pointer block, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer)>(isLeaf: true) -external ffi.Pointer _SwiftLibrary_wrapListenerBlock_sjfpmz( - ffi.Pointer block, -); - -final class CGPoint extends ffi.Struct { - @ffi.Double() - external double x; - - @ffi.Double() - external double y; -} - -final class CGSize extends ffi.Struct { - @ffi.Double() - external double width; - - @ffi.Double() - external double height; -} - -final class CGRect extends ffi.Struct { - external CGPoint origin; - - external CGSize size; -} - -final class __CFRunLoop extends ffi.Opaque {} - -void _ObjCBlock_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, -) => - block.ref.target - .cast>() - .asFunction()(); -ffi.Pointer _ObjCBlock_ffiVoid_fnPtrCallable = ffi.Pointer - .fromFunction)>( - _ObjCBlock_ffiVoid_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_closureTrampoline( - ffi.Pointer block, -) => - (objc.getBlockClosure(block) as void Function())(); -ffi.Pointer _ObjCBlock_ffiVoid_closureCallable = ffi.Pointer - .fromFunction)>( - _ObjCBlock_ffiVoid_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_listenerTrampoline( - ffi.Pointer block, -) { - (objc.getBlockClosure(block) as void Function())(); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable)> - _ObjCBlock_ffiVoid_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer> ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction(void Function() fn) => - objc.ObjCBlock( - objc.newClosureBlock(_ObjCBlock_ffiVoid_closureCallable, () => fn()), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener(void Function() fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_listenerCallable.nativeFunction.cast(), () => fn()); - final wrapper = _SwiftLibrary_wrapListenerBlock_ksby9f(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_CallExtension - on objc.ObjCBlock { - void call() => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block)>>() - .asFunction)>()( - ref.pointer, - ); -} - -final class _NSZone extends ffi.Opaque {} - -int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrTrampoline, - 0) - .cast(); -int _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as int Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable = - ffi.Pointer.fromFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureTrampoline, - 0) - .cast(); - -/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. -abstract final class ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Long Function( - ffi.Pointer, ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock, ffi.Pointer)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => - objc.ObjCBlock< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>( - objc.newPointerBlock( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_fnPtrCallable, - ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, ffi.Pointer)> - fromFunction(objc.NSComparisonResult Function(objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => - objc.ObjCBlock, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(objc.ObjCObjectBase(arg0, retain: true, release: true), - objc.ObjCObjectBase(arg1, retain: true, release: true)) - .value), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. -extension ObjCBlock_NSComparisonResult_objcObjCObject_objcObjCObject_CallExtension - on objc.ObjCBlock< - ffi.Long Function( - ffi.Pointer, ffi.Pointer)> { - objc.NSComparisonResult call( - objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1) => - objc.NSComparisonResult.fromValue(ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer)); -} - -enum NSQualityOfService { - NSQualityOfServiceUserInteractive(33), - NSQualityOfServiceUserInitiated(25), - NSQualityOfServiceUtility(17), - NSQualityOfServiceBackground(9), - NSQualityOfServiceDefault(-1); - - final int value; - const NSQualityOfService(this.value); - - static NSQualityOfService fromValue(int value) => switch (value) { - 33 => NSQualityOfServiceUserInteractive, - 25 => NSQualityOfServiceUserInitiated, - 17 => NSQualityOfServiceUtility, - 9 => NSQualityOfServiceBackground, - -1 => NSQualityOfServiceDefault, - _ => - throw ArgumentError("Unknown value for NSQualityOfService: $value"), - }; -} - -enum NSCollectionChangeType { - NSCollectionChangeInsert(0), - NSCollectionChangeRemove(1); - - final int value; - const NSCollectionChangeType(this.value); - - static NSCollectionChangeType fromValue(int value) => switch (value) { - 0 => NSCollectionChangeInsert, - 1 => NSCollectionChangeRemove, - _ => throw ArgumentError( - "Unknown value for NSCollectionChangeType: $value"), - }; -} - -late final _class_NSOrderedCollectionChange = - objc.getClass("NSOrderedCollectionChange"); -late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); -final _objc_msgSend_l8lotg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_changeWithObject_type_index_ = - objc.registerName("changeWithObject:type:index:"); -final _objc_msgSend_klnnzp = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int)>(); -late final _sel_changeWithObject_type_index_associatedIndex_ = - objc.registerName("changeWithObject:type:index:associatedIndex:"); -final _objc_msgSend_fg75bt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.UnsignedLong, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - int)>(); -late final _sel_object = objc.registerName("object"); -final _objc_msgSend_1unuoxw = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_changeType = objc.registerName("changeType"); -final _objc_msgSend_1ocvcq4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_index = objc.registerName("index"); -final _objc_msgSend_eldhrq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_associatedIndex = objc.registerName("associatedIndex"); -typedef instancetype = ffi.Pointer; -typedef Dartinstancetype = objc.ObjCObjectBase; -late final _sel_init = objc.registerName("init"); -late final _sel_initWithObject_type_index_ = - objc.registerName("initWithObject:type:index:"); -late final _sel_initWithObject_type_index_associatedIndex_ = - objc.registerName("initWithObject:type:index:associatedIndex:"); -late final _sel_new = objc.registerName("new"); -late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); -final _objc_msgSend_1b3ihd0 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_NSZone>)>(); -late final _sel_alloc = objc.registerName("alloc"); -late final _sel_cancelPreviousPerformRequestsWithTarget_selector_object_ = objc - .registerName("cancelPreviousPerformRequestsWithTarget:selector:object:"); -final _objc_msgSend_1587kfn = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_cancelPreviousPerformRequestsWithTarget_ = - objc.registerName("cancelPreviousPerformRequestsWithTarget:"); -final _objc_msgSend_ukcdfq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_accessInstanceVariablesDirectly = - objc.registerName("accessInstanceVariablesDirectly"); -final _objc_msgSend_olxnu1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_useStoredAccessor = objc.registerName("useStoredAccessor"); -late final _sel_keyPathsForValuesAffectingValueForKey_ = - objc.registerName("keyPathsForValuesAffectingValueForKey:"); -final _objc_msgSend_juohf7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_automaticallyNotifiesObserversForKey_ = - objc.registerName("automaticallyNotifiesObserversForKey:"); -late final _sel_setKeys_triggerChangeNotificationsForDependentKey_ = - objc.registerName("setKeys:triggerChangeNotificationsForDependentKey:"); -final _objc_msgSend_1tjlcwl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_classFallbacksForKeyedArchiver = - objc.registerName("classFallbacksForKeyedArchiver"); -late final _sel_classForKeyedUnarchiver = - objc.registerName("classForKeyedUnarchiver"); - -/// NSOrderedCollectionChange -class NSOrderedCollectionChange extends objc.NSObject { - NSOrderedCollectionChange._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSOrderedCollectionChange] that points to the same underlying object as [other]. - NSOrderedCollectionChange.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSOrderedCollectionChange] that wraps the given raw object pointer. - NSOrderedCollectionChange.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSOrderedCollectionChange]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSOrderedCollectionChange); - } - - /// changeWithObject:type:index: - static NSOrderedCollectionChange changeWithObject_type_index_( - objc.ObjCObjectBase anObject, NSCollectionChangeType type, int index) { - final _ret = _objc_msgSend_klnnzp( - _class_NSOrderedCollectionChange, - _sel_changeWithObject_type_index_, - anObject.ref.pointer, - type.value, - index); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: true, release: true); - } - - /// changeWithObject:type:index:associatedIndex: - static NSOrderedCollectionChange changeWithObject_type_index_associatedIndex_( - objc.ObjCObjectBase anObject, - NSCollectionChangeType type, - int index, - int associatedIndex) { - final _ret = _objc_msgSend_fg75bt( - _class_NSOrderedCollectionChange, - _sel_changeWithObject_type_index_associatedIndex_, - anObject.ref.pointer, - type.value, - index, - associatedIndex); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: true, release: true); - } - - /// object - objc.ObjCObjectBase get object { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_object); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// changeType - NSCollectionChangeType get changeType { - final _ret = _objc_msgSend_1ocvcq4(this.ref.pointer, _sel_changeType); - return NSCollectionChangeType.fromValue(_ret); - } - - /// index - int get index { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_index); - } - - /// associatedIndex - int get associatedIndex { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_associatedIndex); - } - - /// init - NSOrderedCollectionChange init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithObject:type:index: - NSOrderedCollectionChange initWithObject_type_index_( - objc.ObjCObjectBase anObject, NSCollectionChangeType type, int index) { - final _ret = _objc_msgSend_klnnzp( - this.ref.retainAndReturnPointer(), - _sel_initWithObject_type_index_, - anObject.ref.pointer, - type.value, - index); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithObject:type:index:associatedIndex: - NSOrderedCollectionChange initWithObject_type_index_associatedIndex_( - objc.ObjCObjectBase anObject, - NSCollectionChangeType type, - int index, - int associatedIndex) { - final _ret = _objc_msgSend_fg75bt( - this.ref.retainAndReturnPointer(), - _sel_initWithObject_type_index_associatedIndex_, - anObject.ref.pointer, - type.value, - index, - associatedIndex); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSOrderedCollectionChange new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSOrderedCollectionChange, _sel_new); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSOrderedCollectionChange allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSOrderedCollectionChange, _sel_allocWithZone_, zone); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSOrderedCollectionChange alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSOrderedCollectionChange, _sel_alloc); - return NSOrderedCollectionChange.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSOrderedCollectionChange, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSOrderedCollectionChange, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSOrderedCollectionChange, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSOrderedCollectionChange, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSOrderedCollectionChange, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSOrderedCollectionChange, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSOrderedCollectionChange, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSOrderedCollectionChange, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSOrderedCollectionChange, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSProgress = objc.getClass("NSProgress"); -late final _sel_currentProgress = objc.registerName("currentProgress"); -late final _sel_progressWithTotalUnitCount_ = - objc.registerName("progressWithTotalUnitCount:"); -final _objc_msgSend_n9eq1n = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_discreteProgressWithTotalUnitCount_ = - objc.registerName("discreteProgressWithTotalUnitCount:"); -late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_ = - objc.registerName("progressWithTotalUnitCount:parent:pendingUnitCount:"); -final _objc_msgSend_105mybv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ffi.Int64)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int)>(); -late final _sel_initWithParent_userInfo_ = - objc.registerName("initWithParent:userInfo:"); -final _objc_msgSend_iq11qg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_becomeCurrentWithPendingUnitCount_ = - objc.registerName("becomeCurrentWithPendingUnitCount:"); -final _objc_msgSend_rrr3q = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_ = - objc.registerName("performAsCurrentWithPendingUnitCount:usingBlock:"); -final _objc_msgSend_19q84do = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_resignCurrent = objc.registerName("resignCurrent"); -final _objc_msgSend_ksby9f = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_addChild_withPendingUnitCount_ = - objc.registerName("addChild:withPendingUnitCount:"); -final _objc_msgSend_2citz1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int64)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_totalUnitCount = objc.registerName("totalUnitCount"); -final _objc_msgSend_1voti03 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Int64 Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setTotalUnitCount_ = objc.registerName("setTotalUnitCount:"); -late final _sel_completedUnitCount = objc.registerName("completedUnitCount"); -late final _sel_setCompletedUnitCount_ = - objc.registerName("setCompletedUnitCount:"); -late final _sel_localizedDescription = - objc.registerName("localizedDescription"); -late final _sel_setLocalizedDescription_ = - objc.registerName("setLocalizedDescription:"); -late final _sel_localizedAdditionalDescription = - objc.registerName("localizedAdditionalDescription"); -late final _sel_setLocalizedAdditionalDescription_ = - objc.registerName("setLocalizedAdditionalDescription:"); -late final _sel_isCancellable = objc.registerName("isCancellable"); -late final _sel_setCancellable_ = objc.registerName("setCancellable:"); -final _objc_msgSend_117qins = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, bool)>(); -late final _sel_isPausable = objc.registerName("isPausable"); -late final _sel_setPausable_ = objc.registerName("setPausable:"); -late final _sel_isCancelled = objc.registerName("isCancelled"); -late final _sel_isPaused = objc.registerName("isPaused"); -late final _sel_cancellationHandler = objc.registerName("cancellationHandler"); -final _objc_msgSend_2osec1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setCancellationHandler_ = - objc.registerName("setCancellationHandler:"); -void _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSUInteger_bool_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function(int, ffi.Pointer))( - arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSUInteger_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSUInteger_bool_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSUInteger_bool_listenerTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function(int, ffi.Pointer))( - arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)> - _ObjCBlock_ffiVoid_NSUInteger_bool_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSUInteger_bool_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_ffiVoid_NSUInteger_bool { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.UnsignedLong, ffi.Pointer)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Void Function(ffi.UnsignedLong, ffi.Pointer)> fromFunctionPointer( - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock)> - fromFunction(void Function(int, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Void Function(ffi.UnsignedLong, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSUInteger_bool_closureCallable, - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1)), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc - .ObjCBlock)> - listener(void Function(int, ffi.Pointer) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSUInteger_bool_listenerCallable.nativeFunction - .cast(), - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1)); - final wrapper = _SwiftLibrary_wrapListenerBlock_l9klhe(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.UnsignedLong, ffi.Pointer)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_ffiVoid_NSUInteger_bool_CallExtension on objc - .ObjCBlock)> { - void call(int arg0, ffi.Pointer arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()(ref.pointer, arg0, arg1); -} - -final _objc_msgSend_4daxhl = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_pausingHandler = objc.registerName("pausingHandler"); -late final _sel_setPausingHandler_ = objc.registerName("setPausingHandler:"); -late final _sel_resumingHandler = objc.registerName("resumingHandler"); -late final _sel_setResumingHandler_ = objc.registerName("setResumingHandler:"); -late final _sel_setUserInfoObject_forKey_ = - objc.registerName("setUserInfoObject:forKey:"); -late final _sel_isIndeterminate = objc.registerName("isIndeterminate"); -late final _sel_fractionCompleted = objc.registerName("fractionCompleted"); -final _objc_msgSend_10noklm = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isFinished = objc.registerName("isFinished"); -late final _sel_cancel = objc.registerName("cancel"); -late final _sel_pause = objc.registerName("pause"); -late final _sel_resume = objc.registerName("resume"); -late final _sel_userInfo = objc.registerName("userInfo"); -late final _sel_kind = objc.registerName("kind"); -late final _sel_setKind_ = objc.registerName("setKind:"); -late final _sel_estimatedTimeRemaining = - objc.registerName("estimatedTimeRemaining"); -late final _sel_setEstimatedTimeRemaining_ = - objc.registerName("setEstimatedTimeRemaining:"); -late final _sel_throughput = objc.registerName("throughput"); -late final _sel_setThroughput_ = objc.registerName("setThroughput:"); -late final _sel_fileOperationKind = objc.registerName("fileOperationKind"); -late final _sel_setFileOperationKind_ = - objc.registerName("setFileOperationKind:"); -late final _sel_fileURL = objc.registerName("fileURL"); -late final _sel_setFileURL_ = objc.registerName("setFileURL:"); -late final _sel_fileTotalCount = objc.registerName("fileTotalCount"); -late final _sel_setFileTotalCount_ = objc.registerName("setFileTotalCount:"); -late final _sel_fileCompletedCount = objc.registerName("fileCompletedCount"); -late final _sel_setFileCompletedCount_ = - objc.registerName("setFileCompletedCount:"); -late final _sel_publish = objc.registerName("publish"); -late final _sel_unpublish = objc.registerName("unpublish"); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer - Function(ffi.Pointer))(arg0); -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock Function(NSProgress)>`. -abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - objc.ObjCBlock Function(NSProgress)> castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock Function(NSProgress)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(NSProgress)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock Function(NSProgress)>( - objc.newPointerBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - objc.ObjCBlock Function(NSProgress)> fromFunction( - objc.ObjCBlock Function(NSProgress) fn) => - objc.ObjCBlock Function(NSProgress)>( - objc.newClosureBlock( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, - (ffi.Pointer arg0) => - fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) - .ref - .retainAndAutorelease()), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock Function(NSProgress)>`. -extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension - on objc - .ObjCBlock Function(NSProgress)> { - objc.ObjCBlock call(NSProgress arg0) => - ObjCBlock_ffiVoid.castFromPointer( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer), - retain: true, - release: true); -} - -late final _sel_addSubscriberForFileURL_withPublishingHandler_ = - objc.registerName("addSubscriberForFileURL:withPublishingHandler:"); -final _objc_msgSend_1kkhn3j = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_removeSubscriber_ = objc.registerName("removeSubscriber:"); -late final _sel_isOld = objc.registerName("isOld"); - -/// NSProgress -class NSProgress extends objc.NSObject { - NSProgress._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSProgress] that points to the same underlying object as [other]. - NSProgress.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSProgress] that wraps the given raw object pointer. - NSProgress.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSProgress]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSProgress); - } - - /// currentProgress - static NSProgress? currentProgress() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_currentProgress); - return _ret.address == 0 - ? null - : NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// progressWithTotalUnitCount: - static NSProgress progressWithTotalUnitCount_(int unitCount) { - final _ret = _objc_msgSend_n9eq1n( - _class_NSProgress, _sel_progressWithTotalUnitCount_, unitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// discreteProgressWithTotalUnitCount: - static NSProgress discreteProgressWithTotalUnitCount_(int unitCount) { - final _ret = _objc_msgSend_n9eq1n( - _class_NSProgress, _sel_discreteProgressWithTotalUnitCount_, unitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// progressWithTotalUnitCount:parent:pendingUnitCount: - static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( - int unitCount, NSProgress parent, int portionOfParentTotalUnitCount) { - final _ret = _objc_msgSend_105mybv( - _class_NSProgress, - _sel_progressWithTotalUnitCount_parent_pendingUnitCount_, - unitCount, - parent.ref.pointer, - portionOfParentTotalUnitCount); - return NSProgress.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithParent:userInfo: - NSProgress initWithParent_userInfo_( - NSProgress? parentProgressOrNil, objc.ObjCObjectBase? userInfoOrNil) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithParent_userInfo_, - parentProgressOrNil?.ref.pointer ?? ffi.nullptr, - userInfoOrNil?.ref.pointer ?? ffi.nullptr); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// becomeCurrentWithPendingUnitCount: - void becomeCurrentWithPendingUnitCount_(int unitCount) { - _objc_msgSend_rrr3q( - this.ref.pointer, _sel_becomeCurrentWithPendingUnitCount_, unitCount); - } - - /// performAsCurrentWithPendingUnitCount:usingBlock: - void performAsCurrentWithPendingUnitCount_usingBlock_( - int unitCount, objc.ObjCBlock work) { - _objc_msgSend_19q84do( - this.ref.pointer, - _sel_performAsCurrentWithPendingUnitCount_usingBlock_, - unitCount, - work.ref.pointer); - } - - /// resignCurrent - void resignCurrent() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_resignCurrent); - } - - /// addChild:withPendingUnitCount: - void addChild_withPendingUnitCount_(NSProgress child, int inUnitCount) { - _objc_msgSend_2citz1(this.ref.pointer, _sel_addChild_withPendingUnitCount_, - child.ref.pointer, inUnitCount); - } - - /// totalUnitCount - int get totalUnitCount { - return _objc_msgSend_1voti03(this.ref.pointer, _sel_totalUnitCount); - } - - /// setTotalUnitCount: - set totalUnitCount(int value) { - return _objc_msgSend_rrr3q( - this.ref.pointer, _sel_setTotalUnitCount_, value); - } - - /// completedUnitCount - int get completedUnitCount { - return _objc_msgSend_1voti03(this.ref.pointer, _sel_completedUnitCount); - } - - /// setCompletedUnitCount: - set completedUnitCount(int value) { - return _objc_msgSend_rrr3q( - this.ref.pointer, _sel_setCompletedUnitCount_, value); - } - - /// localizedDescription - objc.NSString get localizedDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_localizedDescription); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setLocalizedDescription: - set localizedDescription(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setLocalizedDescription_, value.ref.pointer); - } - - /// localizedAdditionalDescription - objc.NSString get localizedAdditionalDescription { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_localizedAdditionalDescription); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setLocalizedAdditionalDescription: - set localizedAdditionalDescription(objc.NSString value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setLocalizedAdditionalDescription_, value.ref.pointer); - } - - /// isCancellable - bool get cancellable { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancellable); - } - - /// setCancellable: - set cancellable(bool value) { - return _objc_msgSend_117qins(this.ref.pointer, _sel_setCancellable_, value); - } - - /// isPausable - bool get pausable { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPausable); - } - - /// setPausable: - set pausable(bool value) { - return _objc_msgSend_117qins(this.ref.pointer, _sel_setPausable_, value); - } - - /// isCancelled - bool get cancelled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancelled); - } - - /// isPaused - bool get paused { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPaused); - } - - /// cancellationHandler - objc.ObjCBlock? get cancellationHandler { - final _ret = - _objc_msgSend_2osec1(this.ref.pointer, _sel_cancellationHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); - } - - /// setCancellationHandler: - set cancellationHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setCancellationHandler_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// pausingHandler - objc.ObjCBlock? get pausingHandler { - final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_pausingHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); - } - - /// setPausingHandler: - set pausingHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setPausingHandler_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// resumingHandler - objc.ObjCBlock? get resumingHandler { - final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_resumingHandler); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); - } - - /// setResumingHandler: - set resumingHandler(objc.ObjCBlock? value) { - return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setResumingHandler_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// setUserInfoObject:forKey: - void setUserInfoObject_forKey_( - objc.ObjCObjectBase? objectOrNil, objc.NSString key) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_setUserInfoObject_forKey_, - objectOrNil?.ref.pointer ?? ffi.nullptr, key.ref.pointer); - } - - /// isIndeterminate - bool get indeterminate { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isIndeterminate); - } - - /// fractionCompleted - double get fractionCompleted { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_fractionCompleted); - } - - /// isFinished - bool get finished { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isFinished); - } - - /// cancel - void cancel() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); - } - - /// pause - void pause() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_pause); - } - - /// resume - void resume() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_resume); - } - - /// userInfo - objc.ObjCObjectBase get userInfo { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// kind - objc.NSString get kind { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_kind); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setKind: - set kind(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setKind_, value.ref.pointer); - } - - /// estimatedTimeRemaining - objc.NSNumber? get estimatedTimeRemaining { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_estimatedTimeRemaining); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setEstimatedTimeRemaining: - set estimatedTimeRemaining(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setEstimatedTimeRemaining_, value?.ref.pointer ?? ffi.nullptr); - } - - /// throughput - objc.NSNumber? get throughput { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_throughput); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setThroughput: - set throughput(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setThroughput_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// fileOperationKind - objc.NSString get fileOperationKind { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileOperationKind); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileOperationKind: - set fileOperationKind(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setFileOperationKind_, value.ref.pointer); - } - - /// fileURL - objc.NSURL? get fileURL { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileURL); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileURL: - set fileURL(objc.NSURL? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setFileURL_, value?.ref.pointer ?? ffi.nullptr); - } - - /// fileTotalCount - objc.NSNumber? get fileTotalCount { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileTotalCount); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileTotalCount: - set fileTotalCount(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setFileTotalCount_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// fileCompletedCount - objc.NSNumber? get fileCompletedCount { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileCompletedCount); - return _ret.address == 0 - ? null - : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); - } - - /// setFileCompletedCount: - set fileCompletedCount(objc.NSNumber? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setFileCompletedCount_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// publish - void publish() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_publish); - } - - /// unpublish - void unpublish() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_unpublish); - } - - /// addSubscriberForFileURL:withPublishingHandler: - static objc.ObjCObjectBase addSubscriberForFileURL_withPublishingHandler_( - objc.NSURL url, - objc.ObjCBlock Function(NSProgress)> - publishingHandler) { - final _ret = _objc_msgSend_1kkhn3j( - _class_NSProgress, - _sel_addSubscriberForFileURL_withPublishingHandler_, - url.ref.pointer, - publishingHandler.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// removeSubscriber: - static void removeSubscriber_(objc.ObjCObjectBase subscriber) { - _objc_msgSend_ukcdfq( - _class_NSProgress, _sel_removeSubscriber_, subscriber.ref.pointer); - } - - /// isOld - bool get old { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isOld); - } - - /// init - NSProgress init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSProgress new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_new); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSProgress allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSProgress, _sel_allocWithZone_, zone); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSProgress alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_alloc); - return NSProgress.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSProgress, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSProgress, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSProgress, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSProgress, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSProgress, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSProgress, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSProgress, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSProgress, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSProgress, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -enum NSDecodingFailurePolicy { - NSDecodingFailurePolicyRaiseException(0), - NSDecodingFailurePolicySetErrorAndReturn(1); - - final int value; - const NSDecodingFailurePolicy(this.value); - - static NSDecodingFailurePolicy fromValue(int value) => switch (value) { - 0 => NSDecodingFailurePolicyRaiseException, - 1 => NSDecodingFailurePolicySetErrorAndReturn, - _ => throw ArgumentError( - "Unknown value for NSDecodingFailurePolicy: $value"), - }; -} - -enum NSLocaleLanguageDirection { - NSLocaleLanguageDirectionUnknown(0), - NSLocaleLanguageDirectionLeftToRight(1), - NSLocaleLanguageDirectionRightToLeft(2), - NSLocaleLanguageDirectionTopToBottom(3), - NSLocaleLanguageDirectionBottomToTop(4); - - final int value; - const NSLocaleLanguageDirection(this.value); - - static NSLocaleLanguageDirection fromValue(int value) => switch (value) { - 0 => NSLocaleLanguageDirectionUnknown, - 1 => NSLocaleLanguageDirectionLeftToRight, - 2 => NSLocaleLanguageDirectionRightToLeft, - 3 => NSLocaleLanguageDirectionTopToBottom, - 4 => NSLocaleLanguageDirectionBottomToTop, - _ => throw ArgumentError( - "Unknown value for NSLocaleLanguageDirection: $value"), - }; -} - -enum NSSearchPathDirectory { - NSApplicationDirectory(1), - NSDemoApplicationDirectory(2), - NSDeveloperApplicationDirectory(3), - NSAdminApplicationDirectory(4), - NSLibraryDirectory(5), - NSDeveloperDirectory(6), - NSUserDirectory(7), - NSDocumentationDirectory(8), - NSDocumentDirectory(9), - NSCoreServiceDirectory(10), - NSAutosavedInformationDirectory(11), - NSDesktopDirectory(12), - NSCachesDirectory(13), - NSApplicationSupportDirectory(14), - NSDownloadsDirectory(15), - NSInputMethodsDirectory(16), - NSMoviesDirectory(17), - NSMusicDirectory(18), - NSPicturesDirectory(19), - NSPrinterDescriptionDirectory(20), - NSSharedPublicDirectory(21), - NSPreferencePanesDirectory(22), - NSApplicationScriptsDirectory(23), - NSItemReplacementDirectory(99), - NSAllApplicationsDirectory(100), - NSAllLibrariesDirectory(101), - NSTrashDirectory(102); - - final int value; - const NSSearchPathDirectory(this.value); - - static NSSearchPathDirectory fromValue(int value) => switch (value) { - 1 => NSApplicationDirectory, - 2 => NSDemoApplicationDirectory, - 3 => NSDeveloperApplicationDirectory, - 4 => NSAdminApplicationDirectory, - 5 => NSLibraryDirectory, - 6 => NSDeveloperDirectory, - 7 => NSUserDirectory, - 8 => NSDocumentationDirectory, - 9 => NSDocumentDirectory, - 10 => NSCoreServiceDirectory, - 11 => NSAutosavedInformationDirectory, - 12 => NSDesktopDirectory, - 13 => NSCachesDirectory, - 14 => NSApplicationSupportDirectory, - 15 => NSDownloadsDirectory, - 16 => NSInputMethodsDirectory, - 17 => NSMoviesDirectory, - 18 => NSMusicDirectory, - 19 => NSPicturesDirectory, - 20 => NSPrinterDescriptionDirectory, - 21 => NSSharedPublicDirectory, - 22 => NSPreferencePanesDirectory, - 23 => NSApplicationScriptsDirectory, - 99 => NSItemReplacementDirectory, - 100 => NSAllApplicationsDirectory, - 101 => NSAllLibrariesDirectory, - 102 => NSTrashDirectory, - _ => throw ArgumentError( - "Unknown value for NSSearchPathDirectory: $value"), - }; -} - -enum NSSearchPathDomainMask { - NSUserDomainMask(1), - NSLocalDomainMask(2), - NSNetworkDomainMask(4), - NSSystemDomainMask(8), - NSAllDomainsMask(65535); - - final int value; - const NSSearchPathDomainMask(this.value); - - static NSSearchPathDomainMask fromValue(int value) => switch (value) { - 1 => NSUserDomainMask, - 2 => NSLocalDomainMask, - 4 => NSNetworkDomainMask, - 8 => NSSystemDomainMask, - 65535 => NSAllDomainsMask, - _ => throw ArgumentError( - "Unknown value for NSSearchPathDomainMask: $value"), - }; -} - -enum NSVolumeEnumerationOptions { - NSVolumeEnumerationSkipHiddenVolumes(2), - NSVolumeEnumerationProduceFileReferenceURLs(4); - - final int value; - const NSVolumeEnumerationOptions(this.value); - - static NSVolumeEnumerationOptions fromValue(int value) => switch (value) { - 2 => NSVolumeEnumerationSkipHiddenVolumes, - 4 => NSVolumeEnumerationProduceFileReferenceURLs, - _ => throw ArgumentError( - "Unknown value for NSVolumeEnumerationOptions: $value"), - }; -} - -enum NSDirectoryEnumerationOptions { - NSDirectoryEnumerationSkipsSubdirectoryDescendants(1), - NSDirectoryEnumerationSkipsPackageDescendants(2), - NSDirectoryEnumerationSkipsHiddenFiles(4), - NSDirectoryEnumerationIncludesDirectoriesPostOrder(8), - NSDirectoryEnumerationProducesRelativePathURLs(16); - - final int value; - const NSDirectoryEnumerationOptions(this.value); - - static NSDirectoryEnumerationOptions fromValue(int value) => switch (value) { - 1 => NSDirectoryEnumerationSkipsSubdirectoryDescendants, - 2 => NSDirectoryEnumerationSkipsPackageDescendants, - 4 => NSDirectoryEnumerationSkipsHiddenFiles, - 8 => NSDirectoryEnumerationIncludesDirectoriesPostOrder, - 16 => NSDirectoryEnumerationProducesRelativePathURLs, - _ => throw ArgumentError( - "Unknown value for NSDirectoryEnumerationOptions: $value"), - }; -} - -enum NSFileManagerItemReplacementOptions { - NSFileManagerItemReplacementUsingNewMetadataOnly(1), - NSFileManagerItemReplacementWithoutDeletingBackupItem(2); - - final int value; - const NSFileManagerItemReplacementOptions(this.value); - - static NSFileManagerItemReplacementOptions fromValue(int value) => - switch (value) { - 1 => NSFileManagerItemReplacementUsingNewMetadataOnly, - 2 => NSFileManagerItemReplacementWithoutDeletingBackupItem, - _ => throw ArgumentError( - "Unknown value for NSFileManagerItemReplacementOptions: $value"), - }; -} - -enum NSURLRelationship { - NSURLRelationshipContains(0), - NSURLRelationshipSame(1), - NSURLRelationshipOther(2); - - final int value; - const NSURLRelationship(this.value); - - static NSURLRelationship fromValue(int value) => switch (value) { - 0 => NSURLRelationshipContains, - 1 => NSURLRelationshipSame, - 2 => NSURLRelationshipOther, - _ => throw ArgumentError("Unknown value for NSURLRelationship: $value"), - }; -} - -enum NSFileManagerUnmountOptions { - NSFileManagerUnmountAllPartitionsAndEjectDisk(1), - NSFileManagerUnmountWithoutUI(2); - - final int value; - const NSFileManagerUnmountOptions(this.value); - - static NSFileManagerUnmountOptions fromValue(int value) => switch (value) { - 1 => NSFileManagerUnmountAllPartitionsAndEjectDisk, - 2 => NSFileManagerUnmountWithoutUI, - _ => throw ArgumentError( - "Unknown value for NSFileManagerUnmountOptions: $value"), - }; -} - -late final _class_NSFileManager = objc.getClass("NSFileManager"); -late final _sel_defaultManager = objc.registerName("defaultManager"); -late final _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_ = objc - .registerName("mountedVolumeURLsIncludingResourceValuesForKeys:options:"); -final _objc_msgSend_gyiq9w = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSError_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSError_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSError_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_closureCallable, - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.NSError.castFromPointer(arg0, - retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(objc.NSError?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSError_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : objc.NSError.castFromPointer(arg0, - retain: false, release: true))); - final wrapper = _SwiftLibrary_wrapListenerBlock_ukcdfq(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSError? arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_unmountVolumeAtURL_options_completionHandler_ = - objc.registerName("unmountVolumeAtURL:options:completionHandler:"); -final _objc_msgSend_yuugcv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_ = - objc.registerName( - "contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:"); -final _objc_msgSend_1rn5oli = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); -late final _sel_URLsForDirectory_inDomains_ = - objc.registerName("URLsForDirectory:inDomains:"); -final _objc_msgSend_1llbjq7 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int)>(); -late final _sel_URLForDirectory_inDomain_appropriateForURL_create_error_ = objc - .registerName("URLForDirectory:inDomain:appropriateForURL:create:error:"); -final _objc_msgSend_46p27t = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Bool, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - bool, - ffi.Pointer>)>(); -late final _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_ = - objc.registerName("getRelationship:ofDirectoryAtURL:toItemAtURL:error:"); -final _objc_msgSend_17s8ocw = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_ = objc - .registerName("getRelationship:ofDirectory:inDomain:toItemAtURL:error:"); -final _objc_msgSend_9p3pl8 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_ = - objc.registerName( - "createDirectoryAtURL:withIntermediateDirectories:attributes:error:"); -final _objc_msgSend_16o5u5c = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_createSymbolicLinkAtURL_withDestinationURL_error_ = - objc.registerName("createSymbolicLinkAtURL:withDestinationURL:error:"); -final _objc_msgSend_6toz8x = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_delegate = objc.registerName("delegate"); -late final _sel_setDelegate_ = objc.registerName("setDelegate:"); -late final _sel_setAttributes_ofItemAtPath_error_ = - objc.registerName("setAttributes:ofItemAtPath:error:"); -late final _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_ = - objc.registerName( - "createDirectoryAtPath:withIntermediateDirectories:attributes:error:"); -late final _sel_contentsOfDirectoryAtPath_error_ = - objc.registerName("contentsOfDirectoryAtPath:error:"); -final _objc_msgSend_1y425zh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_subpathsOfDirectoryAtPath_error_ = - objc.registerName("subpathsOfDirectoryAtPath:error:"); -late final _sel_attributesOfItemAtPath_error_ = - objc.registerName("attributesOfItemAtPath:error:"); -late final _sel_attributesOfFileSystemForPath_error_ = - objc.registerName("attributesOfFileSystemForPath:error:"); -late final _sel_createSymbolicLinkAtPath_withDestinationPath_error_ = - objc.registerName("createSymbolicLinkAtPath:withDestinationPath:error:"); -late final _sel_destinationOfSymbolicLinkAtPath_error_ = - objc.registerName("destinationOfSymbolicLinkAtPath:error:"); -late final _sel_copyItemAtPath_toPath_error_ = - objc.registerName("copyItemAtPath:toPath:error:"); -late final _sel_moveItemAtPath_toPath_error_ = - objc.registerName("moveItemAtPath:toPath:error:"); -late final _sel_linkItemAtPath_toPath_error_ = - objc.registerName("linkItemAtPath:toPath:error:"); -late final _sel_removeItemAtPath_error_ = - objc.registerName("removeItemAtPath:error:"); -final _objc_msgSend_p02k6o = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_copyItemAtURL_toURL_error_ = - objc.registerName("copyItemAtURL:toURL:error:"); -late final _sel_moveItemAtURL_toURL_error_ = - objc.registerName("moveItemAtURL:toURL:error:"); -late final _sel_linkItemAtURL_toURL_error_ = - objc.registerName("linkItemAtURL:toURL:error:"); -late final _sel_removeItemAtURL_error_ = - objc.registerName("removeItemAtURL:error:"); -late final _sel_trashItemAtURL_resultingItemURL_error_ = - objc.registerName("trashItemAtURL:resultingItemURL:error:"); -final _objc_msgSend_to8xlo = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); -late final _sel_fileAttributesAtPath_traverseLink_ = - objc.registerName("fileAttributesAtPath:traverseLink:"); -final _objc_msgSend_qqbb5y = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_changeFileAttributes_atPath_ = - objc.registerName("changeFileAttributes:atPath:"); -final _objc_msgSend_1ywe6ev = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_directoryContentsAtPath_ = - objc.registerName("directoryContentsAtPath:"); -late final _sel_fileSystemAttributesAtPath_ = - objc.registerName("fileSystemAttributesAtPath:"); -late final _sel_pathContentOfSymbolicLinkAtPath_ = - objc.registerName("pathContentOfSymbolicLinkAtPath:"); -late final _sel_createSymbolicLinkAtPath_pathContent_ = - objc.registerName("createSymbolicLinkAtPath:pathContent:"); -late final _sel_createDirectoryAtPath_attributes_ = - objc.registerName("createDirectoryAtPath:attributes:"); -late final _sel_linkPath_toPath_handler_ = - objc.registerName("linkPath:toPath:handler:"); -final _objc_msgSend_hukaf0 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_copyPath_toPath_handler_ = - objc.registerName("copyPath:toPath:handler:"); -late final _sel_movePath_toPath_handler_ = - objc.registerName("movePath:toPath:handler:"); -late final _sel_removeFileAtPath_handler_ = - objc.registerName("removeFileAtPath:handler:"); -late final _sel_currentDirectoryPath = - objc.registerName("currentDirectoryPath"); -late final _sel_changeCurrentDirectoryPath_ = - objc.registerName("changeCurrentDirectoryPath:"); -late final _sel_fileExistsAtPath_ = objc.registerName("fileExistsAtPath:"); -late final _sel_fileExistsAtPath_isDirectory_ = - objc.registerName("fileExistsAtPath:isDirectory:"); -final _objc_msgSend_rtz5p9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_isReadableFileAtPath_ = - objc.registerName("isReadableFileAtPath:"); -late final _sel_isWritableFileAtPath_ = - objc.registerName("isWritableFileAtPath:"); -late final _sel_isExecutableFileAtPath_ = - objc.registerName("isExecutableFileAtPath:"); -late final _sel_isDeletableFileAtPath_ = - objc.registerName("isDeletableFileAtPath:"); -late final _sel_contentsEqualAtPath_andPath_ = - objc.registerName("contentsEqualAtPath:andPath:"); -late final _sel_displayNameAtPath_ = objc.registerName("displayNameAtPath:"); -late final _sel_componentsToDisplayForPath_ = - objc.registerName("componentsToDisplayForPath:"); -late final _sel_enumeratorAtPath_ = objc.registerName("enumeratorAtPath:"); -bool _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_NSURL_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_NSURL_NSError_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_NSURL_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_NSURL_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_NSURL_NSError_closureTrampoline, false) - .cast(); - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_bool_NSURL_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_bool_NSURL_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - bool Function(objc.NSURL, objc.NSError) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_bool_NSURL_NSError_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn( - objc.NSURL - .castFromPointer(arg0, retain: true, release: true), - objc.NSError.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_bool_NSURL_NSError_CallExtension - on objc.ObjCBlock { - bool call(objc.NSURL arg0, objc.NSError arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()( - ref.pointer, arg0.ref.pointer, arg1.ref.pointer); -} - -late final _sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_ = - objc.registerName( - "enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:"); -final _objc_msgSend_40k0lk = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_subpathsAtPath_ = objc.registerName("subpathsAtPath:"); -late final _sel_contentsAtPath_ = objc.registerName("contentsAtPath:"); -late final _sel_createFileAtPath_contents_attributes_ = - objc.registerName("createFileAtPath:contents:attributes:"); -late final _sel_fileSystemRepresentationWithPath_ = - objc.registerName("fileSystemRepresentationWithPath:"); -final _objc_msgSend_t1v5su = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_stringWithFileSystemRepresentation_length_ = - objc.registerName("stringWithFileSystemRepresentation:length:"); -final _objc_msgSend_1t5rcq1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); -late final _sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_ = - objc.registerName( - "replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:"); -final _objc_msgSend_1cu34v2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer>, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>, - ffi.Pointer>)>(); -late final _sel_setUbiquitous_itemAtURL_destinationURL_error_ = - objc.registerName("setUbiquitous:itemAtURL:destinationURL:error:"); -final _objc_msgSend_191cxmu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); -late final _sel_isUbiquitousItemAtURL_ = - objc.registerName("isUbiquitousItemAtURL:"); -late final _sel_startDownloadingUbiquitousItemAtURL_error_ = - objc.registerName("startDownloadingUbiquitousItemAtURL:error:"); -late final _sel_evictUbiquitousItemAtURL_error_ = - objc.registerName("evictUbiquitousItemAtURL:error:"); -late final _sel_URLForUbiquityContainerIdentifier_ = - objc.registerName("URLForUbiquityContainerIdentifier:"); -late final _sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_ = objc - .registerName("URLForPublishingUbiquitousItemAtURL:expirationDate:error:"); -final _objc_msgSend_1dca44n = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); -late final _sel_ubiquityIdentityToken = - objc.registerName("ubiquityIdentityToken"); -void _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_NSDictionary_NSError_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSDictionary_NSError_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSDictionary_NSError_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSDictionary_NSError_listenerCallable = ffi - .NativeCallable< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSDictionary_NSError_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSDictionary_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock(_ObjCBlock_ffiVoid_NSDictionary_NSError_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(objc.NSDictionary?, objc.NSError?) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSDictionary_NSError_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : objc.NSDictionary.castFromPointer(arg0, - retain: true, release: true), - arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock - listener(void Function(objc.NSDictionary?, objc.NSError?) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSDictionary_NSError_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn( - arg0.address == 0 - ? null - : objc.NSDictionary.castFromPointer(arg0, - retain: false, release: true), - arg1.address == 0 - ? null - : objc.NSError.castFromPointer(arg1, - retain: false, release: true))); - final wrapper = _SwiftLibrary_wrapListenerBlock_1tjlcwl(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock( - wrapper, - retain: false, - release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSDictionary_NSError_CallExtension - on objc.ObjCBlock { - void call(objc.NSDictionary? arg0, objc.NSError? arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_getFileProviderServicesForItemAtURL_completionHandler_ = - objc.registerName("getFileProviderServicesForItemAtURL:completionHandler:"); -ffi.Pointer - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock? Function(objc.NSError, objc.NSString)>`. -abstract final class ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer? Function(objc.NSError, objc.NSString)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer? Function(objc.NSError, - objc.NSString)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock? Function(objc.NSError, objc.NSString)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock? Function(objc.NSError, objc.NSString)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock? Function(objc.NSError, objc.NSString)> - fromFunction( - objc.ObjCObjectBase? Function(objc.NSError, objc.NSString) fn) => - objc.ObjCBlock? Function(objc.NSError, objc.NSString)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_closureCallable, - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn(objc.NSError.castFromPointer(arg0, retain: true, release: true), objc.NSString.castFromPointer(arg1, retain: true, release: true)) - ?.ref - .retainAndAutorelease() ?? - ffi.nullptr), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock? Function(objc.NSError, objc.NSString)>`. -extension ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey_CallExtension - on objc.ObjCBlock< - ffi.Pointer? Function(objc.NSError, objc.NSString)> { - objc.ObjCObjectBase? call(objc.NSError arg0, objc.NSString arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>() - (ref.pointer, arg0.ref.pointer, arg1.ref.pointer) - .address == - 0 - ? null - : objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast Function(ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0.ref.pointer, arg1.ref.pointer), - retain: true, - release: true); -} - -final _objc_msgSend_cmbt6k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_containerURLForSecurityApplicationGroupIdentifier_ = - objc.registerName("containerURLForSecurityApplicationGroupIdentifier:"); -late final _sel_homeDirectoryForCurrentUser = - objc.registerName("homeDirectoryForCurrentUser"); -late final _sel_temporaryDirectory = objc.registerName("temporaryDirectory"); -late final _sel_homeDirectoryForUser_ = - objc.registerName("homeDirectoryForUser:"); - -/// NSFileManager -class NSFileManager extends objc.NSObject { - NSFileManager._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSFileManager] that points to the same underlying object as [other]. - NSFileManager.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSFileManager] that wraps the given raw object pointer. - NSFileManager.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSFileManager]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSFileManager); - } - - /// defaultManager - static NSFileManager getDefaultManager() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSFileManager, _sel_defaultManager); - return NSFileManager.castFromPointer(_ret, retain: true, release: true); - } - - /// mountedVolumeURLsIncludingResourceValuesForKeys:options: - objc.NSArray? mountedVolumeURLsIncludingResourceValuesForKeys_options_( - objc.NSArray? propertyKeys, NSVolumeEnumerationOptions options) { - final _ret = _objc_msgSend_gyiq9w( - this.ref.pointer, - _sel_mountedVolumeURLsIncludingResourceValuesForKeys_options_, - propertyKeys?.ref.pointer ?? ffi.nullptr, - options.value); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// unmountVolumeAtURL:options:completionHandler: - void unmountVolumeAtURL_options_completionHandler_( - objc.NSURL url, - NSFileManagerUnmountOptions mask, - objc.ObjCBlock completionHandler) { - _objc_msgSend_yuugcv( - this.ref.pointer, - _sel_unmountVolumeAtURL_options_completionHandler_, - url.ref.pointer, - mask.value, - completionHandler.ref.pointer); - } - - /// contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error: - objc.NSArray? - contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_( - objc.NSURL url, - objc.NSArray? keys, - NSDirectoryEnumerationOptions mask, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1rn5oli( - this.ref.pointer, - _sel_contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error_, - url.ref.pointer, - keys?.ref.pointer ?? ffi.nullptr, - mask.value, - error); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// URLsForDirectory:inDomains: - objc.NSArray URLsForDirectory_inDomains_( - NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask) { - final _ret = _objc_msgSend_1llbjq7(this.ref.pointer, - _sel_URLsForDirectory_inDomains_, directory.value, domainMask.value); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// URLForDirectory:inDomain:appropriateForURL:create:error: - objc.NSURL? URLForDirectory_inDomain_appropriateForURL_create_error_( - NSSearchPathDirectory directory, - NSSearchPathDomainMask domain, - objc.NSURL? url, - bool shouldCreate, - ffi.Pointer> error) { - final _ret = _objc_msgSend_46p27t( - this.ref.pointer, - _sel_URLForDirectory_inDomain_appropriateForURL_create_error_, - directory.value, - domain.value, - url?.ref.pointer ?? ffi.nullptr, - shouldCreate, - error); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// getRelationship:ofDirectoryAtURL:toItemAtURL:error: - bool getRelationship_ofDirectoryAtURL_toItemAtURL_error_( - ffi.Pointer outRelationship, - objc.NSURL directoryURL, - objc.NSURL otherURL, - ffi.Pointer> error) { - return _objc_msgSend_17s8ocw( - this.ref.pointer, - _sel_getRelationship_ofDirectoryAtURL_toItemAtURL_error_, - outRelationship, - directoryURL.ref.pointer, - otherURL.ref.pointer, - error); - } - - /// getRelationship:ofDirectory:inDomain:toItemAtURL:error: - bool getRelationship_ofDirectory_inDomain_toItemAtURL_error_( - ffi.Pointer outRelationship, - NSSearchPathDirectory directory, - NSSearchPathDomainMask domainMask, - objc.NSURL url, - ffi.Pointer> error) { - return _objc_msgSend_9p3pl8( - this.ref.pointer, - _sel_getRelationship_ofDirectory_inDomain_toItemAtURL_error_, - outRelationship, - directory.value, - domainMask.value, - url.ref.pointer, - error); - } - - /// createDirectoryAtURL:withIntermediateDirectories:attributes:error: - bool createDirectoryAtURL_withIntermediateDirectories_attributes_error_( - objc.NSURL url, - bool createIntermediates, - objc.NSDictionary? attributes, - ffi.Pointer> error) { - return _objc_msgSend_16o5u5c( - this.ref.pointer, - _sel_createDirectoryAtURL_withIntermediateDirectories_attributes_error_, - url.ref.pointer, - createIntermediates, - attributes?.ref.pointer ?? ffi.nullptr, - error); - } - - /// createSymbolicLinkAtURL:withDestinationURL:error: - bool createSymbolicLinkAtURL_withDestinationURL_error_(objc.NSURL url, - objc.NSURL destURL, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_createSymbolicLinkAtURL_withDestinationURL_error_, - url.ref.pointer, - destURL.ref.pointer, - error); - } - - /// delegate - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setDelegate: - set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); - } - - /// setAttributes:ofItemAtPath:error: - bool setAttributes_ofItemAtPath_error_(objc.NSDictionary attributes, - objc.NSString path, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_setAttributes_ofItemAtPath_error_, - attributes.ref.pointer, - path.ref.pointer, - error); - } - - /// createDirectoryAtPath:withIntermediateDirectories:attributes:error: - bool createDirectoryAtPath_withIntermediateDirectories_attributes_error_( - objc.NSString path, - bool createIntermediates, - objc.NSDictionary? attributes, - ffi.Pointer> error) { - return _objc_msgSend_16o5u5c( - this.ref.pointer, - _sel_createDirectoryAtPath_withIntermediateDirectories_attributes_error_, - path.ref.pointer, - createIntermediates, - attributes?.ref.pointer ?? ffi.nullptr, - error); - } - - /// contentsOfDirectoryAtPath:error: - objc.NSArray? contentsOfDirectoryAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_contentsOfDirectoryAtPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// subpathsOfDirectoryAtPath:error: - objc.NSArray? subpathsOfDirectoryAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_subpathsOfDirectoryAtPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// attributesOfItemAtPath:error: - objc.NSDictionary? attributesOfItemAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_attributesOfItemAtPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// attributesOfFileSystemForPath:error: - objc.NSDictionary? attributesOfFileSystemForPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_attributesOfFileSystemForPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// createSymbolicLinkAtPath:withDestinationPath:error: - bool createSymbolicLinkAtPath_withDestinationPath_error_(objc.NSString path, - objc.NSString destPath, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_createSymbolicLinkAtPath_withDestinationPath_error_, - path.ref.pointer, - destPath.ref.pointer, - error); - } - - /// destinationOfSymbolicLinkAtPath:error: - objc.NSString? destinationOfSymbolicLinkAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - final _ret = _objc_msgSend_1y425zh(this.ref.pointer, - _sel_destinationOfSymbolicLinkAtPath_error_, path.ref.pointer, error); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// copyItemAtPath:toPath:error: - bool copyItemAtPath_toPath_error_(objc.NSString srcPath, - objc.NSString dstPath, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_copyItemAtPath_toPath_error_, - srcPath.ref.pointer, - dstPath.ref.pointer, - error); - } - - /// moveItemAtPath:toPath:error: - bool moveItemAtPath_toPath_error_(objc.NSString srcPath, - objc.NSString dstPath, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_moveItemAtPath_toPath_error_, - srcPath.ref.pointer, - dstPath.ref.pointer, - error); - } - - /// linkItemAtPath:toPath:error: - bool linkItemAtPath_toPath_error_(objc.NSString srcPath, - objc.NSString dstPath, ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_linkItemAtPath_toPath_error_, - srcPath.ref.pointer, - dstPath.ref.pointer, - error); - } - - /// removeItemAtPath:error: - bool removeItemAtPath_error_( - objc.NSString path, ffi.Pointer> error) { - return _objc_msgSend_p02k6o(this.ref.pointer, _sel_removeItemAtPath_error_, - path.ref.pointer, error); - } - - /// copyItemAtURL:toURL:error: - bool copyItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, - ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_copyItemAtURL_toURL_error_, - srcURL.ref.pointer, - dstURL.ref.pointer, - error); - } - - /// moveItemAtURL:toURL:error: - bool moveItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, - ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_moveItemAtURL_toURL_error_, - srcURL.ref.pointer, - dstURL.ref.pointer, - error); - } - - /// linkItemAtURL:toURL:error: - bool linkItemAtURL_toURL_error_(objc.NSURL srcURL, objc.NSURL dstURL, - ffi.Pointer> error) { - return _objc_msgSend_6toz8x( - this.ref.pointer, - _sel_linkItemAtURL_toURL_error_, - srcURL.ref.pointer, - dstURL.ref.pointer, - error); - } - - /// removeItemAtURL:error: - bool removeItemAtURL_error_( - objc.NSURL URL, ffi.Pointer> error) { - return _objc_msgSend_p02k6o( - this.ref.pointer, _sel_removeItemAtURL_error_, URL.ref.pointer, error); - } - - /// trashItemAtURL:resultingItemURL:error: - bool trashItemAtURL_resultingItemURL_error_( - objc.NSURL url, - ffi.Pointer> outResultingURL, - ffi.Pointer> error) { - return _objc_msgSend_to8xlo( - this.ref.pointer, - _sel_trashItemAtURL_resultingItemURL_error_, - url.ref.pointer, - outResultingURL, - error); - } - - /// fileAttributesAtPath:traverseLink: - objc.NSDictionary? fileAttributesAtPath_traverseLink_( - objc.NSString path, bool yorn) { - final _ret = _objc_msgSend_qqbb5y(this.ref.pointer, - _sel_fileAttributesAtPath_traverseLink_, path.ref.pointer, yorn); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// changeFileAttributes:atPath: - bool changeFileAttributes_atPath_( - objc.NSDictionary attributes, objc.NSString path) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_changeFileAttributes_atPath_, - attributes.ref.pointer, - path.ref.pointer); - } - - /// directoryContentsAtPath: - objc.NSArray? directoryContentsAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_directoryContentsAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// fileSystemAttributesAtPath: - objc.NSDictionary? fileSystemAttributesAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_fileSystemAttributesAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// pathContentOfSymbolicLinkAtPath: - objc.NSString? pathContentOfSymbolicLinkAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_pathContentOfSymbolicLinkAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// createSymbolicLinkAtPath:pathContent: - bool createSymbolicLinkAtPath_pathContent_( - objc.NSString path, objc.NSString otherpath) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_createSymbolicLinkAtPath_pathContent_, - path.ref.pointer, - otherpath.ref.pointer); - } - - /// createDirectoryAtPath:attributes: - bool createDirectoryAtPath_attributes_( - objc.NSString path, objc.NSDictionary attributes) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_createDirectoryAtPath_attributes_, - path.ref.pointer, - attributes.ref.pointer); - } - - /// linkPath:toPath:handler: - bool linkPath_toPath_handler_( - objc.NSString src, objc.NSString dest, objc.ObjCObjectBase? handler) { - return _objc_msgSend_hukaf0(this.ref.pointer, _sel_linkPath_toPath_handler_, - src.ref.pointer, dest.ref.pointer, handler?.ref.pointer ?? ffi.nullptr); - } - - /// copyPath:toPath:handler: - bool copyPath_toPath_handler_( - objc.NSString src, objc.NSString dest, objc.ObjCObjectBase? handler) { - return _objc_msgSend_hukaf0(this.ref.pointer, _sel_copyPath_toPath_handler_, - src.ref.pointer, dest.ref.pointer, handler?.ref.pointer ?? ffi.nullptr); - } - - /// movePath:toPath:handler: - bool movePath_toPath_handler_( - objc.NSString src, objc.NSString dest, objc.ObjCObjectBase? handler) { - return _objc_msgSend_hukaf0(this.ref.pointer, _sel_movePath_toPath_handler_, - src.ref.pointer, dest.ref.pointer, handler?.ref.pointer ?? ffi.nullptr); - } - - /// removeFileAtPath:handler: - bool removeFileAtPath_handler_( - objc.NSString path, objc.ObjCObjectBase? handler) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_removeFileAtPath_handler_, - path.ref.pointer, - handler?.ref.pointer ?? ffi.nullptr); - } - - /// currentDirectoryPath - objc.NSString get currentDirectoryPath { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_currentDirectoryPath); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// changeCurrentDirectoryPath: - bool changeCurrentDirectoryPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_changeCurrentDirectoryPath_, path.ref.pointer); - } - - /// fileExistsAtPath: - bool fileExistsAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_fileExistsAtPath_, path.ref.pointer); - } - - /// fileExistsAtPath:isDirectory: - bool fileExistsAtPath_isDirectory_( - objc.NSString path, ffi.Pointer isDirectory) { - return _objc_msgSend_rtz5p9(this.ref.pointer, - _sel_fileExistsAtPath_isDirectory_, path.ref.pointer, isDirectory); - } - - /// isReadableFileAtPath: - bool isReadableFileAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isReadableFileAtPath_, path.ref.pointer); - } - - /// isWritableFileAtPath: - bool isWritableFileAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isWritableFileAtPath_, path.ref.pointer); - } - - /// isExecutableFileAtPath: - bool isExecutableFileAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isExecutableFileAtPath_, path.ref.pointer); - } - - /// isDeletableFileAtPath: - bool isDeletableFileAtPath_(objc.NSString path) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isDeletableFileAtPath_, path.ref.pointer); - } - - /// contentsEqualAtPath:andPath: - bool contentsEqualAtPath_andPath_(objc.NSString path1, objc.NSString path2) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_contentsEqualAtPath_andPath_, - path1.ref.pointer, - path2.ref.pointer); - } - - /// displayNameAtPath: - objc.NSString displayNameAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_displayNameAtPath_, path.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// componentsToDisplayForPath: - objc.NSArray? componentsToDisplayForPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_componentsToDisplayForPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// enumeratorAtPath: - objc.ObjCObjectBase? enumeratorAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_enumeratorAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: - objc.ObjCObjectBase? - enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_( - objc.NSURL url, - objc.NSArray? keys, - NSDirectoryEnumerationOptions mask, - objc.ObjCBlock? - handler) { - final _ret = _objc_msgSend_40k0lk( - this.ref.pointer, - _sel_enumeratorAtURL_includingPropertiesForKeys_options_errorHandler_, - url.ref.pointer, - keys?.ref.pointer ?? ffi.nullptr, - mask.value, - handler?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// subpathsAtPath: - objc.NSArray? subpathsAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_subpathsAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// contentsAtPath: - objc.NSData? contentsAtPath_(objc.NSString path) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_contentsAtPath_, path.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// createFileAtPath:contents:attributes: - bool createFileAtPath_contents_attributes_( - objc.NSString path, objc.NSData? data, objc.NSDictionary? attr) { - return _objc_msgSend_hukaf0( - this.ref.pointer, - _sel_createFileAtPath_contents_attributes_, - path.ref.pointer, - data?.ref.pointer ?? ffi.nullptr, - attr?.ref.pointer ?? ffi.nullptr); - } - - /// fileSystemRepresentationWithPath: - ffi.Pointer fileSystemRepresentationWithPath_(objc.NSString path) { - return _objc_msgSend_t1v5su(this.ref.pointer, - _sel_fileSystemRepresentationWithPath_, path.ref.pointer); - } - - /// stringWithFileSystemRepresentation:length: - objc.NSString stringWithFileSystemRepresentation_length_( - ffi.Pointer str, int len) { - final _ret = _objc_msgSend_1t5rcq1(this.ref.pointer, - _sel_stringWithFileSystemRepresentation_length_, str, len); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: - bool - replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_( - objc.NSURL originalItemURL, - objc.NSURL newItemURL, - objc.NSString? backupItemName, - NSFileManagerItemReplacementOptions options, - ffi.Pointer> resultingURL, - ffi.Pointer> error) { - return _objc_msgSend_1cu34v2( - this.ref.pointer, - _sel_replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error_, - originalItemURL.ref.pointer, - newItemURL.ref.pointer, - backupItemName?.ref.pointer ?? ffi.nullptr, - options.value, - resultingURL, - error); - } - - /// setUbiquitous:itemAtURL:destinationURL:error: - bool setUbiquitous_itemAtURL_destinationURL_error_( - bool flag, - objc.NSURL url, - objc.NSURL destinationURL, - ffi.Pointer> error) { - return _objc_msgSend_191cxmu( - this.ref.pointer, - _sel_setUbiquitous_itemAtURL_destinationURL_error_, - flag, - url.ref.pointer, - destinationURL.ref.pointer, - error); - } - - /// isUbiquitousItemAtURL: - bool isUbiquitousItemAtURL_(objc.NSURL url) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isUbiquitousItemAtURL_, url.ref.pointer); - } - - /// startDownloadingUbiquitousItemAtURL:error: - bool startDownloadingUbiquitousItemAtURL_error_( - objc.NSURL url, ffi.Pointer> error) { - return _objc_msgSend_p02k6o( - this.ref.pointer, - _sel_startDownloadingUbiquitousItemAtURL_error_, - url.ref.pointer, - error); - } - - /// evictUbiquitousItemAtURL:error: - bool evictUbiquitousItemAtURL_error_( - objc.NSURL url, ffi.Pointer> error) { - return _objc_msgSend_p02k6o(this.ref.pointer, - _sel_evictUbiquitousItemAtURL_error_, url.ref.pointer, error); - } - - /// URLForUbiquityContainerIdentifier: - objc.NSURL? URLForUbiquityContainerIdentifier_( - objc.NSString? containerIdentifier) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, - _sel_URLForUbiquityContainerIdentifier_, - containerIdentifier?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// URLForPublishingUbiquitousItemAtURL:expirationDate:error: - objc.NSURL? URLForPublishingUbiquitousItemAtURL_expirationDate_error_( - objc.NSURL url, - ffi.Pointer> outDate, - ffi.Pointer> error) { - final _ret = _objc_msgSend_1dca44n( - this.ref.pointer, - _sel_URLForPublishingUbiquitousItemAtURL_expirationDate_error_, - url.ref.pointer, - outDate, - error); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// ubiquityIdentityToken - objc.ObjCObjectBase? get ubiquityIdentityToken { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_ubiquityIdentityToken); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// getFileProviderServicesForItemAtURL:completionHandler: - void getFileProviderServicesForItemAtURL_completionHandler_( - objc.NSURL url, - objc.ObjCBlock - completionHandler) { - _objc_msgSend_cmbt6k( - this.ref.pointer, - _sel_getFileProviderServicesForItemAtURL_completionHandler_, - url.ref.pointer, - completionHandler.ref.pointer); - } - - /// containerURLForSecurityApplicationGroupIdentifier: - objc.NSURL? containerURLForSecurityApplicationGroupIdentifier_( - objc.NSString groupIdentifier) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, - _sel_containerURLForSecurityApplicationGroupIdentifier_, - groupIdentifier.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// homeDirectoryForCurrentUser - objc.NSURL get homeDirectoryForCurrentUser { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_homeDirectoryForCurrentUser); - return objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// temporaryDirectory - objc.NSURL get temporaryDirectory { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_temporaryDirectory); - return objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// homeDirectoryForUser: - objc.NSURL? homeDirectoryForUser_(objc.NSString userName) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_homeDirectoryForUser_, userName.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSFileManager init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSFileManager.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSFileManager new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSFileManager, _sel_new); - return NSFileManager.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSFileManager allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSFileManager, _sel_allocWithZone_, zone); - return NSFileManager.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSFileManager alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSFileManager, _sel_alloc); - return NSFileManager.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSFileManager, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSFileManager, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSFileManager, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSFileManager, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSFileManager, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSFileManager, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSFileManager, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSFileManager, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSFileManager, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -enum NSPropertyListFormat { - NSPropertyListOpenStepFormat(1), - NSPropertyListXMLFormat_v1_0(100), - NSPropertyListBinaryFormat_v1_0(200); - - final int value; - const NSPropertyListFormat(this.value); - - static NSPropertyListFormat fromValue(int value) => switch (value) { - 1 => NSPropertyListOpenStepFormat, - 100 => NSPropertyListXMLFormat_v1_0, - 200 => NSPropertyListBinaryFormat_v1_0, - _ => - throw ArgumentError("Unknown value for NSPropertyListFormat: $value"), - }; -} - -final class NSEdgeInsets extends ffi.Struct { - @ffi.Double() - external double top; - - @ffi.Double() - external double left; - - @ffi.Double() - external double bottom; - - @ffi.Double() - external double right; -} - -late final _class_NSKeyedArchiver = objc.getClass("NSKeyedArchiver"); -late final _sel_initRequiringSecureCoding_ = - objc.registerName("initRequiringSecureCoding:"); -final _objc_msgSend_1upz917 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, bool)>(); -late final _sel_archivedDataWithRootObject_requiringSecureCoding_error_ = objc - .registerName("archivedDataWithRootObject:requiringSecureCoding:error:"); -final _objc_msgSend_6e0rjm = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer>)>(); -late final _sel_initForWritingWithMutableData_ = - objc.registerName("initForWritingWithMutableData:"); -late final _sel_archivedDataWithRootObject_ = - objc.registerName("archivedDataWithRootObject:"); -late final _sel_archiveRootObject_toFile_ = - objc.registerName("archiveRootObject:toFile:"); -late final _sel_outputFormat = objc.registerName("outputFormat"); -final _objc_msgSend_3y21y6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setOutputFormat_ = objc.registerName("setOutputFormat:"); -final _objc_msgSend_2xh8ml = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_encodedData = objc.registerName("encodedData"); -late final _sel_finishEncoding = objc.registerName("finishEncoding"); -late final _sel_setClassName_forClass_ = - objc.registerName("setClassName:forClass:"); -late final _sel_classNameForClass_ = objc.registerName("classNameForClass:"); -late final _sel_encodeObject_forKey_ = - objc.registerName("encodeObject:forKey:"); -late final _sel_encodeConditionalObject_forKey_ = - objc.registerName("encodeConditionalObject:forKey:"); -late final _sel_encodeBool_forKey_ = objc.registerName("encodeBool:forKey:"); -final _objc_msgSend_1ej8563 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer)>(); -late final _sel_encodeInt_forKey_ = objc.registerName("encodeInt:forKey:"); -final _objc_msgSend_1ijvd5c = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_encodeInt32_forKey_ = objc.registerName("encodeInt32:forKey:"); -final _objc_msgSend_vnkyom = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_encodeInt64_forKey_ = objc.registerName("encodeInt64:forKey:"); -final _objc_msgSend_1ruyfmt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_encodeFloat_forKey_ = objc.registerName("encodeFloat:forKey:"); -final _objc_msgSend_6n5aez = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Float, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); -late final _sel_encodeDouble_forKey_ = - objc.registerName("encodeDouble:forKey:"); -final _objc_msgSend_13ndgwe = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); -late final _sel_encodeBytes_length_forKey_ = - objc.registerName("encodeBytes:length:forKey:"); -final _objc_msgSend_6els9k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_requiresSecureCoding = - objc.registerName("requiresSecureCoding"); -late final _sel_setRequiresSecureCoding_ = - objc.registerName("setRequiresSecureCoding:"); - -/// NSKeyedArchiver -class NSKeyedArchiver extends objc.NSCoder { - NSKeyedArchiver._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSKeyedArchiver] that points to the same underlying object as [other]. - NSKeyedArchiver.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSKeyedArchiver] that wraps the given raw object pointer. - NSKeyedArchiver.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSKeyedArchiver]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSKeyedArchiver); - } - - /// initRequiringSecureCoding: - NSKeyedArchiver initRequiringSecureCoding_(bool requiresSecureCoding) { - final _ret = _objc_msgSend_1upz917(this.ref.retainAndReturnPointer(), - _sel_initRequiringSecureCoding_, requiresSecureCoding); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// archivedDataWithRootObject:requiringSecureCoding:error: - static objc.NSData? archivedDataWithRootObject_requiringSecureCoding_error_( - objc.ObjCObjectBase object, - bool requiresSecureCoding, - ffi.Pointer> error) { - final _ret = _objc_msgSend_6e0rjm( - _class_NSKeyedArchiver, - _sel_archivedDataWithRootObject_requiringSecureCoding_error_, - object.ref.pointer, - requiresSecureCoding, - error); - return _ret.address == 0 - ? null - : objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSKeyedArchiver init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// initForWritingWithMutableData: - NSKeyedArchiver initForWritingWithMutableData_(objc.NSMutableData data) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initForWritingWithMutableData_, data.ref.pointer); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// archivedDataWithRootObject: - static objc.NSData archivedDataWithRootObject_( - objc.ObjCObjectBase rootObject) { - final _ret = _objc_msgSend_juohf7(_class_NSKeyedArchiver, - _sel_archivedDataWithRootObject_, rootObject.ref.pointer); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// archiveRootObject:toFile: - static bool archiveRootObject_toFile_( - objc.ObjCObjectBase rootObject, objc.NSString path) { - return _objc_msgSend_1ywe6ev( - _class_NSKeyedArchiver, - _sel_archiveRootObject_toFile_, - rootObject.ref.pointer, - path.ref.pointer); - } - - /// delegate - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setDelegate: - set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); - } - - /// outputFormat - NSPropertyListFormat get outputFormat { - final _ret = _objc_msgSend_3y21y6(this.ref.pointer, _sel_outputFormat); - return NSPropertyListFormat.fromValue(_ret); - } - - /// setOutputFormat: - set outputFormat(NSPropertyListFormat value) { - return _objc_msgSend_2xh8ml( - this.ref.pointer, _sel_setOutputFormat_, value.value); - } - - /// encodedData - objc.NSData get encodedData { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_encodedData); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// finishEncoding - void finishEncoding() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_finishEncoding); - } - - /// setClassName:forClass: - void setClassName_forClass_( - objc.NSString? codedName, objc.ObjCObjectBase cls) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_setClassName_forClass_, - codedName?.ref.pointer ?? ffi.nullptr, cls.ref.pointer); - } - - /// classNameForClass: - objc.NSString? classNameForClass_(objc.ObjCObjectBase cls) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_classNameForClass_, cls.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// encodeObject:forKey: - void encodeObject_forKey_(objc.ObjCObjectBase? object, objc.NSString key) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_encodeObject_forKey_, - object?.ref.pointer ?? ffi.nullptr, key.ref.pointer); - } - - /// encodeConditionalObject:forKey: - void encodeConditionalObject_forKey_( - objc.ObjCObjectBase? object, objc.NSString key) { - _objc_msgSend_1tjlcwl( - this.ref.pointer, - _sel_encodeConditionalObject_forKey_, - object?.ref.pointer ?? ffi.nullptr, - key.ref.pointer); - } - - /// encodeBool:forKey: - void encodeBool_forKey_(bool value, objc.NSString key) { - _objc_msgSend_1ej8563( - this.ref.pointer, _sel_encodeBool_forKey_, value, key.ref.pointer); - } - - /// encodeInt:forKey: - void encodeInt_forKey_(int value, objc.NSString key) { - _objc_msgSend_1ijvd5c( - this.ref.pointer, _sel_encodeInt_forKey_, value, key.ref.pointer); - } - - /// encodeInt32:forKey: - void encodeInt32_forKey_(int value, objc.NSString key) { - _objc_msgSend_vnkyom( - this.ref.pointer, _sel_encodeInt32_forKey_, value, key.ref.pointer); - } - - /// encodeInt64:forKey: - void encodeInt64_forKey_(int value, objc.NSString key) { - _objc_msgSend_1ruyfmt( - this.ref.pointer, _sel_encodeInt64_forKey_, value, key.ref.pointer); - } - - /// encodeFloat:forKey: - void encodeFloat_forKey_(double value, objc.NSString key) { - _objc_msgSend_6n5aez( - this.ref.pointer, _sel_encodeFloat_forKey_, value, key.ref.pointer); - } - - /// encodeDouble:forKey: - void encodeDouble_forKey_(double value, objc.NSString key) { - _objc_msgSend_13ndgwe( - this.ref.pointer, _sel_encodeDouble_forKey_, value, key.ref.pointer); - } - - /// encodeBytes:length:forKey: - void encodeBytes_length_forKey_( - ffi.Pointer bytes, int length, objc.NSString key) { - _objc_msgSend_6els9k(this.ref.pointer, _sel_encodeBytes_length_forKey_, - bytes, length, key.ref.pointer); - } - - /// requiresSecureCoding - bool get requiresSecureCoding { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_requiresSecureCoding); - } - - /// setRequiresSecureCoding: - set requiresSecureCoding(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setRequiresSecureCoding_, value); - } - - /// new - static NSKeyedArchiver new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSKeyedArchiver, _sel_new); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSKeyedArchiver allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSKeyedArchiver, _sel_allocWithZone_, zone); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSKeyedArchiver alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSKeyedArchiver, _sel_alloc); - return NSKeyedArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSKeyedArchiver, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSKeyedArchiver, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSKeyedArchiver, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSKeyedArchiver, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSKeyedArchiver, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSKeyedArchiver, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSKeyedArchiver, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSKeyedArchiver, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSKeyedArchiver, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSOrthography = objc.getClass("NSOrthography"); -late final _sel_dominantScript = objc.registerName("dominantScript"); -late final _sel_languageMap = objc.registerName("languageMap"); -late final _sel_initWithDominantScript_languageMap_ = - objc.registerName("initWithDominantScript:languageMap:"); -late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); -instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable = - ffi.Pointer.fromFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline) - .cast(); -instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as instancetype Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable = - ffi.Pointer.fromFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. -abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, - objc.NSCoder)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> - fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => - objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)>( - objc.newPointerBlock( - _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)> fromFunction( - Dartinstancetype? Function(ffi.Pointer, objc.NSCoder) fn) => - objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>( - objc.newClosureBlock( - _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, objc.NSCoder.castFromPointer(arg1, retain: true, release: true)) - ?.ref - .retainAndReturnPointer() ?? - ffi.nullptr), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. -extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension - on objc.ObjCBlock< - objc.Retained?> Function( - ffi.Pointer, objc.NSCoder)> { - Dartinstancetype? call(ffi.Pointer arg0, objc.NSCoder arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>() - (ref.pointer, arg0, arg1.ref.pointer) - .address == - 0 - ? null - : objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast block, ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer), - retain: false, - release: true); -} - -late final _sel_languagesForScript_ = objc.registerName("languagesForScript:"); -late final _sel_dominantLanguageForScript_ = - objc.registerName("dominantLanguageForScript:"); -late final _sel_dominantLanguage = objc.registerName("dominantLanguage"); -late final _sel_allScripts = objc.registerName("allScripts"); -late final _sel_allLanguages = objc.registerName("allLanguages"); -late final _sel_defaultOrthographyForLanguage_ = - objc.registerName("defaultOrthographyForLanguage:"); -late final _sel_orthographyWithDominantScript_languageMap_ = - objc.registerName("orthographyWithDominantScript:languageMap:"); -late final _sel_self = objc.registerName("self"); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) - .cast(); -ffi.Pointer - _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as ffi.Pointer Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) - .cast(); - -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock Function(ffi.Pointer)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock Function(ffi.Pointer)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock Function(ffi.Pointer)>( - objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock Function(ffi.Pointer)> - fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, - (ffi.Pointer arg0) => - fn(arg0).ref.retainAndAutorelease()), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension on objc - .ObjCBlock Function(ffi.Pointer)> { - objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0), - retain: true, - release: true); -} - -late final _sel_retain = objc.registerName("retain"); -late final _sel_autorelease = objc.registerName("autorelease"); -late final _sel_supportsSecureCoding = - objc.registerName("supportsSecureCoding"); -bool _ObjCBlock_bool_ffiVoid_fnPtrTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_bool_ffiVoid_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_ffiVoid_closureTrampoline( - ffi.Pointer block, ffi.Pointer arg0) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_bool_ffiVoid_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_bool_ffiVoid_closureTrampoline, false) - .cast(); - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_bool_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock)>(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunction( - bool Function(ffi.Pointer) fn) => - objc.ObjCBlock)>( - objc.newClosureBlock(_ObjCBlock_bool_ffiVoid_closureCallable, - (ffi.Pointer arg0) => fn(arg0)), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_bool_ffiVoid_CallExtension - on objc.ObjCBlock)> { - bool call(ffi.Pointer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0); -} - -late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer, ffi.Pointer))(arg0, arg1); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock, objc.NSCoder)>`. -abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock, objc.NSCoder)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, - objc.NSCoder)>(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSCoder)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock, objc.NSCoder)>( - objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock, objc.NSCoder)> - fromFunction(void Function(ffi.Pointer, objc.NSCoder) fn) => - objc.ObjCBlock, objc.NSCoder)>( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn( - arg0, - objc.NSCoder.castFromPointer(arg1, - retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock, objc.NSCoder)> - listener(void Function(ffi.Pointer, objc.NSCoder) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable.nativeFunction - .cast(), - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0, - objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); - final wrapper = _SwiftLibrary_wrapListenerBlock_sjfpmz(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock< - ffi.Void Function(ffi.Pointer, objc.NSCoder)>(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock, objc.NSCoder)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension - on objc.ObjCBlock, objc.NSCoder)> { - void call(ffi.Pointer arg0, objc.NSCoder arg1) => ref - .pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - ref.pointer, arg0, arg1.ref.pointer); -} - -/// NSOrthography -class NSOrthography extends objc.NSObject { - NSOrthography._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSOrthography] that points to the same underlying object as [other]. - NSOrthography.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSOrthography] that wraps the given raw object pointer. - NSOrthography.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSOrthography]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSOrthography); - } - - /// dominantScript - objc.NSString get dominantScript { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_dominantScript); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// languageMap - objc.NSDictionary get languageMap { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_languageMap); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithDominantScript:languageMap: - NSOrthography initWithDominantScript_languageMap_( - objc.NSString script, objc.NSDictionary map) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithDominantScript_languageMap_, - script.ref.pointer, - map.ref.pointer); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCoder: - NSOrthography? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// languagesForScript: - objc.NSArray? languagesForScript_(objc.NSString script) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_languagesForScript_, script.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// dominantLanguageForScript: - objc.NSString? dominantLanguageForScript_(objc.NSString script) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_dominantLanguageForScript_, script.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// dominantLanguage - objc.NSString get dominantLanguage { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_dominantLanguage); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// allScripts - objc.NSArray get allScripts { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allScripts); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// allLanguages - objc.NSArray get allLanguages { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allLanguages); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// defaultOrthographyForLanguage: - static NSOrthography defaultOrthographyForLanguage_(objc.NSString language) { - final _ret = _objc_msgSend_juohf7(_class_NSOrthography, - _sel_defaultOrthographyForLanguage_, language.ref.pointer); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// orthographyWithDominantScript:languageMap: - static NSOrthography orthographyWithDominantScript_languageMap_( - objc.NSString script, objc.NSDictionary map) { - final _ret = _objc_msgSend_iq11qg( - _class_NSOrthography, - _sel_orthographyWithDominantScript_languageMap_, - script.ref.pointer, - map.ref.pointer); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSOrthography init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSOrthography new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOrthography, _sel_new); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSOrthography allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSOrthography, _sel_allocWithZone_, zone); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSOrthography alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSOrthography, _sel_alloc); - return NSOrthography.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSOrthography, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSOrthography, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSOrthography, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSOrthography, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSOrthography, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSOrthography, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSOrthography, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSOrthography, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSOrthography, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// self - NSOrthography self() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_self); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSOrthography retain() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_retain); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSOrthography autorelease() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_autorelease); - return NSOrthography.castFromPointer(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_NSOrthography, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _class_NSPort = objc.getClass("NSPort"); -late final _sel_port = objc.registerName("port"); -late final _sel_invalidate = objc.registerName("invalidate"); -late final _sel_isValid = objc.registerName("isValid"); -late final _sel_scheduleInRunLoop_forMode_ = - objc.registerName("scheduleInRunLoop:forMode:"); -late final _sel_removeFromRunLoop_forMode_ = - objc.registerName("removeFromRunLoop:forMode:"); -late final _sel_reservedSpaceLength = objc.registerName("reservedSpaceLength"); -late final _sel_sendBeforeDate_components_from_reserved_ = - objc.registerName("sendBeforeDate:components:from:reserved:"); -final _objc_msgSend_1k87i90 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_sendBeforeDate_msgid_components_from_reserved_ = - objc.registerName("sendBeforeDate:msgid:components:from:reserved:"); -final _objc_msgSend_1sldtak = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _class_NSConnection = objc.getClass("NSConnection"); -late final _sel_statistics = objc.registerName("statistics"); -late final _sel_allConnections = objc.registerName("allConnections"); -late final _sel_defaultConnection = objc.registerName("defaultConnection"); -late final _sel_connectionWithRegisteredName_host_ = - objc.registerName("connectionWithRegisteredName:host:"); -late final _class_NSPortNameServer = objc.getClass("NSPortNameServer"); -late final _sel_systemDefaultPortNameServer = - objc.registerName("systemDefaultPortNameServer"); -late final _sel_portForName_ = objc.registerName("portForName:"); -late final _sel_portForName_host_ = objc.registerName("portForName:host:"); -late final _sel_registerPort_name_ = objc.registerName("registerPort:name:"); -late final _sel_removePortForName_ = objc.registerName("removePortForName:"); - -/// NSPortNameServer -class NSPortNameServer extends objc.NSObject { - NSPortNameServer._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSPortNameServer] that points to the same underlying object as [other]. - NSPortNameServer.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSPortNameServer] that wraps the given raw object pointer. - NSPortNameServer.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSPortNameServer]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSPortNameServer); - } - - /// systemDefaultPortNameServer - static NSPortNameServer systemDefaultPortNameServer() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPortNameServer, _sel_systemDefaultPortNameServer); - return NSPortNameServer.castFromPointer(_ret, retain: true, release: true); - } - - /// portForName: - NSPort? portForName_(objc.NSString name) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_portForName_, name.ref.pointer); - return _ret.address == 0 - ? null - : NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// portForName:host: - NSPort? portForName_host_(objc.NSString name, objc.NSString? host) { - final _ret = _objc_msgSend_iq11qg(this.ref.pointer, _sel_portForName_host_, - name.ref.pointer, host?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// registerPort:name: - bool registerPort_name_(NSPort port, objc.NSString name) { - return _objc_msgSend_1ywe6ev(this.ref.pointer, _sel_registerPort_name_, - port.ref.pointer, name.ref.pointer); - } - - /// removePortForName: - bool removePortForName_(objc.NSString name) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_removePortForName_, name.ref.pointer); - } - - /// init - NSPortNameServer init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSPortNameServer.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSPortNameServer new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPortNameServer, _sel_new); - return NSPortNameServer.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSPortNameServer allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSPortNameServer, _sel_allocWithZone_, zone); - return NSPortNameServer.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSPortNameServer alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPortNameServer, _sel_alloc); - return NSPortNameServer.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSPortNameServer, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSPortNameServer, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSPortNameServer, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSPortNameServer, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSPortNameServer, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSPortNameServer, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSPortNameServer, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPortNameServer, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPortNameServer, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _sel_connectionWithRegisteredName_host_usingNameServer_ = - objc.registerName("connectionWithRegisteredName:host:usingNameServer:"); -final _objc_msgSend_aud7dn = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _class_NSDistantObject = objc.getClass("NSDistantObject"); -late final _sel_proxyWithTarget_connection_ = - objc.registerName("proxyWithTarget:connection:"); -late final _sel_initWithTarget_connection_ = - objc.registerName("initWithTarget:connection:"); -late final _sel_proxyWithLocal_connection_ = - objc.registerName("proxyWithLocal:connection:"); -late final _sel_initWithLocal_connection_ = - objc.registerName("initWithLocal:connection:"); -late final _sel_setProtocolForProxy_ = - objc.registerName("setProtocolForProxy:"); -late final _sel_connectionForProxy = objc.registerName("connectionForProxy"); - -/// NSDistantObject -class NSDistantObject extends objc.NSProxy { - NSDistantObject._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSDistantObject] that points to the same underlying object as [other]. - NSDistantObject.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSDistantObject] that wraps the given raw object pointer. - NSDistantObject.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSDistantObject]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSDistantObject); - } - - /// proxyWithTarget:connection: - static objc.ObjCObjectBase? proxyWithTarget_connection_( - objc.ObjCObjectBase target, NSConnection connection) { - final _ret = _objc_msgSend_iq11qg( - _class_NSDistantObject, - _sel_proxyWithTarget_connection_, - target.ref.pointer, - connection.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithTarget:connection: - NSDistantObject? initWithTarget_connection_( - objc.ObjCObjectBase target, NSConnection connection) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithTarget_connection_, - target.ref.pointer, - connection.ref.pointer); - return _ret.address == 0 - ? null - : NSDistantObject.castFromPointer(_ret, retain: false, release: true); - } - - /// proxyWithLocal:connection: - static objc.ObjCObjectBase proxyWithLocal_connection_( - objc.ObjCObjectBase target, NSConnection connection) { - final _ret = _objc_msgSend_iq11qg( - _class_NSDistantObject, - _sel_proxyWithLocal_connection_, - target.ref.pointer, - connection.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithLocal:connection: - NSDistantObject initWithLocal_connection_( - objc.ObjCObjectBase target, NSConnection connection) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithLocal_connection_, - target.ref.pointer, - connection.ref.pointer); - return NSDistantObject.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCoder: - NSDistantObject? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSDistantObject.castFromPointer(_ret, retain: false, release: true); - } - - /// setProtocolForProxy: - void setProtocolForProxy_(objc.Protocol? proto) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setProtocolForProxy_, - proto?.ref.pointer ?? ffi.nullptr); - } - - /// connectionForProxy - NSConnection get connectionForProxy { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_connectionForProxy); - return NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// alloc - static objc.ObjCObjectBase alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSDistantObject, _sel_alloc); - return objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// self - NSDistantObject self() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_self); - return NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// retain - NSDistantObject retain() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_retain); - return NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// autorelease - NSDistantObject autorelease() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_autorelease); - return NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _sel_rootProxyForConnectionWithRegisteredName_host_ = - objc.registerName("rootProxyForConnectionWithRegisteredName:host:"); -late final _sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_ = - objc.registerName( - "rootProxyForConnectionWithRegisteredName:host:usingNameServer:"); -late final _sel_serviceConnectionWithName_rootObject_usingNameServer_ = - objc.registerName("serviceConnectionWithName:rootObject:usingNameServer:"); -late final _sel_serviceConnectionWithName_rootObject_ = - objc.registerName("serviceConnectionWithName:rootObject:"); -late final _sel_requestTimeout = objc.registerName("requestTimeout"); -late final _sel_setRequestTimeout_ = objc.registerName("setRequestTimeout:"); -final _objc_msgSend_suh039 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_replyTimeout = objc.registerName("replyTimeout"); -late final _sel_setReplyTimeout_ = objc.registerName("setReplyTimeout:"); -late final _sel_rootObject = objc.registerName("rootObject"); -late final _sel_setRootObject_ = objc.registerName("setRootObject:"); -late final _sel_independentConversationQueueing = - objc.registerName("independentConversationQueueing"); -late final _sel_setIndependentConversationQueueing_ = - objc.registerName("setIndependentConversationQueueing:"); -late final _sel_rootProxy = objc.registerName("rootProxy"); -late final _sel_addRequestMode_ = objc.registerName("addRequestMode:"); -late final _sel_removeRequestMode_ = objc.registerName("removeRequestMode:"); -late final _sel_requestModes = objc.registerName("requestModes"); -late final _sel_registerName_ = objc.registerName("registerName:"); -late final _sel_registerName_withNameServer_ = - objc.registerName("registerName:withNameServer:"); -late final _sel_connectionWithReceivePort_sendPort_ = - objc.registerName("connectionWithReceivePort:sendPort:"); -late final _sel_currentConversation = objc.registerName("currentConversation"); -late final _sel_initWithReceivePort_sendPort_ = - objc.registerName("initWithReceivePort:sendPort:"); -late final _sel_sendPort = objc.registerName("sendPort"); -late final _sel_receivePort = objc.registerName("receivePort"); -late final _sel_enableMultipleThreads = - objc.registerName("enableMultipleThreads"); -late final _sel_multipleThreadsEnabled = - objc.registerName("multipleThreadsEnabled"); -late final _sel_addRunLoop_ = objc.registerName("addRunLoop:"); -late final _sel_removeRunLoop_ = objc.registerName("removeRunLoop:"); -late final _sel_runInNewThread = objc.registerName("runInNewThread"); -late final _sel_remoteObjects = objc.registerName("remoteObjects"); -late final _sel_localObjects = objc.registerName("localObjects"); -late final _sel_dispatchWithComponents_ = - objc.registerName("dispatchWithComponents:"); - -/// NSConnection -class NSConnection extends objc.NSObject { - NSConnection._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSConnection] that points to the same underlying object as [other]. - NSConnection.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSConnection] that wraps the given raw object pointer. - NSConnection.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSConnection]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSConnection); - } - - /// statistics - objc.NSDictionary get statistics { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_statistics); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// allConnections - static objc.NSArray allConnections() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSConnection, _sel_allConnections); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// defaultConnection - static NSConnection defaultConnection() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSConnection, _sel_defaultConnection); - return NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// connectionWithRegisteredName:host: - static NSConnection? connectionWithRegisteredName_host_( - objc.NSString name, objc.NSString? hostName) { - final _ret = _objc_msgSend_iq11qg( - _class_NSConnection, - _sel_connectionWithRegisteredName_host_, - name.ref.pointer, - hostName?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// connectionWithRegisteredName:host:usingNameServer: - static NSConnection? connectionWithRegisteredName_host_usingNameServer_( - objc.NSString name, objc.NSString? hostName, NSPortNameServer server) { - final _ret = _objc_msgSend_aud7dn( - _class_NSConnection, - _sel_connectionWithRegisteredName_host_usingNameServer_, - name.ref.pointer, - hostName?.ref.pointer ?? ffi.nullptr, - server.ref.pointer); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// rootProxyForConnectionWithRegisteredName:host: - static NSDistantObject? rootProxyForConnectionWithRegisteredName_host_( - objc.NSString name, objc.NSString? hostName) { - final _ret = _objc_msgSend_iq11qg( - _class_NSConnection, - _sel_rootProxyForConnectionWithRegisteredName_host_, - name.ref.pointer, - hostName?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// rootProxyForConnectionWithRegisteredName:host:usingNameServer: - static NSDistantObject? - rootProxyForConnectionWithRegisteredName_host_usingNameServer_( - objc.NSString name, - objc.NSString? hostName, - NSPortNameServer server) { - final _ret = _objc_msgSend_aud7dn( - _class_NSConnection, - _sel_rootProxyForConnectionWithRegisteredName_host_usingNameServer_, - name.ref.pointer, - hostName?.ref.pointer ?? ffi.nullptr, - server.ref.pointer); - return _ret.address == 0 - ? null - : NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// serviceConnectionWithName:rootObject:usingNameServer: - static NSConnection? serviceConnectionWithName_rootObject_usingNameServer_( - objc.NSString name, objc.ObjCObjectBase root, NSPortNameServer server) { - final _ret = _objc_msgSend_aud7dn( - _class_NSConnection, - _sel_serviceConnectionWithName_rootObject_usingNameServer_, - name.ref.pointer, - root.ref.pointer, - server.ref.pointer); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// serviceConnectionWithName:rootObject: - static NSConnection? serviceConnectionWithName_rootObject_( - objc.NSString name, objc.ObjCObjectBase root) { - final _ret = _objc_msgSend_iq11qg( - _class_NSConnection, - _sel_serviceConnectionWithName_rootObject_, - name.ref.pointer, - root.ref.pointer); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// requestTimeout - double get requestTimeout { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_requestTimeout); - } - - /// setRequestTimeout: - set requestTimeout(double value) { - return _objc_msgSend_suh039( - this.ref.pointer, _sel_setRequestTimeout_, value); - } - - /// replyTimeout - double get replyTimeout { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_replyTimeout); - } - - /// setReplyTimeout: - set replyTimeout(double value) { - return _objc_msgSend_suh039(this.ref.pointer, _sel_setReplyTimeout_, value); - } - - /// rootObject - objc.ObjCObjectBase? get rootObject { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_rootObject); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setRootObject: - set rootObject(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setRootObject_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// delegate - objc.ObjCObjectBase? get delegate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setDelegate: - set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); - } - - /// independentConversationQueueing - bool get independentConversationQueueing { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_independentConversationQueueing); - } - - /// setIndependentConversationQueueing: - set independentConversationQueueing(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setIndependentConversationQueueing_, value); - } - - /// isValid - bool get valid { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isValid); - } - - /// rootProxy - NSDistantObject get rootProxy { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_rootProxy); - return NSDistantObject.castFromPointer(_ret, retain: true, release: true); - } - - /// invalidate - void invalidate() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_invalidate); - } - - /// addRequestMode: - void addRequestMode_(objc.NSString rmode) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_addRequestMode_, rmode.ref.pointer); - } - - /// removeRequestMode: - void removeRequestMode_(objc.NSString rmode) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_removeRequestMode_, rmode.ref.pointer); - } - - /// requestModes - objc.NSArray get requestModes { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_requestModes); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// registerName: - bool registerName_(objc.NSString? name) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_registerName_, name?.ref.pointer ?? ffi.nullptr); - } - - /// registerName:withNameServer: - bool registerName_withNameServer_( - objc.NSString? name, NSPortNameServer server) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_registerName_withNameServer_, - name?.ref.pointer ?? ffi.nullptr, - server.ref.pointer); - } - - /// connectionWithReceivePort:sendPort: - static NSConnection? connectionWithReceivePort_sendPort_( - NSPort? receivePort, NSPort? sendPort) { - final _ret = _objc_msgSend_iq11qg( - _class_NSConnection, - _sel_connectionWithReceivePort_sendPort_, - receivePort?.ref.pointer ?? ffi.nullptr, - sendPort?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// currentConversation - static objc.ObjCObjectBase? currentConversation() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSConnection, _sel_currentConversation); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithReceivePort:sendPort: - NSConnection? initWithReceivePort_sendPort_( - NSPort? receivePort, NSPort? sendPort) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithReceivePort_sendPort_, - receivePort?.ref.pointer ?? ffi.nullptr, - sendPort?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// sendPort - NSPort get sendPort { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_sendPort); - return NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// receivePort - NSPort get receivePort { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_receivePort); - return NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// enableMultipleThreads - void enableMultipleThreads() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_enableMultipleThreads); - } - - /// multipleThreadsEnabled - bool get multipleThreadsEnabled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_multipleThreadsEnabled); - } - - /// addRunLoop: - void addRunLoop_(objc.NSRunLoop runloop) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_addRunLoop_, runloop.ref.pointer); - } - - /// removeRunLoop: - void removeRunLoop_(objc.NSRunLoop runloop) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_removeRunLoop_, runloop.ref.pointer); - } - - /// runInNewThread - void runInNewThread() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_runInNewThread); - } - - /// remoteObjects - objc.NSArray get remoteObjects { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_remoteObjects); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// localObjects - objc.NSArray get localObjects { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_localObjects); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// dispatchWithComponents: - void dispatchWithComponents_(objc.NSArray components) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_dispatchWithComponents_, components.ref.pointer); - } - - /// init - NSConnection init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSConnection new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSConnection, _sel_new); - return NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSConnection allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSConnection, _sel_allocWithZone_, zone); - return NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSConnection alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSConnection, _sel_alloc); - return NSConnection.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSConnection, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSConnection, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSConnection, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSConnection, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSConnection, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSConnection, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSConnection, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSConnection, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSConnection, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _sel_addConnection_toRunLoop_forMode_ = - objc.registerName("addConnection:toRunLoop:forMode:"); -final _objc_msgSend_tenbla = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_removeConnection_fromRunLoop_forMode_ = - objc.registerName("removeConnection:fromRunLoop:forMode:"); - -/// NSPort -class NSPort extends objc.NSObject { - NSPort._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSPort] that points to the same underlying object as [other]. - NSPort.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSPort] that wraps the given raw object pointer. - NSPort.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSPort]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSPort); - } - - /// port - static NSPort port() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPort, _sel_port); - return NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// invalidate - void invalidate() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_invalidate); - } - - /// isValid - bool get valid { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isValid); - } - - /// setDelegate: - void setDelegate_(objc.ObjCObjectBase? anObject) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setDelegate_, - anObject?.ref.pointer ?? ffi.nullptr); - } - - /// delegate - objc.ObjCObjectBase? delegate() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// scheduleInRunLoop:forMode: - void scheduleInRunLoop_forMode_(objc.NSRunLoop runLoop, objc.NSString mode) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_scheduleInRunLoop_forMode_, - runLoop.ref.pointer, mode.ref.pointer); - } - - /// removeFromRunLoop:forMode: - void removeFromRunLoop_forMode_(objc.NSRunLoop runLoop, objc.NSString mode) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_removeFromRunLoop_forMode_, - runLoop.ref.pointer, mode.ref.pointer); - } - - /// reservedSpaceLength - int get reservedSpaceLength { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_reservedSpaceLength); - } - - /// sendBeforeDate:components:from:reserved: - bool sendBeforeDate_components_from_reserved_( - objc.NSDate limitDate, - objc.NSMutableArray? components, - NSPort? receivePort, - int headerSpaceReserved) { - return _objc_msgSend_1k87i90( - this.ref.pointer, - _sel_sendBeforeDate_components_from_reserved_, - limitDate.ref.pointer, - components?.ref.pointer ?? ffi.nullptr, - receivePort?.ref.pointer ?? ffi.nullptr, - headerSpaceReserved); - } - - /// sendBeforeDate:msgid:components:from:reserved: - bool sendBeforeDate_msgid_components_from_reserved_( - objc.NSDate limitDate, - int msgID, - objc.NSMutableArray? components, - NSPort? receivePort, - int headerSpaceReserved) { - return _objc_msgSend_1sldtak( - this.ref.pointer, - _sel_sendBeforeDate_msgid_components_from_reserved_, - limitDate.ref.pointer, - msgID, - components?.ref.pointer ?? ffi.nullptr, - receivePort?.ref.pointer ?? ffi.nullptr, - headerSpaceReserved); - } - - /// addConnection:toRunLoop:forMode: - void addConnection_toRunLoop_forMode_( - NSConnection conn, objc.NSRunLoop runLoop, objc.NSString mode) { - _objc_msgSend_tenbla( - this.ref.pointer, - _sel_addConnection_toRunLoop_forMode_, - conn.ref.pointer, - runLoop.ref.pointer, - mode.ref.pointer); - } - - /// removeConnection:fromRunLoop:forMode: - void removeConnection_fromRunLoop_forMode_( - NSConnection conn, objc.NSRunLoop runLoop, objc.NSString mode) { - _objc_msgSend_tenbla( - this.ref.pointer, - _sel_removeConnection_fromRunLoop_forMode_, - conn.ref.pointer, - runLoop.ref.pointer, - mode.ref.pointer); - } - - /// init - NSPort init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSPort.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSPort new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPort, _sel_new); - return NSPort.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSPort allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSPort, _sel_allocWithZone_, zone); - return NSPort.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSPort alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPort, _sel_alloc); - return NSPort.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSPort, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSPort, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSPort, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSPort, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSPort, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSPort, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSPort, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPort, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSPort, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSPort? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSPort.castFromPointer(_ret, retain: false, release: true); - } -} - -late final _class_NSThread = objc.getClass("NSThread"); -late final _sel_currentThread = objc.registerName("currentThread"); -late final _sel_detachNewThreadWithBlock_ = - objc.registerName("detachNewThreadWithBlock:"); -late final _sel_detachNewThreadSelector_toTarget_withObject_ = - objc.registerName("detachNewThreadSelector:toTarget:withObject:"); -final _objc_msgSend_wr178x = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_isMultiThreaded = objc.registerName("isMultiThreaded"); -late final _sel_threadDictionary = objc.registerName("threadDictionary"); -late final _sel_sleepUntilDate_ = objc.registerName("sleepUntilDate:"); -late final _sel_sleepForTimeInterval_ = - objc.registerName("sleepForTimeInterval:"); -late final _sel_exit = objc.registerName("exit"); -late final _sel_threadPriority = objc.registerName("threadPriority"); -late final _sel_setThreadPriority_ = objc.registerName("setThreadPriority:"); -late final _sel_qualityOfService = objc.registerName("qualityOfService"); -final _objc_msgSend_17dnyeh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_setQualityOfService_ = - objc.registerName("setQualityOfService:"); -final _objc_msgSend_1fcr8u4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_callStackReturnAddresses = - objc.registerName("callStackReturnAddresses"); -late final _sel_callStackSymbols = objc.registerName("callStackSymbols"); -late final _sel_name = objc.registerName("name"); -late final _sel_setName_ = objc.registerName("setName:"); -late final _sel_stackSize = objc.registerName("stackSize"); -late final _sel_setStackSize_ = objc.registerName("setStackSize:"); -final _objc_msgSend_1k4zaz5 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_isMainThread = objc.registerName("isMainThread"); -late final _sel_mainThread = objc.registerName("mainThread"); -late final _sel_initWithTarget_selector_object_ = - objc.registerName("initWithTarget:selector:object:"); -final _objc_msgSend_yoiems = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_initWithBlock_ = objc.registerName("initWithBlock:"); -bool _ObjCBlock_bool_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction)>()(arg0, arg1); -ffi.Pointer _ObjCBlock_bool_NSUInteger_bool_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_bool_NSUInteger_bool_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_NSUInteger_bool_closureTrampoline( - ffi.Pointer block, - int arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function(int, ffi.Pointer))( - arg0, arg1); -ffi.Pointer _ObjCBlock_bool_NSUInteger_bool_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer, - ffi.UnsignedLong, ffi.Pointer)>( - _ObjCBlock_bool_NSUInteger_bool_closureTrampoline, false) - .cast(); - -/// Construction methods for `objc.ObjCBlock)>`. -abstract final class ObjCBlock_bool_NSUInteger_bool { - /// Returns a block that wraps the given raw block pointer. - static objc - .ObjCBlock)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function(ffi.UnsignedLong, ffi.Pointer)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.UnsignedLong arg0, ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock)>( - objc.newPointerBlock(_ObjCBlock_bool_NSUInteger_bool_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc - .ObjCBlock)> - fromFunction(bool Function(int, ffi.Pointer) fn) => - objc.ObjCBlock< - ffi.Bool Function(ffi.UnsignedLong, ffi.Pointer)>( - objc.newClosureBlock( - _ObjCBlock_bool_NSUInteger_bool_closureCallable, - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1)), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock)>`. -extension ObjCBlock_bool_NSUInteger_bool_CallExtension on objc - .ObjCBlock)> { - bool call(int arg0, ffi.Pointer arg1) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer block, - ffi.UnsignedLong arg0, ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, int, - ffi.Pointer)>()(ref.pointer, arg0, arg1); -} - -final _objc_msgSend_3c0puu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isExecuting = objc.registerName("isExecuting"); -late final _sel_start = objc.registerName("start"); -late final _sel_main = objc.registerName("main"); - -/// NSThread -class NSThread extends objc.NSObject { - NSThread._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSThread] that points to the same underlying object as [other]. - NSThread.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSThread] that wraps the given raw object pointer. - NSThread.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSThread]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSThread); - } - - /// currentThread - static NSThread getCurrentThread() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_currentThread); - return NSThread.castFromPointer(_ret, retain: true, release: true); - } - - /// detachNewThreadWithBlock: - static void detachNewThreadWithBlock_( - objc.ObjCBlock block) { - _objc_msgSend_4daxhl( - _class_NSThread, _sel_detachNewThreadWithBlock_, block.ref.pointer); - } - - /// detachNewThreadSelector:toTarget:withObject: - static void detachNewThreadSelector_toTarget_withObject_( - ffi.Pointer selector, - objc.ObjCObjectBase target, - objc.ObjCObjectBase? argument) { - _objc_msgSend_wr178x( - _class_NSThread, - _sel_detachNewThreadSelector_toTarget_withObject_, - selector, - target.ref.pointer, - argument?.ref.pointer ?? ffi.nullptr); - } - - /// isMultiThreaded - static bool isMultiThreaded() { - return _objc_msgSend_olxnu1(_class_NSThread, _sel_isMultiThreaded); - } - - /// threadDictionary - objc.NSMutableDictionary get threadDictionary { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_threadDictionary); - return objc.NSMutableDictionary.castFromPointer(_ret, - retain: true, release: true); - } - - /// sleepUntilDate: - static void sleepUntilDate_(objc.NSDate date) { - _objc_msgSend_ukcdfq( - _class_NSThread, _sel_sleepUntilDate_, date.ref.pointer); - } - - /// sleepForTimeInterval: - static void sleepForTimeInterval_(double ti) { - _objc_msgSend_suh039(_class_NSThread, _sel_sleepForTimeInterval_, ti); - } - - /// exit - static void exit() { - _objc_msgSend_ksby9f(_class_NSThread, _sel_exit); - } - - /// threadPriority - double get threadPriority { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_threadPriority); - } - - /// setThreadPriority: - set threadPriority(double value) { - return _objc_msgSend_suh039( - this.ref.pointer, _sel_setThreadPriority_, value); - } - - /// qualityOfService - NSQualityOfService get qualityOfService { - final _ret = _objc_msgSend_17dnyeh(this.ref.pointer, _sel_qualityOfService); - return NSQualityOfService.fromValue(_ret); - } - - /// setQualityOfService: - set qualityOfService(NSQualityOfService value) { - return _objc_msgSend_1fcr8u4( - this.ref.pointer, _sel_setQualityOfService_, value.value); - } - - /// callStackReturnAddresses - static objc.NSArray getCallStackReturnAddresses() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSThread, _sel_callStackReturnAddresses); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// callStackSymbols - static objc.NSArray getCallStackSymbols() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_callStackSymbols); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// name - objc.NSString? get name { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setName: - set name(objc.NSString? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); - } - - /// stackSize - int get stackSize { - return _objc_msgSend_eldhrq(this.ref.pointer, _sel_stackSize); - } - - /// setStackSize: - set stackSize(int value) { - return _objc_msgSend_1k4zaz5(this.ref.pointer, _sel_setStackSize_, value); - } - - /// isMainThread - static bool getIsMainThread() { - return _objc_msgSend_olxnu1(_class_NSThread, _sel_isMainThread); - } - - /// mainThread - static NSThread getMainThread() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_mainThread); - return NSThread.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSThread init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithTarget:selector:object: - NSThread initWithTarget_selector_object_(objc.ObjCObjectBase target, - ffi.Pointer selector, objc.ObjCObjectBase? argument) { - final _ret = _objc_msgSend_yoiems( - this.ref.retainAndReturnPointer(), - _sel_initWithTarget_selector_object_, - target.ref.pointer, - selector, - argument?.ref.pointer ?? ffi.nullptr); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithBlock: - NSThread initWithBlock_(objc.ObjCBlock block) { - final _ret = _objc_msgSend_3c0puu(this.ref.retainAndReturnPointer(), - _sel_initWithBlock_, block.ref.pointer); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// isExecuting - bool get executing { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isExecuting); - } - - /// isFinished - bool get finished { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isFinished); - } - - /// isCancelled - bool get cancelled { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancelled); - } - - /// cancel - void cancel() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); - } - - /// start - void start() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_start); - } - - /// main - void main() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_main); - } - - /// new - static NSThread new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_new); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSThread allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSThread, _sel_allocWithZone_, zone); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSThread alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSThread, _sel_alloc); - return NSThread.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSThread, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSThread, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSThread, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSThread, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSThread, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSThread, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSThread, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSThread, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSThread, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSTimeZone = objc.getClass("NSTimeZone"); -late final _sel_data = objc.registerName("data"); -late final _sel_secondsFromGMTForDate_ = - objc.registerName("secondsFromGMTForDate:"); -final _objc_msgSend_hrsqsi = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_abbreviationForDate_ = - objc.registerName("abbreviationForDate:"); -late final _sel_isDaylightSavingTimeForDate_ = - objc.registerName("isDaylightSavingTimeForDate:"); -late final _sel_daylightSavingTimeOffsetForDate_ = - objc.registerName("daylightSavingTimeOffsetForDate:"); -final _objc_msgSend_om71r5 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - double Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_nextDaylightSavingTimeTransitionAfterDate_ = - objc.registerName("nextDaylightSavingTimeTransitionAfterDate:"); -late final _sel_systemTimeZone = objc.registerName("systemTimeZone"); -late final _sel_resetSystemTimeZone = objc.registerName("resetSystemTimeZone"); -late final _sel_defaultTimeZone = objc.registerName("defaultTimeZone"); -late final _sel_setDefaultTimeZone_ = objc.registerName("setDefaultTimeZone:"); -late final _sel_localTimeZone = objc.registerName("localTimeZone"); -late final _sel_knownTimeZoneNames = objc.registerName("knownTimeZoneNames"); -late final _sel_abbreviationDictionary = - objc.registerName("abbreviationDictionary"); -late final _sel_setAbbreviationDictionary_ = - objc.registerName("setAbbreviationDictionary:"); -late final _sel_timeZoneDataVersion = objc.registerName("timeZoneDataVersion"); -late final _sel_secondsFromGMT = objc.registerName("secondsFromGMT"); -final _objc_msgSend_z1fx1b = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_abbreviation = objc.registerName("abbreviation"); -late final _sel_isDaylightSavingTime = - objc.registerName("isDaylightSavingTime"); -late final _sel_daylightSavingTimeOffset = - objc.registerName("daylightSavingTimeOffset"); -late final _sel_nextDaylightSavingTimeTransition = - objc.registerName("nextDaylightSavingTimeTransition"); -late final _sel_description = objc.registerName("description"); -late final _sel_isEqualToTimeZone_ = objc.registerName("isEqualToTimeZone:"); - -enum NSTimeZoneNameStyle { - NSTimeZoneNameStyleStandard(0), - NSTimeZoneNameStyleShortStandard(1), - NSTimeZoneNameStyleDaylightSaving(2), - NSTimeZoneNameStyleShortDaylightSaving(3), - NSTimeZoneNameStyleGeneric(4), - NSTimeZoneNameStyleShortGeneric(5); - - final int value; - const NSTimeZoneNameStyle(this.value); - - static NSTimeZoneNameStyle fromValue(int value) => switch (value) { - 0 => NSTimeZoneNameStyleStandard, - 1 => NSTimeZoneNameStyleShortStandard, - 2 => NSTimeZoneNameStyleDaylightSaving, - 3 => NSTimeZoneNameStyleShortDaylightSaving, - 4 => NSTimeZoneNameStyleGeneric, - 5 => NSTimeZoneNameStyleShortGeneric, - _ => - throw ArgumentError("Unknown value for NSTimeZoneNameStyle: $value"), - }; -} - -late final _sel_localizedName_locale_ = - objc.registerName("localizedName:locale:"); -final _objc_msgSend_1c91ngg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_timeZoneWithName_ = objc.registerName("timeZoneWithName:"); -late final _sel_timeZoneWithName_data_ = - objc.registerName("timeZoneWithName:data:"); -late final _sel_initWithName_ = objc.registerName("initWithName:"); -late final _sel_initWithName_data_ = objc.registerName("initWithName:data:"); -late final _sel_timeZoneForSecondsFromGMT_ = - objc.registerName("timeZoneForSecondsFromGMT:"); -final _objc_msgSend_crtxa9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_timeZoneWithAbbreviation_ = - objc.registerName("timeZoneWithAbbreviation:"); - -/// NSTimeZone -class NSTimeZone extends objc.NSObject { - NSTimeZone._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSTimeZone] that points to the same underlying object as [other]. - NSTimeZone.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSTimeZone] that wraps the given raw object pointer. - NSTimeZone.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSTimeZone]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSTimeZone); - } - - /// name - objc.NSString get name { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// data - objc.NSData get data { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// secondsFromGMTForDate: - int secondsFromGMTForDate_(objc.NSDate aDate) { - return _objc_msgSend_hrsqsi( - this.ref.pointer, _sel_secondsFromGMTForDate_, aDate.ref.pointer); - } - - /// abbreviationForDate: - objc.NSString? abbreviationForDate_(objc.NSDate aDate) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_abbreviationForDate_, aDate.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isDaylightSavingTimeForDate: - bool isDaylightSavingTimeForDate_(objc.NSDate aDate) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isDaylightSavingTimeForDate_, aDate.ref.pointer); - } - - /// daylightSavingTimeOffsetForDate: - double daylightSavingTimeOffsetForDate_(objc.NSDate aDate) { - return _objc_msgSend_om71r5(this.ref.pointer, - _sel_daylightSavingTimeOffsetForDate_, aDate.ref.pointer); - } - - /// nextDaylightSavingTimeTransitionAfterDate: - objc.NSDate? nextDaylightSavingTimeTransitionAfterDate_(objc.NSDate aDate) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_nextDaylightSavingTimeTransitionAfterDate_, aDate.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// systemTimeZone - static NSTimeZone getSystemTimeZone() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_systemTimeZone); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// resetSystemTimeZone - static void resetSystemTimeZone() { - _objc_msgSend_ksby9f(_class_NSTimeZone, _sel_resetSystemTimeZone); - } - - /// defaultTimeZone - static NSTimeZone getDefaultTimeZone() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_defaultTimeZone); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// setDefaultTimeZone: - static void setDefaultTimeZone(NSTimeZone value) { - return _objc_msgSend_ukcdfq( - _class_NSTimeZone, _sel_setDefaultTimeZone_, value.ref.pointer); - } - - /// localTimeZone - static NSTimeZone getLocalTimeZone() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_localTimeZone); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// knownTimeZoneNames - static objc.NSArray getKnownTimeZoneNames() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_knownTimeZoneNames); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// abbreviationDictionary - static objc.NSDictionary getAbbreviationDictionary() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_abbreviationDictionary); - return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// setAbbreviationDictionary: - static void setAbbreviationDictionary(objc.NSDictionary value) { - return _objc_msgSend_ukcdfq( - _class_NSTimeZone, _sel_setAbbreviationDictionary_, value.ref.pointer); - } - - /// timeZoneDataVersion - static objc.NSString getTimeZoneDataVersion() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_timeZoneDataVersion); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// secondsFromGMT - int get secondsFromGMT { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_secondsFromGMT); - } - - /// abbreviation - objc.NSString? get abbreviation { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_abbreviation); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isDaylightSavingTime - bool get daylightSavingTime { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isDaylightSavingTime); - } - - /// daylightSavingTimeOffset - double get daylightSavingTimeOffset { - return _objc_msgSend_10noklm( - this.ref.pointer, _sel_daylightSavingTimeOffset); - } - - /// nextDaylightSavingTimeTransition - objc.NSDate? get nextDaylightSavingTimeTransition { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_nextDaylightSavingTimeTransition); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// description - objc.NSString get description { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_description); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isEqualToTimeZone: - bool isEqualToTimeZone_(NSTimeZone aTimeZone) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isEqualToTimeZone_, aTimeZone.ref.pointer); - } - - /// localizedName:locale: - objc.NSString? localizedName_locale_( - NSTimeZoneNameStyle style, objc.NSLocale? locale) { - final _ret = _objc_msgSend_1c91ngg( - this.ref.pointer, - _sel_localizedName_locale_, - style.value, - locale?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// timeZoneWithName: - static NSTimeZone? timeZoneWithName_(objc.NSString tzName) { - final _ret = _objc_msgSend_juohf7( - _class_NSTimeZone, _sel_timeZoneWithName_, tzName.ref.pointer); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// timeZoneWithName:data: - static NSTimeZone? timeZoneWithName_data_( - objc.NSString tzName, objc.NSData? aData) { - final _ret = _objc_msgSend_iq11qg( - _class_NSTimeZone, - _sel_timeZoneWithName_data_, - tzName.ref.pointer, - aData?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithName: - NSTimeZone? initWithName_(objc.NSString tzName) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithName_, tzName.ref.pointer); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithName:data: - NSTimeZone? initWithName_data_(objc.NSString tzName, objc.NSData? aData) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithName_data_, - tzName.ref.pointer, - aData?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// timeZoneForSecondsFromGMT: - static NSTimeZone timeZoneForSecondsFromGMT_(int seconds) { - final _ret = _objc_msgSend_crtxa9( - _class_NSTimeZone, _sel_timeZoneForSecondsFromGMT_, seconds); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// timeZoneWithAbbreviation: - static NSTimeZone? timeZoneWithAbbreviation_(objc.NSString abbreviation) { - final _ret = _objc_msgSend_juohf7(_class_NSTimeZone, - _sel_timeZoneWithAbbreviation_, abbreviation.ref.pointer); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSTimeZone init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSTimeZone new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_new); - return NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSTimeZone allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSTimeZone, _sel_allocWithZone_, zone); - return NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSTimeZone alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_alloc); - return NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSTimeZone, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSTimeZone, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSTimeZone, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSTimeZone, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSTimeZone, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSTimeZone, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSTimeZone, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSTimeZone, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimeZone, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1(_class_NSTimeZone, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSTimeZone? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSTimeZone.castFromPointer(_ret, retain: false, release: true); - } -} - -late final _class_NSTimer = objc.getClass("NSTimer"); -late final _sel_timerWithTimeInterval_invocation_repeats_ = - objc.registerName("timerWithTimeInterval:invocation:repeats:"); -final _objc_msgSend_1dbp0rg = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer, - bool)>(); -late final _sel_scheduledTimerWithTimeInterval_invocation_repeats_ = - objc.registerName("scheduledTimerWithTimeInterval:invocation:repeats:"); -late final _sel_timerWithTimeInterval_target_selector_userInfo_repeats_ = objc - .registerName("timerWithTimeInterval:target:selector:userInfo:repeats:"); -final _objc_msgSend_hkb6jt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_ = - objc.registerName( - "scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:"); -void _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>>() - .asFunction)>()(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSTimer_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTimer_fnPtrTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSTimer_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0) => - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); -ffi.Pointer _ObjCBlock_ffiVoid_NSTimer_closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSTimer_closureTrampoline) - .cast(); -void _ObjCBlock_ffiVoid_NSTimer_listenerTrampoline( - ffi.Pointer block, ffi.Pointer arg0) { - (objc.getBlockClosure(block) as void Function( - ffi.Pointer))(arg0); - objc.objectRelease(block.cast()); -} - -ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)> - _ObjCBlock_ffiVoid_NSTimer_listenerCallable = ffi.NativeCallable< - ffi.Void Function(ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSTimer_listenerTrampoline) - ..keepIsolateAlive = false; - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSTimer { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock castFromPointer( - ffi.Pointer pointer, - {bool retain = false, - bool release = false}) => - objc.ObjCBlock(pointer, - retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0)>> - ptr) => - objc.ObjCBlock( - objc.newPointerBlock( - _ObjCBlock_ffiVoid_NSTimer_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock fromFunction( - void Function(NSTimer) fn) => - objc.ObjCBlock( - objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSTimer_closureCallable, - (ffi.Pointer arg0) => fn( - NSTimer.castFromPointer(arg0, retain: true, release: true))), - retain: false, - release: true); - - /// Creates a listener block from a Dart function. - /// - /// This is based on FFI's NativeCallable.listener, and has the same - /// capabilities and limitations. This block can be invoked from any thread, - /// but only supports void functions, and is not run synchronously. See - /// NativeCallable.listener for more details. - /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - static objc.ObjCBlock listener( - void Function(NSTimer) fn) { - final raw = objc.newClosureBlock( - _ObjCBlock_ffiVoid_NSTimer_listenerCallable.nativeFunction.cast(), - (ffi.Pointer arg0) => - fn(NSTimer.castFromPointer(arg0, retain: false, release: true))); - final wrapper = _SwiftLibrary_wrapListenerBlock_ukcdfq(raw); - objc.objectRelease(raw.cast()); - return objc.ObjCBlock(wrapper, - retain: false, release: true); - } -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSTimer_CallExtension - on objc.ObjCBlock { - void call(NSTimer arg0) => ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(ref.pointer, arg0.ref.pointer); -} - -late final _sel_timerWithTimeInterval_repeats_block_ = - objc.registerName("timerWithTimeInterval:repeats:block:"); -final _objc_msgSend_1t6yrah = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Bool, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - double, - bool, - ffi.Pointer)>(); -late final _sel_scheduledTimerWithTimeInterval_repeats_block_ = - objc.registerName("scheduledTimerWithTimeInterval:repeats:block:"); -late final _sel_initWithFireDate_interval_repeats_block_ = - objc.registerName("initWithFireDate:interval:repeats:block:"); -final _objc_msgSend_tzx95k = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Bool, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - double, - bool, - ffi.Pointer)>(); -late final _sel_initWithFireDate_interval_target_selector_userInfo_repeats_ = - objc.registerName( - "initWithFireDate:interval:target:selector:userInfo:repeats:"); -final _objc_msgSend_1mx2fnc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool)>(); -late final _sel_fire = objc.registerName("fire"); -late final _sel_fireDate = objc.registerName("fireDate"); -late final _sel_setFireDate_ = objc.registerName("setFireDate:"); -late final _sel_timeInterval = objc.registerName("timeInterval"); -late final _sel_tolerance = objc.registerName("tolerance"); -late final _sel_setTolerance_ = objc.registerName("setTolerance:"); - -/// NSTimer -class NSTimer extends objc.NSObject { - NSTimer._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSTimer] that points to the same underlying object as [other]. - NSTimer.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSTimer] that wraps the given raw object pointer. - NSTimer.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSTimer]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSTimer); - } - - /// timerWithTimeInterval:invocation:repeats: - static NSTimer timerWithTimeInterval_invocation_repeats_( - double ti, objc.NSInvocation invocation, bool yesOrNo) { - final _ret = _objc_msgSend_1dbp0rg( - _class_NSTimer, - _sel_timerWithTimeInterval_invocation_repeats_, - ti, - invocation.ref.pointer, - yesOrNo); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// scheduledTimerWithTimeInterval:invocation:repeats: - static NSTimer scheduledTimerWithTimeInterval_invocation_repeats_( - double ti, objc.NSInvocation invocation, bool yesOrNo) { - final _ret = _objc_msgSend_1dbp0rg( - _class_NSTimer, - _sel_scheduledTimerWithTimeInterval_invocation_repeats_, - ti, - invocation.ref.pointer, - yesOrNo); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// timerWithTimeInterval:target:selector:userInfo:repeats: - static NSTimer timerWithTimeInterval_target_selector_userInfo_repeats_( - double ti, - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? userInfo, - bool yesOrNo) { - final _ret = _objc_msgSend_hkb6jt( - _class_NSTimer, - _sel_timerWithTimeInterval_target_selector_userInfo_repeats_, - ti, - aTarget.ref.pointer, - aSelector, - userInfo?.ref.pointer ?? ffi.nullptr, - yesOrNo); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: - static NSTimer - scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( - double ti, - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? userInfo, - bool yesOrNo) { - final _ret = _objc_msgSend_hkb6jt( - _class_NSTimer, - _sel_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_, - ti, - aTarget.ref.pointer, - aSelector, - userInfo?.ref.pointer ?? ffi.nullptr, - yesOrNo); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// timerWithTimeInterval:repeats:block: - static NSTimer timerWithTimeInterval_repeats_block_(double interval, - bool repeats, objc.ObjCBlock block) { - final _ret = _objc_msgSend_1t6yrah( - _class_NSTimer, - _sel_timerWithTimeInterval_repeats_block_, - interval, - repeats, - block.ref.pointer); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// scheduledTimerWithTimeInterval:repeats:block: - static NSTimer scheduledTimerWithTimeInterval_repeats_block_(double interval, - bool repeats, objc.ObjCBlock block) { - final _ret = _objc_msgSend_1t6yrah( - _class_NSTimer, - _sel_scheduledTimerWithTimeInterval_repeats_block_, - interval, - repeats, - block.ref.pointer); - return NSTimer.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithFireDate:interval:repeats:block: - NSTimer initWithFireDate_interval_repeats_block_( - objc.NSDate date, - double interval, - bool repeats, - objc.ObjCBlock block) { - final _ret = _objc_msgSend_tzx95k( - this.ref.retainAndReturnPointer(), - _sel_initWithFireDate_interval_repeats_block_, - date.ref.pointer, - interval, - repeats, - block.ref.pointer); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithFireDate:interval:target:selector:userInfo:repeats: - NSTimer initWithFireDate_interval_target_selector_userInfo_repeats_( - objc.NSDate date, - double ti, - objc.ObjCObjectBase t, - ffi.Pointer s, - objc.ObjCObjectBase? ui, - bool rep) { - final _ret = _objc_msgSend_1mx2fnc( - this.ref.retainAndReturnPointer(), - _sel_initWithFireDate_interval_target_selector_userInfo_repeats_, - date.ref.pointer, - ti, - t.ref.pointer, - s, - ui?.ref.pointer ?? ffi.nullptr, - rep); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// fire - void fire() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_fire); - } - - /// fireDate - objc.NSDate get fireDate { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fireDate); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// setFireDate: - set fireDate(objc.NSDate value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setFireDate_, value.ref.pointer); - } - - /// timeInterval - double get timeInterval { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_timeInterval); - } - - /// tolerance - double get tolerance { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_tolerance); - } - - /// setTolerance: - set tolerance(double value) { - return _objc_msgSend_suh039(this.ref.pointer, _sel_setTolerance_, value); - } - - /// invalidate - void invalidate() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_invalidate); - } - - /// isValid - bool get valid { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isValid); - } - - /// userInfo - objc.ObjCObjectBase? get userInfo { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// init - NSTimer init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSTimer new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimer, _sel_new); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSTimer allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSTimer, _sel_allocWithZone_, zone); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSTimer alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSTimer, _sel_alloc); - return NSTimer.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSTimer, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSTimer, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSTimer, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSTimer, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSTimer, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSTimer, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSTimer, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSTimer, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSTimer, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -final class OpaqueAEDataStorageType extends ffi.Opaque {} - -@ffi.Packed(2) -final class AEDesc extends ffi.Struct { - @ffi.UnsignedInt() - external int descriptorType; - - external ffi.Pointer> dataHandle; -} - -late final _class_NSPredicate = objc.getClass("NSPredicate"); -late final _sel_predicateWithFormat_argumentArray_ = - objc.registerName("predicateWithFormat:argumentArray:"); -late final _sel_predicateWithFormat_ = - objc.registerName("predicateWithFormat:"); -late final _sel_predicateFromMetadataQueryString_ = - objc.registerName("predicateFromMetadataQueryString:"); -late final _sel_predicateWithValue_ = objc.registerName("predicateWithValue:"); -bool _ObjCBlock_bool_objcObjCObject_NSDictionary_fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_NSDictionary_fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_NSDictionary_fnPtrTrampoline, false) - .cast(); -bool _ObjCBlock_bool_objcObjCObject_NSDictionary_closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer, - ffi.Pointer))(arg0, arg1); -ffi.Pointer - _ObjCBlock_bool_objcObjCObject_NSDictionary_closureCallable = - ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_objcObjCObject_NSDictionary_closureTrampoline, - false) - .cast(); - -/// Construction methods for `objc.ObjCBlock?, objc.NSDictionary?)>`. -abstract final class ObjCBlock_bool_objcObjCObject_NSDictionary { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer?, objc.NSDictionary?)> - castFromPointer(ffi.Pointer pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer?, objc.NSDictionary?)>( - pointer, - retain: retain, - release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?, objc.NSDictionary?)> fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) => - objc.ObjCBlock?, objc.NSDictionary?)>( - objc.newPointerBlock(_ObjCBlock_bool_objcObjCObject_NSDictionary_fnPtrCallable, ptr.cast()), - retain: false, - release: true); - - /// Creates a block from a Dart function. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock?, objc.NSDictionary?)> fromFunction( - bool Function(objc.ObjCObjectBase?, objc.NSDictionary?) fn) => - objc.ObjCBlock?, objc.NSDictionary?)>( - objc.newClosureBlock( - _ObjCBlock_bool_objcObjCObject_NSDictionary_closureCallable, - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : objc.ObjCObjectBase(arg0, retain: true, release: true), - arg1.address == 0 - ? null - : objc.NSDictionary.castFromPointer(arg1, retain: true, release: true))), - retain: false, - release: true); -} - -/// Call operator for `objc.ObjCBlock?, objc.NSDictionary?)>`. -extension ObjCBlock_bool_objcObjCObject_NSDictionary_CallExtension - on objc.ObjCBlock< - ffi.Bool Function(ffi.Pointer?, objc.NSDictionary?)> { - bool call(objc.ObjCObjectBase? arg0, objc.NSDictionary? arg1) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(ref.pointer, - arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); -} - -late final _sel_predicateWithBlock_ = objc.registerName("predicateWithBlock:"); -late final _sel_predicateFormat = objc.registerName("predicateFormat"); -late final _sel_predicateWithSubstitutionVariables_ = - objc.registerName("predicateWithSubstitutionVariables:"); -late final _sel_evaluateWithObject_ = objc.registerName("evaluateWithObject:"); -late final _sel_evaluateWithObject_substitutionVariables_ = - objc.registerName("evaluateWithObject:substitutionVariables:"); -late final _sel_allowEvaluation = objc.registerName("allowEvaluation"); - -/// NSPredicate -class NSPredicate extends objc.NSObject { - NSPredicate._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSPredicate] that points to the same underlying object as [other]. - NSPredicate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSPredicate] that wraps the given raw object pointer. - NSPredicate.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSPredicate]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSPredicate); - } - - /// predicateWithFormat:argumentArray: - static NSPredicate predicateWithFormat_argumentArray_( - objc.NSString predicateFormat, objc.NSArray? arguments) { - final _ret = _objc_msgSend_iq11qg( - _class_NSPredicate, - _sel_predicateWithFormat_argumentArray_, - predicateFormat.ref.pointer, - arguments?.ref.pointer ?? ffi.nullptr); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateWithFormat: - static NSPredicate predicateWithFormat_(objc.NSString predicateFormat) { - final _ret = _objc_msgSend_juohf7(_class_NSPredicate, - _sel_predicateWithFormat_, predicateFormat.ref.pointer); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateFromMetadataQueryString: - static NSPredicate? predicateFromMetadataQueryString_( - objc.NSString queryString) { - final _ret = _objc_msgSend_juohf7(_class_NSPredicate, - _sel_predicateFromMetadataQueryString_, queryString.ref.pointer); - return _ret.address == 0 - ? null - : NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateWithValue: - static NSPredicate predicateWithValue_(bool value) { - final _ret = _objc_msgSend_1upz917( - _class_NSPredicate, _sel_predicateWithValue_, value); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateWithBlock: - static NSPredicate predicateWithBlock_( - objc.ObjCBlock< - ffi.Bool Function( - ffi.Pointer?, objc.NSDictionary?)> - block) { - final _ret = _objc_msgSend_3c0puu( - _class_NSPredicate, _sel_predicateWithBlock_, block.ref.pointer); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateFormat - objc.NSString get predicateFormat { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_predicateFormat); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// predicateWithSubstitutionVariables: - NSPredicate predicateWithSubstitutionVariables_(objc.NSDictionary variables) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_predicateWithSubstitutionVariables_, variables.ref.pointer); - return NSPredicate.castFromPointer(_ret, retain: true, release: true); - } - - /// evaluateWithObject: - bool evaluateWithObject_(objc.ObjCObjectBase? object) { - return _objc_msgSend_l8lotg(this.ref.pointer, _sel_evaluateWithObject_, - object?.ref.pointer ?? ffi.nullptr); - } - - /// evaluateWithObject:substitutionVariables: - bool evaluateWithObject_substitutionVariables_( - objc.ObjCObjectBase? object, objc.NSDictionary? bindings) { - return _objc_msgSend_1ywe6ev( - this.ref.pointer, - _sel_evaluateWithObject_substitutionVariables_, - object?.ref.pointer ?? ffi.nullptr, - bindings?.ref.pointer ?? ffi.nullptr); - } - - /// allowEvaluation - void allowEvaluation() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_allowEvaluation); - } - - /// init - NSPredicate init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSPredicate.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSPredicate new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPredicate, _sel_new); - return NSPredicate.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSPredicate allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSPredicate, _sel_allocWithZone_, zone); - return NSPredicate.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSPredicate alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPredicate, _sel_alloc); - return NSPredicate.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSPredicate, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSPredicate, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSPredicate, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSPredicate, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSPredicate, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSPredicate, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSPredicate, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPredicate, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSPredicate, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1(_class_NSPredicate, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSPredicate? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSPredicate.castFromPointer(_ret, retain: false, release: true); - } -} - -enum NSLinguisticTaggerOptions { - NSLinguisticTaggerOmitWords(1), - NSLinguisticTaggerOmitPunctuation(2), - NSLinguisticTaggerOmitWhitespace(4), - NSLinguisticTaggerOmitOther(8), - NSLinguisticTaggerJoinNames(16); - - final int value; - const NSLinguisticTaggerOptions(this.value); - - static NSLinguisticTaggerOptions fromValue(int value) => switch (value) { - 1 => NSLinguisticTaggerOmitWords, - 2 => NSLinguisticTaggerOmitPunctuation, - 4 => NSLinguisticTaggerOmitWhitespace, - 8 => NSLinguisticTaggerOmitOther, - 16 => NSLinguisticTaggerJoinNames, - _ => throw ArgumentError( - "Unknown value for NSLinguisticTaggerOptions: $value"), - }; -} - -late final _class_NSArchiver = objc.getClass("NSArchiver"); -late final _sel_archiverData = objc.registerName("archiverData"); -late final _sel_encodeRootObject_ = objc.registerName("encodeRootObject:"); -late final _sel_encodeConditionalObject_ = - objc.registerName("encodeConditionalObject:"); -late final _sel_encodeClassName_intoClassName_ = - objc.registerName("encodeClassName:intoClassName:"); -late final _sel_classNameEncodedForTrueClassName_ = - objc.registerName("classNameEncodedForTrueClassName:"); -late final _sel_replaceObject_withObject_ = - objc.registerName("replaceObject:withObject:"); - -/// NSArchiver -class NSArchiver extends objc.NSCoder { - NSArchiver._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSArchiver] that points to the same underlying object as [other]. - NSArchiver.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSArchiver] that wraps the given raw object pointer. - NSArchiver.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSArchiver]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSArchiver); - } - - /// initForWritingWithMutableData: - NSArchiver initForWritingWithMutableData_(objc.NSMutableData mdata) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initForWritingWithMutableData_, mdata.ref.pointer); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// archiverData - objc.NSMutableData get archiverData { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_archiverData); - return objc.NSMutableData.castFromPointer(_ret, - retain: true, release: true); - } - - /// encodeRootObject: - void encodeRootObject_(objc.ObjCObjectBase rootObject) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeRootObject_, rootObject.ref.pointer); - } - - /// encodeConditionalObject: - void encodeConditionalObject_(objc.ObjCObjectBase? object) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_encodeConditionalObject_, - object?.ref.pointer ?? ffi.nullptr); - } - - /// archivedDataWithRootObject: - static objc.NSData archivedDataWithRootObject_( - objc.ObjCObjectBase rootObject) { - final _ret = _objc_msgSend_juohf7(_class_NSArchiver, - _sel_archivedDataWithRootObject_, rootObject.ref.pointer); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// archiveRootObject:toFile: - static bool archiveRootObject_toFile_( - objc.ObjCObjectBase rootObject, objc.NSString path) { - return _objc_msgSend_1ywe6ev( - _class_NSArchiver, - _sel_archiveRootObject_toFile_, - rootObject.ref.pointer, - path.ref.pointer); - } - - /// encodeClassName:intoClassName: - void encodeClassName_intoClassName_( - objc.NSString trueName, objc.NSString inArchiveName) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_encodeClassName_intoClassName_, - trueName.ref.pointer, inArchiveName.ref.pointer); - } - - /// classNameEncodedForTrueClassName: - objc.NSString? classNameEncodedForTrueClassName_(objc.NSString trueName) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_classNameEncodedForTrueClassName_, trueName.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// replaceObject:withObject: - void replaceObject_withObject_( - objc.ObjCObjectBase object, objc.ObjCObjectBase newObject) { - _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_replaceObject_withObject_, - object.ref.pointer, newObject.ref.pointer); - } - - /// init - NSArchiver init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSArchiver new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSArchiver, _sel_new); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSArchiver allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSArchiver, _sel_allocWithZone_, zone); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSArchiver alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSArchiver, _sel_alloc); - return NSArchiver.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSArchiver, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSArchiver, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSArchiver, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSArchiver, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSArchiver, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSArchiver, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSArchiver, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSArchiver, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSArchiver, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSCalendarDate = objc.getClass("NSCalendarDate"); -late final _sel_calendarDate = objc.registerName("calendarDate"); -late final _sel_dateWithString_calendarFormat_locale_ = - objc.registerName("dateWithString:calendarFormat:locale:"); -late final _sel_dateWithString_calendarFormat_ = - objc.registerName("dateWithString:calendarFormat:"); -late final _sel_dateWithYear_month_day_hour_minute_second_timeZone_ = - objc.registerName("dateWithYear:month:day:hour:minute:second:timeZone:"); -final _objc_msgSend_12rwmwu = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.UnsignedLong, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - int, - int, - int, - int, - ffi.Pointer)>(); -late final _sel_dateByAddingYears_months_days_hours_minutes_seconds_ = - objc.registerName("dateByAddingYears:months:days:hours:minutes:seconds:"); -final _objc_msgSend_1kw3lvq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long, - ffi.Long)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, int, int, int, int)>(); -late final _sel_dayOfCommonEra = objc.registerName("dayOfCommonEra"); -late final _sel_dayOfMonth = objc.registerName("dayOfMonth"); -late final _sel_dayOfWeek = objc.registerName("dayOfWeek"); -late final _sel_dayOfYear = objc.registerName("dayOfYear"); -late final _sel_hourOfDay = objc.registerName("hourOfDay"); -late final _sel_minuteOfHour = objc.registerName("minuteOfHour"); -late final _sel_monthOfYear = objc.registerName("monthOfYear"); -late final _sel_secondOfMinute = objc.registerName("secondOfMinute"); -late final _sel_yearOfCommonEra = objc.registerName("yearOfCommonEra"); -late final _sel_calendarFormat = objc.registerName("calendarFormat"); -late final _sel_descriptionWithCalendarFormat_locale_ = - objc.registerName("descriptionWithCalendarFormat:locale:"); -late final _sel_descriptionWithCalendarFormat_ = - objc.registerName("descriptionWithCalendarFormat:"); -late final _sel_descriptionWithLocale_ = - objc.registerName("descriptionWithLocale:"); -late final _sel_timeZone = objc.registerName("timeZone"); -late final _sel_initWithString_calendarFormat_locale_ = - objc.registerName("initWithString:calendarFormat:locale:"); -late final _sel_initWithString_calendarFormat_ = - objc.registerName("initWithString:calendarFormat:"); -late final _sel_initWithString_ = objc.registerName("initWithString:"); -late final _sel_initWithYear_month_day_hour_minute_second_timeZone_ = - objc.registerName("initWithYear:month:day:hour:minute:second:timeZone:"); -late final _sel_setCalendarFormat_ = objc.registerName("setCalendarFormat:"); -late final _sel_setTimeZone_ = objc.registerName("setTimeZone:"); -late final _sel_years_months_days_hours_minutes_seconds_sinceDate_ = - objc.registerName("years:months:days:hours:minutes:seconds:sinceDate:"); -final _objc_msgSend_1lu4cmc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_distantFuture = objc.registerName("distantFuture"); -late final _sel_distantPast = objc.registerName("distantPast"); -late final _sel_timeIntervalSinceReferenceDate = - objc.registerName("timeIntervalSinceReferenceDate"); -late final _sel_initWithTimeIntervalSinceReferenceDate_ = - objc.registerName("initWithTimeIntervalSinceReferenceDate:"); -final _objc_msgSend_m7jc8y = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, double)>(); -late final _sel_dateByAddingTimeInterval_ = - objc.registerName("dateByAddingTimeInterval:"); -late final _sel_date = objc.registerName("date"); -late final _sel_dateWithTimeIntervalSinceNow_ = - objc.registerName("dateWithTimeIntervalSinceNow:"); -late final _sel_dateWithTimeIntervalSinceReferenceDate_ = - objc.registerName("dateWithTimeIntervalSinceReferenceDate:"); -late final _sel_dateWithTimeIntervalSince1970_ = - objc.registerName("dateWithTimeIntervalSince1970:"); -late final _sel_dateWithTimeInterval_sinceDate_ = - objc.registerName("dateWithTimeInterval:sinceDate:"); -final _objc_msgSend_m6z6pt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Double, - ffi.Pointer)>>() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - double, - ffi.Pointer)>(); -late final _sel_now = objc.registerName("now"); -late final _sel_initWithTimeIntervalSinceNow_ = - objc.registerName("initWithTimeIntervalSinceNow:"); -late final _sel_initWithTimeIntervalSince1970_ = - objc.registerName("initWithTimeIntervalSince1970:"); -late final _sel_initWithTimeInterval_sinceDate_ = - objc.registerName("initWithTimeInterval:sinceDate:"); -late final _sel_dateWithNaturalLanguageString_locale_ = - objc.registerName("dateWithNaturalLanguageString:locale:"); -late final _sel_dateWithNaturalLanguageString_ = - objc.registerName("dateWithNaturalLanguageString:"); -late final _sel_dateWithString_ = objc.registerName("dateWithString:"); - -/// NSCalendarDate -class NSCalendarDate extends objc.NSDate { - NSCalendarDate._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSCalendarDate] that points to the same underlying object as [other]. - NSCalendarDate.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSCalendarDate] that wraps the given raw object pointer. - NSCalendarDate.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSCalendarDate]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSCalendarDate); - } - - /// calendarDate - static objc.ObjCObjectBase calendarDate() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_calendarDate); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithString:calendarFormat:locale: - static objc.ObjCObjectBase? dateWithString_calendarFormat_locale_( - objc.NSString description, - objc.NSString format, - objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_aud7dn( - _class_NSCalendarDate, - _sel_dateWithString_calendarFormat_locale_, - description.ref.pointer, - format.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithString:calendarFormat: - static objc.ObjCObjectBase? dateWithString_calendarFormat_( - objc.NSString description, objc.NSString format) { - final _ret = _objc_msgSend_iq11qg( - _class_NSCalendarDate, - _sel_dateWithString_calendarFormat_, - description.ref.pointer, - format.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithYear:month:day:hour:minute:second:timeZone: - static objc.ObjCObjectBase - dateWithYear_month_day_hour_minute_second_timeZone_(int year, int month, - int day, int hour, int minute, int second, NSTimeZone? aTimeZone) { - final _ret = _objc_msgSend_12rwmwu( - _class_NSCalendarDate, - _sel_dateWithYear_month_day_hour_minute_second_timeZone_, - year, - month, - day, - hour, - minute, - second, - aTimeZone?.ref.pointer ?? ffi.nullptr); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateByAddingYears:months:days:hours:minutes:seconds: - NSCalendarDate dateByAddingYears_months_days_hours_minutes_seconds_( - int year, int month, int day, int hour, int minute, int second) { - final _ret = _objc_msgSend_1kw3lvq( - this.ref.pointer, - _sel_dateByAddingYears_months_days_hours_minutes_seconds_, - year, - month, - day, - hour, - minute, - second); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dayOfCommonEra - int dayOfCommonEra() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_dayOfCommonEra); - } - - /// dayOfMonth - int dayOfMonth() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_dayOfMonth); - } - - /// dayOfWeek - int dayOfWeek() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_dayOfWeek); - } - - /// dayOfYear - int dayOfYear() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_dayOfYear); - } - - /// hourOfDay - int hourOfDay() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_hourOfDay); - } - - /// minuteOfHour - int minuteOfHour() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_minuteOfHour); - } - - /// monthOfYear - int monthOfYear() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_monthOfYear); - } - - /// secondOfMinute - int secondOfMinute() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_secondOfMinute); - } - - /// yearOfCommonEra - int yearOfCommonEra() { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_yearOfCommonEra); - } - - /// calendarFormat - objc.NSString calendarFormat() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_calendarFormat); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithCalendarFormat:locale: - objc.NSString descriptionWithCalendarFormat_locale_( - objc.NSString format, objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_iq11qg( - this.ref.pointer, - _sel_descriptionWithCalendarFormat_locale_, - format.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithCalendarFormat: - objc.NSString descriptionWithCalendarFormat_(objc.NSString format) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_descriptionWithCalendarFormat_, format.ref.pointer); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// descriptionWithLocale: - objc.NSString descriptionWithLocale_(objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_descriptionWithLocale_, locale?.ref.pointer ?? ffi.nullptr); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// timeZone - NSTimeZone timeZone() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_timeZone); - return NSTimeZone.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithString:calendarFormat:locale: - objc.ObjCObjectBase? initWithString_calendarFormat_locale_( - objc.NSString description, - objc.NSString format, - objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithString_calendarFormat_locale_, - description.ref.pointer, - format.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithString:calendarFormat: - objc.ObjCObjectBase? initWithString_calendarFormat_( - objc.NSString description, objc.NSString format) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithString_calendarFormat_, - description.ref.pointer, - format.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithString: - objc.ObjCObjectBase? initWithString_(objc.NSString description) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithString_, description.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// initWithYear:month:day:hour:minute:second:timeZone: - objc.ObjCObjectBase initWithYear_month_day_hour_minute_second_timeZone_( - int year, - int month, - int day, - int hour, - int minute, - int second, - NSTimeZone? aTimeZone) { - final _ret = _objc_msgSend_12rwmwu( - this.ref.retainAndReturnPointer(), - _sel_initWithYear_month_day_hour_minute_second_timeZone_, - year, - month, - day, - hour, - minute, - second, - aTimeZone?.ref.pointer ?? ffi.nullptr); - return objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// setCalendarFormat: - void setCalendarFormat_(objc.NSString? format) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setCalendarFormat_, - format?.ref.pointer ?? ffi.nullptr); - } - - /// setTimeZone: - void setTimeZone_(NSTimeZone? aTimeZone) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setTimeZone_, - aTimeZone?.ref.pointer ?? ffi.nullptr); - } - - /// years:months:days:hours:minutes:seconds:sinceDate: - void years_months_days_hours_minutes_seconds_sinceDate_( - ffi.Pointer yp, - ffi.Pointer mop, - ffi.Pointer dp, - ffi.Pointer hp, - ffi.Pointer mip, - ffi.Pointer sp, - NSCalendarDate date) { - _objc_msgSend_1lu4cmc( - this.ref.pointer, - _sel_years_months_days_hours_minutes_seconds_sinceDate_, - yp, - mop, - dp, - hp, - mip, - sp, - date.ref.pointer); - } - - /// distantFuture - static objc.NSDate getDistantFuture() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_distantFuture); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// distantPast - static objc.NSDate getDistantPast() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_distantPast); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// timeIntervalSinceReferenceDate - static double getTimeIntervalSinceReferenceDate() { - return _objc_msgSend_10noklm( - _class_NSCalendarDate, _sel_timeIntervalSinceReferenceDate); - } - - /// init - NSCalendarDate init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithTimeIntervalSinceReferenceDate: - NSCalendarDate initWithTimeIntervalSinceReferenceDate_(double ti) { - final _ret = _objc_msgSend_m7jc8y(this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSinceReferenceDate_, ti); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCoder: - NSCalendarDate? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// dateByAddingTimeInterval: - NSCalendarDate dateByAddingTimeInterval_(double ti) { - final _ret = _objc_msgSend_m7jc8y( - this.ref.pointer, _sel_dateByAddingTimeInterval_, ti); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// date - static NSCalendarDate date() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_date); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dateWithTimeIntervalSinceNow: - static NSCalendarDate dateWithTimeIntervalSinceNow_(double secs) { - final _ret = _objc_msgSend_m7jc8y( - _class_NSCalendarDate, _sel_dateWithTimeIntervalSinceNow_, secs); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dateWithTimeIntervalSinceReferenceDate: - static NSCalendarDate dateWithTimeIntervalSinceReferenceDate_(double ti) { - final _ret = _objc_msgSend_m7jc8y(_class_NSCalendarDate, - _sel_dateWithTimeIntervalSinceReferenceDate_, ti); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dateWithTimeIntervalSince1970: - static NSCalendarDate dateWithTimeIntervalSince1970_(double secs) { - final _ret = _objc_msgSend_m7jc8y( - _class_NSCalendarDate, _sel_dateWithTimeIntervalSince1970_, secs); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// dateWithTimeInterval:sinceDate: - static NSCalendarDate dateWithTimeInterval_sinceDate_( - double secsToBeAdded, objc.NSDate date) { - final _ret = _objc_msgSend_m6z6pt(_class_NSCalendarDate, - _sel_dateWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); - return NSCalendarDate.castFromPointer(_ret, retain: true, release: true); - } - - /// now - static objc.NSDate getNow() { - final _ret = _objc_msgSend_1unuoxw(_class_NSCalendarDate, _sel_now); - return objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithTimeIntervalSinceNow: - NSCalendarDate initWithTimeIntervalSinceNow_(double secs) { - final _ret = _objc_msgSend_m7jc8y(this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSinceNow_, secs); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithTimeIntervalSince1970: - NSCalendarDate initWithTimeIntervalSince1970_(double secs) { - final _ret = _objc_msgSend_m7jc8y(this.ref.retainAndReturnPointer(), - _sel_initWithTimeIntervalSince1970_, secs); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithTimeInterval:sinceDate: - NSCalendarDate initWithTimeInterval_sinceDate_( - double secsToBeAdded, objc.NSDate date) { - final _ret = _objc_msgSend_m6z6pt(this.ref.retainAndReturnPointer(), - _sel_initWithTimeInterval_sinceDate_, secsToBeAdded, date.ref.pointer); - return NSCalendarDate.castFromPointer(_ret, retain: false, release: true); - } - - /// dateWithNaturalLanguageString:locale: - static objc.ObjCObjectBase? dateWithNaturalLanguageString_locale_( - objc.NSString string, objc.ObjCObjectBase? locale) { - final _ret = _objc_msgSend_iq11qg( - _class_NSCalendarDate, - _sel_dateWithNaturalLanguageString_locale_, - string.ref.pointer, - locale?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithNaturalLanguageString: - static objc.ObjCObjectBase? dateWithNaturalLanguageString_( - objc.NSString string) { - final _ret = _objc_msgSend_juohf7(_class_NSCalendarDate, - _sel_dateWithNaturalLanguageString_, string.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// dateWithString: - static objc.ObjCObjectBase dateWithString_(objc.NSString aString) { - final _ret = _objc_msgSend_juohf7( - _class_NSCalendarDate, _sel_dateWithString_, aString.ref.pointer); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSPortCoder = objc.getClass("NSPortCoder"); -late final _sel_isBycopy = objc.registerName("isBycopy"); -late final _sel_isByref = objc.registerName("isByref"); -late final _sel_encodePortObject_ = objc.registerName("encodePortObject:"); -late final _sel_decodePortObject = objc.registerName("decodePortObject"); -late final _sel_connection = objc.registerName("connection"); -late final _sel_portCoderWithReceivePort_sendPort_components_ = - objc.registerName("portCoderWithReceivePort:sendPort:components:"); -late final _sel_initWithReceivePort_sendPort_components_ = - objc.registerName("initWithReceivePort:sendPort:components:"); -late final _sel_dispatch = objc.registerName("dispatch"); - -/// NSPortCoder -class NSPortCoder extends objc.NSCoder { - NSPortCoder._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSPortCoder] that points to the same underlying object as [other]. - NSPortCoder.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSPortCoder] that wraps the given raw object pointer. - NSPortCoder.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSPortCoder]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSPortCoder); - } - - /// isBycopy - bool isBycopy() { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isBycopy); - } - - /// isByref - bool isByref() { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isByref); - } - - /// encodePortObject: - void encodePortObject_(NSPort aport) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodePortObject_, aport.ref.pointer); - } - - /// decodePortObject - NSPort? decodePortObject() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_decodePortObject); - return _ret.address == 0 - ? null - : NSPort.castFromPointer(_ret, retain: true, release: true); - } - - /// connection - NSConnection? connection() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_connection); - return _ret.address == 0 - ? null - : NSConnection.castFromPointer(_ret, retain: true, release: true); - } - - /// portCoderWithReceivePort:sendPort:components: - static objc.ObjCObjectBase portCoderWithReceivePort_sendPort_components_( - NSPort? rcvPort, NSPort? sndPort, objc.NSArray? comps) { - final _ret = _objc_msgSend_aud7dn( - _class_NSPortCoder, - _sel_portCoderWithReceivePort_sendPort_components_, - rcvPort?.ref.pointer ?? ffi.nullptr, - sndPort?.ref.pointer ?? ffi.nullptr, - comps?.ref.pointer ?? ffi.nullptr); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// initWithReceivePort:sendPort:components: - objc.ObjCObjectBase initWithReceivePort_sendPort_components_( - NSPort? rcvPort, NSPort? sndPort, objc.NSArray? comps) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithReceivePort_sendPort_components_, - rcvPort?.ref.pointer ?? ffi.nullptr, - sndPort?.ref.pointer ?? ffi.nullptr, - comps?.ref.pointer ?? ffi.nullptr); - return objc.ObjCObjectBase(_ret, retain: false, release: true); - } - - /// dispatch - void dispatch() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_dispatch); - } - - /// init - NSPortCoder init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSPortCoder.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSPortCoder new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPortCoder, _sel_new); - return NSPortCoder.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSPortCoder allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = - _objc_msgSend_1b3ihd0(_class_NSPortCoder, _sel_allocWithZone_, zone); - return NSPortCoder.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSPortCoder alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSPortCoder, _sel_alloc); - return NSPortCoder.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSPortCoder, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSPortCoder, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSPortCoder, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSPortCoder, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSPortCoder, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSPortCoder, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSPortCoder, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSPortCoder, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSPortCoder, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -enum NSAppleEventSendOptions { - NSAppleEventSendNoReply(1), - NSAppleEventSendQueueReply(2), - NSAppleEventSendWaitForReply(3), - NSAppleEventSendNeverInteract(16), - NSAppleEventSendCanInteract(32), - NSAppleEventSendAlwaysInteract(48), - NSAppleEventSendCanSwitchLayer(64), - NSAppleEventSendDontRecord(4096), - NSAppleEventSendDontExecute(8192), - NSAppleEventSendDontAnnotate(65536), - NSAppleEventSendDefaultOptions(35); - - final int value; - const NSAppleEventSendOptions(this.value); - - static NSAppleEventSendOptions fromValue(int value) => switch (value) { - 1 => NSAppleEventSendNoReply, - 2 => NSAppleEventSendQueueReply, - 3 => NSAppleEventSendWaitForReply, - 16 => NSAppleEventSendNeverInteract, - 32 => NSAppleEventSendCanInteract, - 48 => NSAppleEventSendAlwaysInteract, - 64 => NSAppleEventSendCanSwitchLayer, - 4096 => NSAppleEventSendDontRecord, - 8192 => NSAppleEventSendDontExecute, - 65536 => NSAppleEventSendDontAnnotate, - 35 => NSAppleEventSendDefaultOptions, - _ => throw ArgumentError( - "Unknown value for NSAppleEventSendOptions: $value"), - }; -} - -late final _class_NSAppleEventDescriptor = - objc.getClass("NSAppleEventDescriptor"); -late final _sel_nullDescriptor = objc.registerName("nullDescriptor"); -late final _sel_descriptorWithDescriptorType_bytes_length_ = - objc.registerName("descriptorWithDescriptorType:bytes:length:"); -final _objc_msgSend_unctjf = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.Pointer, - ffi.UnsignedLong)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); -late final _sel_descriptorWithDescriptorType_data_ = - objc.registerName("descriptorWithDescriptorType:data:"); -final _objc_msgSend_1k5vjgv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); -late final _sel_descriptorWithBoolean_ = - objc.registerName("descriptorWithBoolean:"); -final _objc_msgSend_1ar9f5m = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedChar)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_descriptorWithEnumCode_ = - objc.registerName("descriptorWithEnumCode:"); -final _objc_msgSend_pxgym4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_descriptorWithInt32_ = - objc.registerName("descriptorWithInt32:"); -final _objc_msgSend_105o5we = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_descriptorWithDouble_ = - objc.registerName("descriptorWithDouble:"); -late final _sel_descriptorWithTypeCode_ = - objc.registerName("descriptorWithTypeCode:"); -late final _sel_descriptorWithString_ = - objc.registerName("descriptorWithString:"); -late final _sel_descriptorWithDate_ = objc.registerName("descriptorWithDate:"); -late final _sel_descriptorWithFileURL_ = - objc.registerName("descriptorWithFileURL:"); -late final _sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_ = - objc.registerName( - "appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); -final _objc_msgSend_1iwlq4o = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.UnsignedInt, - ffi.Pointer, - ffi.Short, - ffi.Int)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - ffi.Pointer, - int, - int)>(); -late final _sel_listDescriptor = objc.registerName("listDescriptor"); -late final _sel_recordDescriptor = objc.registerName("recordDescriptor"); -late final _sel_currentProcessDescriptor = - objc.registerName("currentProcessDescriptor"); -late final _sel_descriptorWithProcessIdentifier_ = - objc.registerName("descriptorWithProcessIdentifier:"); -late final _sel_descriptorWithBundleIdentifier_ = - objc.registerName("descriptorWithBundleIdentifier:"); -late final _sel_descriptorWithApplicationURL_ = - objc.registerName("descriptorWithApplicationURL:"); -late final _sel_initWithAEDescNoCopy_ = - objc.registerName("initWithAEDescNoCopy:"); -final _objc_msgSend_10xxpbh = objc.msgSendPointer - .cast< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>() - .asFunction< - instancetype Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_initWithDescriptorType_bytes_length_ = - objc.registerName("initWithDescriptorType:bytes:length:"); -late final _sel_initWithDescriptorType_data_ = - objc.registerName("initWithDescriptorType:data:"); -late final _sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_ = - objc.registerName( - "initWithEventClass:eventID:targetDescriptor:returnID:transactionID:"); -late final _sel_initListDescriptor = objc.registerName("initListDescriptor"); -late final _sel_initRecordDescriptor = - objc.registerName("initRecordDescriptor"); -late final _sel_aeDesc = objc.registerName("aeDesc"); -final _objc_msgSend_jg6irx = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_descriptorType = objc.registerName("descriptorType"); -final _objc_msgSend_dzloj4 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_booleanValue = objc.registerName("booleanValue"); -final _objc_msgSend_1cswds = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedChar Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_enumCodeValue = objc.registerName("enumCodeValue"); -late final _sel_int32Value = objc.registerName("int32Value"); -final _objc_msgSend_1tf0yjs = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_doubleValue = objc.registerName("doubleValue"); -late final _sel_typeCodeValue = objc.registerName("typeCodeValue"); -late final _sel_stringValue = objc.registerName("stringValue"); -late final _sel_dateValue = objc.registerName("dateValue"); -late final _sel_fileURLValue = objc.registerName("fileURLValue"); -late final _sel_eventClass = objc.registerName("eventClass"); -late final _sel_eventID = objc.registerName("eventID"); -late final _sel_returnID = objc.registerName("returnID"); -final _objc_msgSend_157j54x = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Short Function(ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); -late final _sel_transactionID = objc.registerName("transactionID"); -late final _sel_setParamDescriptor_forKeyword_ = - objc.registerName("setParamDescriptor:forKeyword:"); -final _objc_msgSend_1dzwu6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_paramDescriptorForKeyword_ = - objc.registerName("paramDescriptorForKeyword:"); -late final _sel_removeParamDescriptorWithKeyword_ = - objc.registerName("removeParamDescriptorWithKeyword:"); -final _objc_msgSend_l6g8fv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setAttributeDescriptor_forKeyword_ = - objc.registerName("setAttributeDescriptor:forKeyword:"); -late final _sel_attributeDescriptorForKeyword_ = - objc.registerName("attributeDescriptorForKeyword:"); -late final _sel_sendEventWithOptions_timeout_error_ = - objc.registerName("sendEventWithOptions:timeout:error:"); -final _objc_msgSend_19xj9w = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Double, - ffi.Pointer>)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - double, - ffi.Pointer>)>(); -late final _sel_isRecordDescriptor = objc.registerName("isRecordDescriptor"); -late final _sel_numberOfItems = objc.registerName("numberOfItems"); -late final _sel_insertDescriptor_atIndex_ = - objc.registerName("insertDescriptor:atIndex:"); -final _objc_msgSend_da94db = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Long)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); -late final _sel_descriptorAtIndex_ = objc.registerName("descriptorAtIndex:"); -late final _sel_removeDescriptorAtIndex_ = - objc.registerName("removeDescriptorAtIndex:"); -final _objc_msgSend_ke7qz2 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_setDescriptor_forKeyword_ = - objc.registerName("setDescriptor:forKeyword:"); -late final _sel_descriptorForKeyword_ = - objc.registerName("descriptorForKeyword:"); -late final _sel_removeDescriptorWithKeyword_ = - objc.registerName("removeDescriptorWithKeyword:"); -late final _sel_keywordForDescriptorAtIndex_ = - objc.registerName("keywordForDescriptorAtIndex:"); -final _objc_msgSend_hkgvph = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _sel_coerceToDescriptorType_ = - objc.registerName("coerceToDescriptorType:"); - -/// NSAppleEventDescriptor -class NSAppleEventDescriptor extends objc.NSObject { - NSAppleEventDescriptor._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSAppleEventDescriptor] that points to the same underlying object as [other]. - NSAppleEventDescriptor.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSAppleEventDescriptor] that wraps the given raw object pointer. - NSAppleEventDescriptor.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSAppleEventDescriptor]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSAppleEventDescriptor); - } - - /// nullDescriptor - static NSAppleEventDescriptor nullDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_nullDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithDescriptorType:bytes:length: - static NSAppleEventDescriptor? descriptorWithDescriptorType_bytes_length_( - int descriptorType, ffi.Pointer bytes, int byteCount) { - final _ret = _objc_msgSend_unctjf( - _class_NSAppleEventDescriptor, - _sel_descriptorWithDescriptorType_bytes_length_, - descriptorType, - bytes, - byteCount); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithDescriptorType:data: - static NSAppleEventDescriptor? descriptorWithDescriptorType_data_( - int descriptorType, objc.NSData? data) { - final _ret = _objc_msgSend_1k5vjgv( - _class_NSAppleEventDescriptor, - _sel_descriptorWithDescriptorType_data_, - descriptorType, - data?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithBoolean: - static NSAppleEventDescriptor descriptorWithBoolean_(int boolean) { - final _ret = _objc_msgSend_1ar9f5m( - _class_NSAppleEventDescriptor, _sel_descriptorWithBoolean_, boolean); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithEnumCode: - static NSAppleEventDescriptor descriptorWithEnumCode_(int enumerator) { - final _ret = _objc_msgSend_pxgym4(_class_NSAppleEventDescriptor, - _sel_descriptorWithEnumCode_, enumerator); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithInt32: - static NSAppleEventDescriptor descriptorWithInt32_(int signedInt) { - final _ret = _objc_msgSend_105o5we( - _class_NSAppleEventDescriptor, _sel_descriptorWithInt32_, signedInt); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithDouble: - static NSAppleEventDescriptor descriptorWithDouble_(double doubleValue) { - final _ret = _objc_msgSend_m7jc8y( - _class_NSAppleEventDescriptor, _sel_descriptorWithDouble_, doubleValue); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithTypeCode: - static NSAppleEventDescriptor descriptorWithTypeCode_(int typeCode) { - final _ret = _objc_msgSend_pxgym4( - _class_NSAppleEventDescriptor, _sel_descriptorWithTypeCode_, typeCode); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithString: - static NSAppleEventDescriptor descriptorWithString_(objc.NSString string) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithString_, string.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithDate: - static NSAppleEventDescriptor descriptorWithDate_(objc.NSDate date) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithDate_, date.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithFileURL: - static NSAppleEventDescriptor descriptorWithFileURL_(objc.NSURL fileURL) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithFileURL_, fileURL.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID: - static NSAppleEventDescriptor - appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_( - int eventClass, - int eventID, - NSAppleEventDescriptor? targetDescriptor, - int returnID, - int transactionID) { - final _ret = _objc_msgSend_1iwlq4o( - _class_NSAppleEventDescriptor, - _sel_appleEventWithEventClass_eventID_targetDescriptor_returnID_transactionID_, - eventClass, - eventID, - targetDescriptor?.ref.pointer ?? ffi.nullptr, - returnID, - transactionID); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// listDescriptor - static NSAppleEventDescriptor listDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_listDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// recordDescriptor - static NSAppleEventDescriptor recordDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_recordDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// currentProcessDescriptor - static NSAppleEventDescriptor currentProcessDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_currentProcessDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithProcessIdentifier: - static NSAppleEventDescriptor descriptorWithProcessIdentifier_( - int processIdentifier) { - final _ret = _objc_msgSend_105o5we(_class_NSAppleEventDescriptor, - _sel_descriptorWithProcessIdentifier_, processIdentifier); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithBundleIdentifier: - static NSAppleEventDescriptor descriptorWithBundleIdentifier_( - objc.NSString bundleIdentifier) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithBundleIdentifier_, bundleIdentifier.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptorWithApplicationURL: - static NSAppleEventDescriptor descriptorWithApplicationURL_( - objc.NSURL applicationURL) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_descriptorWithApplicationURL_, applicationURL.ref.pointer); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// initWithAEDescNoCopy: - NSAppleEventDescriptor initWithAEDescNoCopy_(ffi.Pointer aeDesc) { - final _ret = _objc_msgSend_10xxpbh( - this.ref.retainAndReturnPointer(), _sel_initWithAEDescNoCopy_, aeDesc); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithDescriptorType:bytes:length: - NSAppleEventDescriptor? initWithDescriptorType_bytes_length_( - int descriptorType, ffi.Pointer bytes, int byteCount) { - final _ret = _objc_msgSend_unctjf( - this.ref.retainAndReturnPointer(), - _sel_initWithDescriptorType_bytes_length_, - descriptorType, - bytes, - byteCount); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithDescriptorType:data: - NSAppleEventDescriptor? initWithDescriptorType_data_( - int descriptorType, objc.NSData? data) { - final _ret = _objc_msgSend_1k5vjgv( - this.ref.retainAndReturnPointer(), - _sel_initWithDescriptorType_data_, - descriptorType, - data?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithEventClass:eventID:targetDescriptor:returnID:transactionID: - NSAppleEventDescriptor - initWithEventClass_eventID_targetDescriptor_returnID_transactionID_( - int eventClass, - int eventID, - NSAppleEventDescriptor? targetDescriptor, - int returnID, - int transactionID) { - final _ret = _objc_msgSend_1iwlq4o( - this.ref.retainAndReturnPointer(), - _sel_initWithEventClass_eventID_targetDescriptor_returnID_transactionID_, - eventClass, - eventID, - targetDescriptor?.ref.pointer ?? ffi.nullptr, - returnID, - transactionID); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initListDescriptor - NSAppleEventDescriptor initListDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - this.ref.retainAndReturnPointer(), _sel_initListDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// initRecordDescriptor - NSAppleEventDescriptor initRecordDescriptor() { - final _ret = _objc_msgSend_1unuoxw( - this.ref.retainAndReturnPointer(), _sel_initRecordDescriptor); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// aeDesc - ffi.Pointer get aeDesc { - return _objc_msgSend_jg6irx(this.ref.pointer, _sel_aeDesc); - } - - /// descriptorType - int get descriptorType { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_descriptorType); - } - - /// data - objc.NSData get data { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); - return objc.NSData.castFromPointer(_ret, retain: true, release: true); - } - - /// booleanValue - int get booleanValue { - return _objc_msgSend_1cswds(this.ref.pointer, _sel_booleanValue); - } - - /// enumCodeValue - int get enumCodeValue { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_enumCodeValue); - } - - /// int32Value - int get int32Value { - return _objc_msgSend_1tf0yjs(this.ref.pointer, _sel_int32Value); - } - - /// doubleValue - double get doubleValue { - return _objc_msgSend_10noklm(this.ref.pointer, _sel_doubleValue); - } - - /// typeCodeValue - int get typeCodeValue { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_typeCodeValue); - } - - /// stringValue - objc.NSString? get stringValue { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_stringValue); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// dateValue - objc.NSDate? get dateValue { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_dateValue); - return _ret.address == 0 - ? null - : objc.NSDate.castFromPointer(_ret, retain: true, release: true); - } - - /// fileURLValue - objc.NSURL? get fileURLValue { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileURLValue); - return _ret.address == 0 - ? null - : objc.NSURL.castFromPointer(_ret, retain: true, release: true); - } - - /// eventClass - int get eventClass { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_eventClass); - } - - /// eventID - int get eventID { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_eventID); - } - - /// returnID - int get returnID { - return _objc_msgSend_157j54x(this.ref.pointer, _sel_returnID); - } - - /// transactionID - int get transactionID { - return _objc_msgSend_1tf0yjs(this.ref.pointer, _sel_transactionID); - } - - /// setParamDescriptor:forKeyword: - void setParamDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _objc_msgSend_1dzwu6(this.ref.pointer, _sel_setParamDescriptor_forKeyword_, - descriptor.ref.pointer, keyword); - } - - /// paramDescriptorForKeyword: - NSAppleEventDescriptor? paramDescriptorForKeyword_(int keyword) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_paramDescriptorForKeyword_, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// removeParamDescriptorWithKeyword: - void removeParamDescriptorWithKeyword_(int keyword) { - _objc_msgSend_l6g8fv( - this.ref.pointer, _sel_removeParamDescriptorWithKeyword_, keyword); - } - - /// setAttributeDescriptor:forKeyword: - void setAttributeDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _objc_msgSend_1dzwu6( - this.ref.pointer, - _sel_setAttributeDescriptor_forKeyword_, - descriptor.ref.pointer, - keyword); - } - - /// attributeDescriptorForKeyword: - NSAppleEventDescriptor? attributeDescriptorForKeyword_(int keyword) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_attributeDescriptorForKeyword_, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// sendEventWithOptions:timeout:error: - NSAppleEventDescriptor? sendEventWithOptions_timeout_error_( - NSAppleEventSendOptions sendOptions, - double timeoutInSeconds, - ffi.Pointer> error) { - final _ret = _objc_msgSend_19xj9w( - this.ref.pointer, - _sel_sendEventWithOptions_timeout_error_, - sendOptions.value, - timeoutInSeconds, - error); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// isRecordDescriptor - bool get isRecordDescriptor { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isRecordDescriptor); - } - - /// numberOfItems - int get numberOfItems { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_numberOfItems); - } - - /// insertDescriptor:atIndex: - void insertDescriptor_atIndex_(NSAppleEventDescriptor descriptor, int index) { - _objc_msgSend_da94db(this.ref.pointer, _sel_insertDescriptor_atIndex_, - descriptor.ref.pointer, index); - } - - /// descriptorAtIndex: - NSAppleEventDescriptor? descriptorAtIndex_(int index) { - final _ret = - _objc_msgSend_crtxa9(this.ref.pointer, _sel_descriptorAtIndex_, index); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// removeDescriptorAtIndex: - void removeDescriptorAtIndex_(int index) { - _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_removeDescriptorAtIndex_, index); - } - - /// setDescriptor:forKeyword: - void setDescriptor_forKeyword_( - NSAppleEventDescriptor descriptor, int keyword) { - _objc_msgSend_1dzwu6(this.ref.pointer, _sel_setDescriptor_forKeyword_, - descriptor.ref.pointer, keyword); - } - - /// descriptorForKeyword: - NSAppleEventDescriptor? descriptorForKeyword_(int keyword) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_descriptorForKeyword_, keyword); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// removeDescriptorWithKeyword: - void removeDescriptorWithKeyword_(int keyword) { - _objc_msgSend_l6g8fv( - this.ref.pointer, _sel_removeDescriptorWithKeyword_, keyword); - } - - /// keywordForDescriptorAtIndex: - int keywordForDescriptorAtIndex_(int index) { - return _objc_msgSend_hkgvph( - this.ref.pointer, _sel_keywordForDescriptorAtIndex_, index); - } - - /// coerceToDescriptorType: - NSAppleEventDescriptor? coerceToDescriptorType_(int descriptorType) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_coerceToDescriptorType_, descriptorType); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// init - NSAppleEventDescriptor init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSAppleEventDescriptor new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSAppleEventDescriptor, _sel_new); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSAppleEventDescriptor allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSAppleEventDescriptor, _sel_allocWithZone_, zone); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSAppleEventDescriptor alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSAppleEventDescriptor, _sel_alloc); - return NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSAppleEventDescriptor, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSAppleEventDescriptor, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSAppleEventDescriptor, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSAppleEventDescriptor, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSAppleEventDescriptor, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSAppleEventDescriptor, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSAppleEventDescriptor, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSAppleEventDescriptor, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// supportsSecureCoding - static bool supportsSecureCoding() { - return _objc_msgSend_olxnu1( - _class_NSAppleEventDescriptor, _sel_supportsSecureCoding); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } - - /// initWithCoder: - NSAppleEventDescriptor? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: false, release: true); - } -} - -late final _class_NSClassDescription = objc.getClass("NSClassDescription"); -late final _sel_registerClassDescription_forClass_ = - objc.registerName("registerClassDescription:forClass:"); -late final _sel_invalidateClassDescriptionCache = - objc.registerName("invalidateClassDescriptionCache"); -late final _sel_classDescriptionForClass_ = - objc.registerName("classDescriptionForClass:"); -late final _sel_attributeKeys = objc.registerName("attributeKeys"); -late final _sel_toOneRelationshipKeys = - objc.registerName("toOneRelationshipKeys"); -late final _sel_toManyRelationshipKeys = - objc.registerName("toManyRelationshipKeys"); -late final _sel_inverseForRelationshipKey_ = - objc.registerName("inverseForRelationshipKey:"); - -/// NSClassDescription -class NSClassDescription extends objc.NSObject { - NSClassDescription._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSClassDescription] that points to the same underlying object as [other]. - NSClassDescription.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSClassDescription] that wraps the given raw object pointer. - NSClassDescription.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSClassDescription]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSClassDescription); - } - - /// registerClassDescription:forClass: - static void registerClassDescription_forClass_( - NSClassDescription description, objc.ObjCObjectBase aClass) { - _objc_msgSend_1tjlcwl( - _class_NSClassDescription, - _sel_registerClassDescription_forClass_, - description.ref.pointer, - aClass.ref.pointer); - } - - /// invalidateClassDescriptionCache - static void invalidateClassDescriptionCache() { - _objc_msgSend_ksby9f( - _class_NSClassDescription, _sel_invalidateClassDescriptionCache); - } - - /// classDescriptionForClass: - static NSClassDescription? classDescriptionForClass_( - objc.ObjCObjectBase aClass) { - final _ret = _objc_msgSend_juohf7(_class_NSClassDescription, - _sel_classDescriptionForClass_, aClass.ref.pointer); - return _ret.address == 0 - ? null - : NSClassDescription.castFromPointer(_ret, retain: true, release: true); - } - - /// attributeKeys - objc.NSArray get attributeKeys { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_attributeKeys); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// toOneRelationshipKeys - objc.NSArray get toOneRelationshipKeys { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_toOneRelationshipKeys); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// toManyRelationshipKeys - objc.NSArray get toManyRelationshipKeys { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_toManyRelationshipKeys); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// inverseForRelationshipKey: - objc.NSString? inverseForRelationshipKey_(objc.NSString relationshipKey) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_inverseForRelationshipKey_, relationshipKey.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// init - NSClassDescription init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSClassDescription new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSClassDescription, _sel_new); - return NSClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSClassDescription allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSClassDescription, _sel_allocWithZone_, zone); - return NSClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSClassDescription alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSClassDescription, _sel_alloc); - return NSClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSClassDescription, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSClassDescription, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSClassDescription, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSClassDescription, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSClassDescription, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSClassDescription, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSClassDescription, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSClassDescription, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSClassDescription, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } -} - -late final _class_NSScriptClassDescription = - objc.getClass("NSScriptClassDescription"); -late final _sel_initWithSuiteName_className_dictionary_ = - objc.registerName("initWithSuiteName:className:dictionary:"); -late final _sel_suiteName = objc.registerName("suiteName"); -late final _sel_className = objc.registerName("className"); -late final _sel_implementationClassName = - objc.registerName("implementationClassName"); -late final _sel_superclassDescription = - objc.registerName("superclassDescription"); -late final _sel_appleEventCode = objc.registerName("appleEventCode"); -late final _sel_matchesAppleEventCode_ = - objc.registerName("matchesAppleEventCode:"); -final _objc_msgSend_1n8vqu1 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, int)>(); -late final _class_NSScriptCommandDescription = - objc.getClass("NSScriptCommandDescription"); -late final _sel_initWithSuiteName_commandName_dictionary_ = - objc.registerName("initWithSuiteName:commandName:dictionary:"); -late final _sel_commandName = objc.registerName("commandName"); -late final _sel_appleEventClassCode = objc.registerName("appleEventClassCode"); -late final _sel_commandClassName = objc.registerName("commandClassName"); -late final _sel_returnType = objc.registerName("returnType"); -late final _sel_appleEventCodeForReturnType = - objc.registerName("appleEventCodeForReturnType"); -late final _sel_argumentNames = objc.registerName("argumentNames"); -late final _sel_typeForArgumentWithName_ = - objc.registerName("typeForArgumentWithName:"); -late final _sel_appleEventCodeForArgumentWithName_ = - objc.registerName("appleEventCodeForArgumentWithName:"); -final _objc_msgSend_t2sarz = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.UnsignedInt Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); -late final _sel_isOptionalArgumentWithName_ = - objc.registerName("isOptionalArgumentWithName:"); -late final _class_NSScriptCommand = objc.getClass("NSScriptCommand"); -late final _sel_initWithCommandDescription_ = - objc.registerName("initWithCommandDescription:"); -late final _sel_commandDescription = objc.registerName("commandDescription"); -late final _sel_directParameter = objc.registerName("directParameter"); -late final _sel_setDirectParameter_ = objc.registerName("setDirectParameter:"); -late final _class_NSScriptObjectSpecifier = - objc.getClass("NSScriptObjectSpecifier"); -late final _sel_objectSpecifierWithDescriptor_ = - objc.registerName("objectSpecifierWithDescriptor:"); -late final _sel_initWithContainerSpecifier_key_ = - objc.registerName("initWithContainerSpecifier:key:"); -late final _sel_initWithContainerClassDescription_containerSpecifier_key_ = objc - .registerName("initWithContainerClassDescription:containerSpecifier:key:"); -late final _sel_childSpecifier = objc.registerName("childSpecifier"); -late final _sel_setChildSpecifier_ = objc.registerName("setChildSpecifier:"); -late final _sel_containerSpecifier = objc.registerName("containerSpecifier"); -late final _sel_setContainerSpecifier_ = - objc.registerName("setContainerSpecifier:"); -late final _sel_containerIsObjectBeingTested = - objc.registerName("containerIsObjectBeingTested"); -late final _sel_setContainerIsObjectBeingTested_ = - objc.registerName("setContainerIsObjectBeingTested:"); -late final _sel_containerIsRangeContainerObject = - objc.registerName("containerIsRangeContainerObject"); -late final _sel_setContainerIsRangeContainerObject_ = - objc.registerName("setContainerIsRangeContainerObject:"); -late final _sel_key = objc.registerName("key"); -late final _sel_setKey_ = objc.registerName("setKey:"); -late final _sel_containerClassDescription = - objc.registerName("containerClassDescription"); -late final _sel_setContainerClassDescription_ = - objc.registerName("setContainerClassDescription:"); -late final _sel_keyClassDescription = objc.registerName("keyClassDescription"); -late final _sel_indicesOfObjectsByEvaluatingWithContainer_count_ = - objc.registerName("indicesOfObjectsByEvaluatingWithContainer:count:"); -final _objc_msgSend_1e2yezv = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -late final _sel_objectsByEvaluatingWithContainers_ = - objc.registerName("objectsByEvaluatingWithContainers:"); -late final _sel_objectsByEvaluatingSpecifier = - objc.registerName("objectsByEvaluatingSpecifier"); -late final _sel_evaluationErrorNumber = - objc.registerName("evaluationErrorNumber"); -late final _sel_setEvaluationErrorNumber_ = - objc.registerName("setEvaluationErrorNumber:"); -late final _sel_evaluationErrorSpecifier = - objc.registerName("evaluationErrorSpecifier"); -late final _sel_descriptor = objc.registerName("descriptor"); - -/// NSScriptObjectSpecifier -class NSScriptObjectSpecifier extends objc.NSObject { - NSScriptObjectSpecifier._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSScriptObjectSpecifier] that points to the same underlying object as [other]. - NSScriptObjectSpecifier.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSScriptObjectSpecifier] that wraps the given raw object pointer. - NSScriptObjectSpecifier.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSScriptObjectSpecifier]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSScriptObjectSpecifier); - } - - /// objectSpecifierWithDescriptor: - static NSScriptObjectSpecifier? objectSpecifierWithDescriptor_( - NSAppleEventDescriptor descriptor) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptObjectSpecifier, - _sel_objectSpecifierWithDescriptor_, descriptor.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// initWithContainerSpecifier:key: - NSScriptObjectSpecifier initWithContainerSpecifier_key_( - NSScriptObjectSpecifier container, objc.NSString property) { - final _ret = _objc_msgSend_iq11qg( - this.ref.retainAndReturnPointer(), - _sel_initWithContainerSpecifier_key_, - container.ref.pointer, - property.ref.pointer); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithContainerClassDescription:containerSpecifier:key: - NSScriptObjectSpecifier - initWithContainerClassDescription_containerSpecifier_key_( - NSScriptClassDescription classDesc, - NSScriptObjectSpecifier? container, - objc.NSString property) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithContainerClassDescription_containerSpecifier_key_, - classDesc.ref.pointer, - container?.ref.pointer ?? ffi.nullptr, - property.ref.pointer); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithCoder: - NSScriptObjectSpecifier? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// childSpecifier - NSScriptObjectSpecifier? get childSpecifier { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_childSpecifier); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// setChildSpecifier: - set childSpecifier(NSScriptObjectSpecifier? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setChildSpecifier_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// containerSpecifier - NSScriptObjectSpecifier? get containerSpecifier { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_containerSpecifier); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// setContainerSpecifier: - set containerSpecifier(NSScriptObjectSpecifier? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setContainerSpecifier_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// containerIsObjectBeingTested - bool get containerIsObjectBeingTested { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_containerIsObjectBeingTested); - } - - /// setContainerIsObjectBeingTested: - set containerIsObjectBeingTested(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setContainerIsObjectBeingTested_, value); - } - - /// containerIsRangeContainerObject - bool get containerIsRangeContainerObject { - return _objc_msgSend_olxnu1( - this.ref.pointer, _sel_containerIsRangeContainerObject); - } - - /// setContainerIsRangeContainerObject: - set containerIsRangeContainerObject(bool value) { - return _objc_msgSend_117qins( - this.ref.pointer, _sel_setContainerIsRangeContainerObject_, value); - } - - /// key - objc.NSString get key { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_key); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setKey: - set key(objc.NSString value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_setKey_, value.ref.pointer); - } - - /// containerClassDescription - NSScriptClassDescription? get containerClassDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_containerClassDescription); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// setContainerClassDescription: - set containerClassDescription(NSScriptClassDescription? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, - _sel_setContainerClassDescription_, value?.ref.pointer ?? ffi.nullptr); - } - - /// keyClassDescription - NSScriptClassDescription? get keyClassDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_keyClassDescription); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// indicesOfObjectsByEvaluatingWithContainer:count: - ffi.Pointer indicesOfObjectsByEvaluatingWithContainer_count_( - objc.ObjCObjectBase container, ffi.Pointer count) { - return _objc_msgSend_1e2yezv( - this.ref.pointer, - _sel_indicesOfObjectsByEvaluatingWithContainer_count_, - container.ref.pointer, - count); - } - - /// objectsByEvaluatingWithContainers: - objc.ObjCObjectBase? objectsByEvaluatingWithContainers_( - objc.ObjCObjectBase containers) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_objectsByEvaluatingWithContainers_, containers.ref.pointer); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// objectsByEvaluatingSpecifier - objc.ObjCObjectBase? get objectsByEvaluatingSpecifier { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_objectsByEvaluatingSpecifier); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// evaluationErrorNumber - int get evaluationErrorNumber { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_evaluationErrorNumber); - } - - /// setEvaluationErrorNumber: - set evaluationErrorNumber(int value) { - return _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_setEvaluationErrorNumber_, value); - } - - /// evaluationErrorSpecifier - NSScriptObjectSpecifier? get evaluationErrorSpecifier { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_evaluationErrorSpecifier); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// descriptor - NSAppleEventDescriptor? get descriptor { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_descriptor); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// init - NSScriptObjectSpecifier init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSScriptObjectSpecifier new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptObjectSpecifier, _sel_new); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSScriptObjectSpecifier allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSScriptObjectSpecifier, _sel_allocWithZone_, zone); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSScriptObjectSpecifier alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptObjectSpecifier, _sel_alloc); - return NSScriptObjectSpecifier.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSScriptObjectSpecifier, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSScriptObjectSpecifier, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSScriptObjectSpecifier, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSScriptObjectSpecifier, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptObjectSpecifier, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSScriptObjectSpecifier, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSScriptObjectSpecifier, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptObjectSpecifier, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptObjectSpecifier, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _sel_receiversSpecifier = objc.registerName("receiversSpecifier"); -late final _sel_setReceiversSpecifier_ = - objc.registerName("setReceiversSpecifier:"); -late final _sel_evaluatedReceivers = objc.registerName("evaluatedReceivers"); -late final _sel_arguments = objc.registerName("arguments"); -late final _sel_setArguments_ = objc.registerName("setArguments:"); -late final _sel_evaluatedArguments = objc.registerName("evaluatedArguments"); -late final _sel_isWellFormed = objc.registerName("isWellFormed"); -late final _sel_performDefaultImplementation = - objc.registerName("performDefaultImplementation"); -late final _sel_executeCommand = objc.registerName("executeCommand"); -late final _sel_scriptErrorNumber = objc.registerName("scriptErrorNumber"); -late final _sel_setScriptErrorNumber_ = - objc.registerName("setScriptErrorNumber:"); -late final _sel_scriptErrorOffendingObjectDescriptor = - objc.registerName("scriptErrorOffendingObjectDescriptor"); -late final _sel_setScriptErrorOffendingObjectDescriptor_ = - objc.registerName("setScriptErrorOffendingObjectDescriptor:"); -late final _sel_scriptErrorExpectedTypeDescriptor = - objc.registerName("scriptErrorExpectedTypeDescriptor"); -late final _sel_setScriptErrorExpectedTypeDescriptor_ = - objc.registerName("setScriptErrorExpectedTypeDescriptor:"); -late final _sel_scriptErrorString = objc.registerName("scriptErrorString"); -late final _sel_setScriptErrorString_ = - objc.registerName("setScriptErrorString:"); -late final _sel_currentCommand = objc.registerName("currentCommand"); -late final _sel_appleEvent = objc.registerName("appleEvent"); -late final _sel_suspendExecution = objc.registerName("suspendExecution"); -late final _sel_resumeExecutionWithResult_ = - objc.registerName("resumeExecutionWithResult:"); - -/// NSScriptCommand -class NSScriptCommand extends objc.NSObject { - NSScriptCommand._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSScriptCommand] that points to the same underlying object as [other]. - NSScriptCommand.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSScriptCommand] that wraps the given raw object pointer. - NSScriptCommand.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSScriptCommand]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSScriptCommand); - } - - /// initWithCommandDescription: - NSScriptCommand initWithCommandDescription_( - NSScriptCommandDescription commandDef) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCommandDescription_, commandDef.ref.pointer); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// initWithCoder: - NSScriptCommand? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// commandDescription - NSScriptCommandDescription get commandDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_commandDescription); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// directParameter - objc.ObjCObjectBase? get directParameter { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_directParameter); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// setDirectParameter: - set directParameter(objc.ObjCObjectBase? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setDirectParameter_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// receiversSpecifier - NSScriptObjectSpecifier? get receiversSpecifier { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_receiversSpecifier); - return _ret.address == 0 - ? null - : NSScriptObjectSpecifier.castFromPointer(_ret, - retain: true, release: true); - } - - /// setReceiversSpecifier: - set receiversSpecifier(NSScriptObjectSpecifier? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setReceiversSpecifier_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// evaluatedReceivers - objc.ObjCObjectBase? get evaluatedReceivers { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_evaluatedReceivers); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// arguments - objc.NSDictionary? get arguments { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_arguments); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// setArguments: - set arguments(objc.NSDictionary? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setArguments_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// evaluatedArguments - objc.NSDictionary? get evaluatedArguments { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_evaluatedArguments); - return _ret.address == 0 - ? null - : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); - } - - /// isWellFormed - bool get wellFormed { - return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isWellFormed); - } - - /// performDefaultImplementation - objc.ObjCObjectBase? performDefaultImplementation() { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_performDefaultImplementation); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// executeCommand - objc.ObjCObjectBase? executeCommand() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_executeCommand); - return _ret.address == 0 - ? null - : objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// scriptErrorNumber - int get scriptErrorNumber { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_scriptErrorNumber); - } - - /// setScriptErrorNumber: - set scriptErrorNumber(int value) { - return _objc_msgSend_ke7qz2( - this.ref.pointer, _sel_setScriptErrorNumber_, value); - } - - /// scriptErrorOffendingObjectDescriptor - NSAppleEventDescriptor? get scriptErrorOffendingObjectDescriptor { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_scriptErrorOffendingObjectDescriptor); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// setScriptErrorOffendingObjectDescriptor: - set scriptErrorOffendingObjectDescriptor(NSAppleEventDescriptor? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, - _sel_setScriptErrorOffendingObjectDescriptor_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// scriptErrorExpectedTypeDescriptor - NSAppleEventDescriptor? get scriptErrorExpectedTypeDescriptor { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_scriptErrorExpectedTypeDescriptor); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// setScriptErrorExpectedTypeDescriptor: - set scriptErrorExpectedTypeDescriptor(NSAppleEventDescriptor? value) { - return _objc_msgSend_ukcdfq( - this.ref.pointer, - _sel_setScriptErrorExpectedTypeDescriptor_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// scriptErrorString - objc.NSString? get scriptErrorString { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_scriptErrorString); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// setScriptErrorString: - set scriptErrorString(objc.NSString? value) { - return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setScriptErrorString_, - value?.ref.pointer ?? ffi.nullptr); - } - - /// currentCommand - static NSScriptCommand? currentCommand() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptCommand, _sel_currentCommand); - return _ret.address == 0 - ? null - : NSScriptCommand.castFromPointer(_ret, retain: true, release: true); - } - - /// appleEvent - NSAppleEventDescriptor? get appleEvent { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_appleEvent); - return _ret.address == 0 - ? null - : NSAppleEventDescriptor.castFromPointer(_ret, - retain: true, release: true); - } - - /// suspendExecution - void suspendExecution() { - _objc_msgSend_ksby9f(this.ref.pointer, _sel_suspendExecution); - } - - /// resumeExecutionWithResult: - void resumeExecutionWithResult_(objc.ObjCObjectBase? result) { - _objc_msgSend_ukcdfq(this.ref.pointer, _sel_resumeExecutionWithResult_, - result?.ref.pointer ?? ffi.nullptr); - } - - /// init - NSScriptCommand init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// new - static NSScriptCommand new1() { - final _ret = _objc_msgSend_1unuoxw(_class_NSScriptCommand, _sel_new); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// allocWithZone: - static NSScriptCommand allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSScriptCommand, _sel_allocWithZone_, zone); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// alloc - static NSScriptCommand alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_NSScriptCommand, _sel_alloc); - return NSScriptCommand.castFromPointer(_ret, retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSScriptCommand, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSScriptCommand, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSScriptCommand, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_NSScriptCommand, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptCommand, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSScriptCommand, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSScriptCommand, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptCommand, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptCommand, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} - -late final _sel_createCommandInstance = - objc.registerName("createCommandInstance"); -late final _sel_createCommandInstanceWithZone_ = - objc.registerName("createCommandInstanceWithZone:"); - -/// NSScriptCommandDescription -class NSScriptCommandDescription extends objc.NSObject { - NSScriptCommandDescription._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSScriptCommandDescription] that points to the same underlying object as [other]. - NSScriptCommandDescription.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSScriptCommandDescription] that wraps the given raw object pointer. - NSScriptCommandDescription.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSScriptCommandDescription]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg(obj.ref.pointer, _sel_isKindOfClass_, - _class_NSScriptCommandDescription); - } - - /// init - NSScriptCommandDescription init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithSuiteName:commandName:dictionary: - NSScriptCommandDescription? initWithSuiteName_commandName_dictionary_( - objc.NSString suiteName, - objc.NSString commandName, - objc.NSDictionary? commandDeclaration) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithSuiteName_commandName_dictionary_, - suiteName.ref.pointer, - commandName.ref.pointer, - commandDeclaration?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// initWithCoder: - NSScriptCommandDescription? initWithCoder_(objc.NSCoder coder) { - final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), - _sel_initWithCoder_, coder.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// suiteName - objc.NSString get suiteName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_suiteName); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// commandName - objc.NSString get commandName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_commandName); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// appleEventClassCode - int get appleEventClassCode { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_appleEventClassCode); - } - - /// appleEventCode - int get appleEventCode { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_appleEventCode); - } - - /// commandClassName - objc.NSString get commandClassName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_commandClassName); - return objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// returnType - objc.NSString? get returnType { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_returnType); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// appleEventCodeForReturnType - int get appleEventCodeForReturnType { - return _objc_msgSend_dzloj4( - this.ref.pointer, _sel_appleEventCodeForReturnType); - } - - /// argumentNames - objc.NSArray get argumentNames { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_argumentNames); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// typeForArgumentWithName: - objc.NSString? typeForArgumentWithName_(objc.NSString argumentName) { - final _ret = _objc_msgSend_juohf7(this.ref.pointer, - _sel_typeForArgumentWithName_, argumentName.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// appleEventCodeForArgumentWithName: - int appleEventCodeForArgumentWithName_(objc.NSString argumentName) { - return _objc_msgSend_t2sarz(this.ref.pointer, - _sel_appleEventCodeForArgumentWithName_, argumentName.ref.pointer); - } - - /// isOptionalArgumentWithName: - bool isOptionalArgumentWithName_(objc.NSString argumentName) { - return _objc_msgSend_l8lotg(this.ref.pointer, - _sel_isOptionalArgumentWithName_, argumentName.ref.pointer); - } - - /// createCommandInstance - NSScriptCommand createCommandInstance() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_createCommandInstance); - return NSScriptCommand.castFromPointer(_ret, retain: true, release: true); - } - - /// createCommandInstanceWithZone: - NSScriptCommand createCommandInstanceWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - this.ref.pointer, _sel_createCommandInstanceWithZone_, zone); - return NSScriptCommand.castFromPointer(_ret, retain: true, release: true); - } - - /// new - static NSScriptCommandDescription new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptCommandDescription, _sel_new); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSScriptCommandDescription allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSScriptCommandDescription, _sel_allocWithZone_, zone); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSScriptCommandDescription alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptCommandDescription, _sel_alloc); - return NSScriptCommandDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSScriptCommandDescription, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSScriptCommandDescription, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1(_class_NSScriptCommandDescription, - _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSScriptCommandDescription, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptCommandDescription, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSScriptCommandDescription, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSScriptCommandDescription, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptCommandDescription, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptCommandDescription, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - - /// encodeWithCoder: - void encodeWithCoder_(objc.NSCoder coder) { - _objc_msgSend_ukcdfq( - this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - } -} +final class _NSZone extends ffi.Opaque {} -late final _sel_supportsCommand_ = objc.registerName("supportsCommand:"); -late final _sel_selectorForCommand_ = objc.registerName("selectorForCommand:"); -final _objc_msgSend_12vuupl = objc.msgSendPointer +late final _class_SwiftClass = objc.getClass("swift_module.SwiftClass"); +late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); +final _objc_msgSend_69e0x1 = objc.msgSendPointer .cast< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Bool Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>>() .asFunction< - ffi.Pointer Function(ffi.Pointer, + bool Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); -late final _sel_typeForKey_ = objc.registerName("typeForKey:"); -late final _sel_classDescriptionForKey_ = - objc.registerName("classDescriptionForKey:"); -late final _sel_appleEventCodeForKey_ = - objc.registerName("appleEventCodeForKey:"); -late final _sel_keyWithAppleEventCode_ = - objc.registerName("keyWithAppleEventCode:"); -late final _sel_defaultSubcontainerAttributeKey = - objc.registerName("defaultSubcontainerAttributeKey"); -late final _sel_isLocationRequiredToCreateForKey_ = - objc.registerName("isLocationRequiredToCreateForKey:"); -late final _sel_hasPropertyForKey_ = objc.registerName("hasPropertyForKey:"); -late final _sel_hasOrderedToManyRelationshipForKey_ = - objc.registerName("hasOrderedToManyRelationshipForKey:"); -late final _sel_hasReadablePropertyForKey_ = - objc.registerName("hasReadablePropertyForKey:"); -late final _sel_hasWritablePropertyForKey_ = - objc.registerName("hasWritablePropertyForKey:"); -late final _sel_isReadOnlyKey_ = objc.registerName("isReadOnlyKey:"); - -/// NSScriptClassDescription -class NSScriptClassDescription extends NSClassDescription { - NSScriptClassDescription._(ffi.Pointer pointer, - {bool retain = false, bool release = false}) - : super.castFromPointer(pointer, retain: retain, release: release); - - /// Constructs a [NSScriptClassDescription] that points to the same underlying object as [other]. - NSScriptClassDescription.castFrom(objc.ObjCObjectBase other) - : this._(other.ref.pointer, retain: true, release: true); - - /// Constructs a [NSScriptClassDescription] that wraps the given raw object pointer. - NSScriptClassDescription.castFromPointer(ffi.Pointer other, - {bool retain = false, bool release = false}) - : this._(other, retain: retain, release: release); - - /// Returns whether [obj] is an instance of [NSScriptClassDescription]. - static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( - obj.ref.pointer, _sel_isKindOfClass_, _class_NSScriptClassDescription); - } - - /// classDescriptionForClass: - static NSClassDescription? classDescriptionForClass_( - objc.ObjCObjectBase aClass) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptClassDescription, - _sel_classDescriptionForClass_, aClass.ref.pointer); - return _ret.address == 0 - ? null - : NSClassDescription.castFromPointer(_ret, retain: true, release: true); - } - - /// initWithSuiteName:className:dictionary: - NSScriptClassDescription? initWithSuiteName_className_dictionary_( - objc.NSString suiteName, - objc.NSString className, - objc.NSDictionary? classDeclaration) { - final _ret = _objc_msgSend_aud7dn( - this.ref.retainAndReturnPointer(), - _sel_initWithSuiteName_className_dictionary_, - suiteName.ref.pointer, - className.ref.pointer, - classDeclaration?.ref.pointer ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// suiteName - objc.NSString? get suiteName { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_suiteName); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// className - objc.NSString? get className { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_className); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// implementationClassName - objc.NSString? get implementationClassName { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_implementationClassName); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// superclassDescription - NSScriptClassDescription? get superclassDescription { - final _ret = - _objc_msgSend_1unuoxw(this.ref.pointer, _sel_superclassDescription); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// appleEventCode - int get appleEventCode { - return _objc_msgSend_dzloj4(this.ref.pointer, _sel_appleEventCode); - } - - /// matchesAppleEventCode: - bool matchesAppleEventCode_(int appleEventCode) { - return _objc_msgSend_1n8vqu1( - this.ref.pointer, _sel_matchesAppleEventCode_, appleEventCode); - } - - /// supportsCommand: - bool supportsCommand_(NSScriptCommandDescription commandDescription) { - return _objc_msgSend_l8lotg(this.ref.pointer, _sel_supportsCommand_, - commandDescription.ref.pointer); - } - - /// selectorForCommand: - ffi.Pointer selectorForCommand_( - NSScriptCommandDescription commandDescription) { - return _objc_msgSend_12vuupl(this.ref.pointer, _sel_selectorForCommand_, - commandDescription.ref.pointer); - } - - /// typeForKey: - objc.NSString? typeForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_typeForKey_, key.ref.pointer); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// classDescriptionForKey: - NSScriptClassDescription? classDescriptionForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7( - this.ref.pointer, _sel_classDescriptionForKey_, key.ref.pointer); - return _ret.address == 0 - ? null - : NSScriptClassDescription.castFromPointer(_ret, - retain: true, release: true); - } - - /// appleEventCodeForKey: - int appleEventCodeForKey_(objc.NSString key) { - return _objc_msgSend_t2sarz( - this.ref.pointer, _sel_appleEventCodeForKey_, key.ref.pointer); - } - - /// keyWithAppleEventCode: - objc.NSString? keyWithAppleEventCode_(int appleEventCode) { - final _ret = _objc_msgSend_pxgym4( - this.ref.pointer, _sel_keyWithAppleEventCode_, appleEventCode); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// defaultSubcontainerAttributeKey - objc.NSString? get defaultSubcontainerAttributeKey { - final _ret = _objc_msgSend_1unuoxw( - this.ref.pointer, _sel_defaultSubcontainerAttributeKey); - return _ret.address == 0 - ? null - : objc.NSString.castFromPointer(_ret, retain: true, release: true); - } - - /// isLocationRequiredToCreateForKey: - bool isLocationRequiredToCreateForKey_(objc.NSString toManyRelationshipKey) { - return _objc_msgSend_l8lotg( - this.ref.pointer, - _sel_isLocationRequiredToCreateForKey_, - toManyRelationshipKey.ref.pointer); - } - - /// hasPropertyForKey: - bool hasPropertyForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_hasPropertyForKey_, key.ref.pointer); - } - - /// hasOrderedToManyRelationshipForKey: - bool hasOrderedToManyRelationshipForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(this.ref.pointer, - _sel_hasOrderedToManyRelationshipForKey_, key.ref.pointer); - } - - /// hasReadablePropertyForKey: - bool hasReadablePropertyForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_hasReadablePropertyForKey_, key.ref.pointer); - } - - /// hasWritablePropertyForKey: - bool hasWritablePropertyForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_hasWritablePropertyForKey_, key.ref.pointer); - } - - /// isReadOnlyKey: - bool isReadOnlyKey_(objc.NSString key) { - return _objc_msgSend_l8lotg( - this.ref.pointer, _sel_isReadOnlyKey_, key.ref.pointer); - } - - /// registerClassDescription:forClass: - static void registerClassDescription_forClass_( - NSClassDescription description, objc.ObjCObjectBase aClass) { - _objc_msgSend_1tjlcwl( - _class_NSScriptClassDescription, - _sel_registerClassDescription_forClass_, - description.ref.pointer, - aClass.ref.pointer); - } - - /// invalidateClassDescriptionCache - static void invalidateClassDescriptionCache() { - _objc_msgSend_ksby9f( - _class_NSScriptClassDescription, _sel_invalidateClassDescriptionCache); - } - - /// init - NSScriptClassDescription init() { - final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); - return NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// new - static NSScriptClassDescription new1() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptClassDescription, _sel_new); - return NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// allocWithZone: - static NSScriptClassDescription allocWithZone_(ffi.Pointer<_NSZone> zone) { - final _ret = _objc_msgSend_1b3ihd0( - _class_NSScriptClassDescription, _sel_allocWithZone_, zone); - return NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// alloc - static NSScriptClassDescription alloc() { - final _ret = - _objc_msgSend_1unuoxw(_class_NSScriptClassDescription, _sel_alloc); - return NSScriptClassDescription.castFromPointer(_ret, - retain: false, release: true); - } - - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_NSScriptClassDescription, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_NSScriptClassDescription, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_NSScriptClassDescription, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1( - _class_NSScriptClassDescription, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_NSScriptClassDescription, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } +late final _sel_sayHello = objc.registerName("sayHello"); +final _objc_msgSend_1x359cv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_someField = objc.registerName("someField"); +final _objc_msgSend_1hz7y9r = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setSomeField_ = objc.registerName("setSomeField:"); +final _objc_msgSend_4sp4xj = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Long)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +typedef instancetype = ffi.Pointer; +typedef Dartinstancetype = objc.ObjCObjectBase; +late final _sel_init = objc.registerName("init"); +late final _sel_new = objc.registerName("new"); +late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); +final _objc_msgSend_hzlb60 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); +late final _sel_alloc = objc.registerName("alloc"); +late final _sel_self = objc.registerName("self"); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) + .cast(); - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_NSScriptClassDescription, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock Function(ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer)>( + pointer, + retain: retain, + release: release); - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_NSScriptClassDescription, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } + /// Creates a block from a C function pointer. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc.ObjCBlock Function(ffi.Pointer)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock Function(ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptClassDescription, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } + /// Creates a block from a Dart function. + /// + /// This block must be invoked by native code running on the same thread as + /// the isolate that registered it. Invoking the block on the wrong thread + /// will result in a crash. + static objc + .ObjCBlock Function(ffi.Pointer)> + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_NSScriptClassDescription, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension on objc + .ObjCBlock Function(ffi.Pointer)> { + objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); } -late final _class_SwiftClass = objc.getClass("swift_module.SwiftClass"); -late final _sel_sayHello = objc.registerName("sayHello"); -late final _sel_someField = objc.registerName("someField"); -late final _sel_setSomeField_ = objc.registerName("setSomeField:"); +late final _sel_retain = objc.registerName("retain"); +late final _sel_autorelease = objc.registerName("autorelease"); /// SwiftClass class SwiftClass extends objc.NSObject { @@ -11207,135 +186,67 @@ class SwiftClass extends objc.NSObject { /// Returns whether [obj] is an instance of [SwiftClass]. static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_l8lotg( + return _objc_msgSend_69e0x1( obj.ref.pointer, _sel_isKindOfClass_, _class_SwiftClass); } /// sayHello objc.NSString sayHello() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_sayHello); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_sayHello); return objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// someField int get someField { - return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_someField); + return _objc_msgSend_1hz7y9r(this.ref.pointer, _sel_someField); } /// setSomeField: set someField(int value) { - return _objc_msgSend_ke7qz2(this.ref.pointer, _sel_setSomeField_, value); + return _objc_msgSend_4sp4xj(this.ref.pointer, _sel_setSomeField_, value); } /// init SwiftClass init() { final _ret = - _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + _objc_msgSend_1x359cv(this.ref.retainAndReturnPointer(), _sel_init); return SwiftClass.castFromPointer(_ret, retain: false, release: true); } /// new static SwiftClass new1() { - final _ret = _objc_msgSend_1unuoxw(_class_SwiftClass, _sel_new); + final _ret = _objc_msgSend_1x359cv(_class_SwiftClass, _sel_new); return SwiftClass.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: static SwiftClass allocWithZone_(ffi.Pointer<_NSZone> zone) { final _ret = - _objc_msgSend_1b3ihd0(_class_SwiftClass, _sel_allocWithZone_, zone); + _objc_msgSend_hzlb60(_class_SwiftClass, _sel_allocWithZone_, zone); return SwiftClass.castFromPointer(_ret, retain: false, release: true); } /// alloc static SwiftClass alloc() { - final _ret = _objc_msgSend_1unuoxw(_class_SwiftClass, _sel_alloc); + final _ret = _objc_msgSend_1x359cv(_class_SwiftClass, _sel_alloc); return SwiftClass.castFromPointer(_ret, retain: false, release: true); } - /// cancelPreviousPerformRequestsWithTarget:selector:object: - static void cancelPreviousPerformRequestsWithTarget_selector_object_( - objc.ObjCObjectBase aTarget, - ffi.Pointer aSelector, - objc.ObjCObjectBase? anArgument) { - _objc_msgSend_1587kfn( - _class_SwiftClass, - _sel_cancelPreviousPerformRequestsWithTarget_selector_object_, - aTarget.ref.pointer, - aSelector, - anArgument?.ref.pointer ?? ffi.nullptr); - } - - /// cancelPreviousPerformRequestsWithTarget: - static void cancelPreviousPerformRequestsWithTarget_( - objc.ObjCObjectBase aTarget) { - _objc_msgSend_ukcdfq(_class_SwiftClass, - _sel_cancelPreviousPerformRequestsWithTarget_, aTarget.ref.pointer); - } - - /// accessInstanceVariablesDirectly - static bool getAccessInstanceVariablesDirectly() { - return _objc_msgSend_olxnu1( - _class_SwiftClass, _sel_accessInstanceVariablesDirectly); - } - - /// useStoredAccessor - static bool useStoredAccessor() { - return _objc_msgSend_olxnu1(_class_SwiftClass, _sel_useStoredAccessor); - } - - /// keyPathsForValuesAffectingValueForKey: - static objc.NSSet keyPathsForValuesAffectingValueForKey_(objc.NSString key) { - final _ret = _objc_msgSend_juohf7(_class_SwiftClass, - _sel_keyPathsForValuesAffectingValueForKey_, key.ref.pointer); - return objc.NSSet.castFromPointer(_ret, retain: true, release: true); - } - - /// automaticallyNotifiesObserversForKey: - static bool automaticallyNotifiesObserversForKey_(objc.NSString key) { - return _objc_msgSend_l8lotg(_class_SwiftClass, - _sel_automaticallyNotifiesObserversForKey_, key.ref.pointer); - } - - /// setKeys:triggerChangeNotificationsForDependentKey: - static void setKeys_triggerChangeNotificationsForDependentKey_( - objc.NSArray keys, objc.NSString dependentKey) { - _objc_msgSend_1tjlcwl( - _class_SwiftClass, - _sel_setKeys_triggerChangeNotificationsForDependentKey_, - keys.ref.pointer, - dependentKey.ref.pointer); - } - - /// classFallbacksForKeyedArchiver - static objc.NSArray classFallbacksForKeyedArchiver() { - final _ret = _objc_msgSend_1unuoxw( - _class_SwiftClass, _sel_classFallbacksForKeyedArchiver); - return objc.NSArray.castFromPointer(_ret, retain: true, release: true); - } - - /// classForKeyedUnarchiver - static objc.ObjCObjectBase classForKeyedUnarchiver() { - final _ret = - _objc_msgSend_1unuoxw(_class_SwiftClass, _sel_classForKeyedUnarchiver); - return objc.ObjCObjectBase(_ret, retain: true, release: true); - } - /// self SwiftClass self() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_self); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_self); return SwiftClass.castFromPointer(_ret, retain: true, release: true); } /// retain SwiftClass retain() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_retain); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_retain); return SwiftClass.castFromPointer(_ret, retain: true, release: true); } /// autorelease SwiftClass autorelease() { - final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_autorelease); + final _ret = _objc_msgSend_1x359cv(this.ref.pointer, _sel_autorelease); return SwiftClass.castFromPointer(_ret, retain: true, release: true); } } diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart.m b/pkgs/ffigen/example/swift/swift_api_bindings.dart.m deleted file mode 100644 index bf7aea973..000000000 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart.m +++ /dev/null @@ -1,49 +0,0 @@ -#include -#import "third_party/swift_api.h" - -#if !__has_feature(objc_arc) -#error "This file must be compiled with ARC enabled" -#endif - -id objc_retain(id); -id objc_retainBlock(id); - -typedef void (^_ListenerTrampoline)(); -_ListenerTrampoline _SwiftLibrary_wrapListenerBlock_ksby9f(_ListenerTrampoline block) NS_RETURNS_RETAINED { - return ^void() { - objc_retainBlock(block); - block(); - }; -} - -typedef void (^_ListenerTrampoline1)(unsigned long arg0, BOOL * arg1); -_ListenerTrampoline1 _SwiftLibrary_wrapListenerBlock_l9klhe(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { - return ^void(unsigned long arg0, BOOL * arg1) { - objc_retainBlock(block); - block(arg0, arg1); - }; -} - -typedef void (^_ListenerTrampoline2)(id arg0); -_ListenerTrampoline2 _SwiftLibrary_wrapListenerBlock_ukcdfq(_ListenerTrampoline2 block) NS_RETURNS_RETAINED { - return ^void(id arg0) { - objc_retainBlock(block); - block(objc_retain(arg0)); - }; -} - -typedef void (^_ListenerTrampoline3)(id arg0, id arg1); -_ListenerTrampoline3 _SwiftLibrary_wrapListenerBlock_1tjlcwl(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { - return ^void(id arg0, id arg1) { - objc_retainBlock(block); - block(objc_retain(arg0), objc_retain(arg1)); - }; -} - -typedef void (^_ListenerTrampoline4)(void * arg0, id arg1); -_ListenerTrampoline4 _SwiftLibrary_wrapListenerBlock_sjfpmz(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { - return ^void(void * arg0, id arg1) { - objc_retainBlock(block); - block(arg0, objc_retain(arg1)); - }; -} diff --git a/pkgs/ffigen/lib/src/code_generator/library.dart b/pkgs/ffigen/lib/src/code_generator/library.dart index f45aab1f7..a5909c2f9 100644 --- a/pkgs/ffigen/lib/src/code_generator/library.dart +++ b/pkgs/ffigen/lib/src/code_generator/library.dart @@ -4,18 +4,15 @@ import 'dart:io'; -import 'package:logging/logging.dart'; +import 'package:dart_style/dart_style.dart'; import 'package:yaml_edit/yaml_edit.dart'; import '../code_generator.dart'; import '../config_provider/config.dart' show Config; import '../config_provider/config_types.dart'; -import 'utils.dart'; import 'writer.dart'; -final _logger = Logger('ffigen.code_generator.library'); - /// Container for all Bindings. class Library { /// List of bindings in this library. @@ -95,10 +92,13 @@ class Library { /// generated file. void generateFile(File file, {bool format = true}) { if (!file.existsSync()) file.createSync(recursive: true); - file.writeAsStringSync(generate()); + var bindings = generate(); if (format) { - _dartFormat(file.path); + final formatter = + DartFormatter(languageVersion: DartFormatter.latestLanguageVersion); + bindings = formatter.format(bindings); } + file.writeAsStringSync(bindings); } /// Generates [file] with the Objective C code needed for the bindings, if @@ -133,17 +133,6 @@ class Library { file.writeAsStringSync(yamlString); } - /// Formats a file using the Dart formatter. - void _dartFormat(String path) { - final result = Process.runSync(findDart(), ['format', path], - workingDirectory: Directory.current.absolute.path, - runInShell: Platform.isWindows); - if (result.stderr.toString().isNotEmpty) { - _logger.severe(result.stderr); - throw FormatException('Unable to format generated file: $path.'); - } - } - /// Generates the bindings. String generate() => writer.generate(); diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 465ec1f8d..0df49a9e2 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -20,6 +20,7 @@ dependencies: args: ^2.6.0 cli_util: ^0.4.2 collection: ^1.18.0 + dart_style: ^2.3.7 ffi: ^2.0.1 file: ^7.0.0 glob: ^2.0.0 @@ -34,7 +35,7 @@ dependencies: dev_dependencies: async: ^2.11.0 - coverage: ^1.10.0 + coverage: ^1.11.0 dart_flutter_team_lints: ^2.0.0 json_schema: ^5.1.1 leak_tracker: ^10.0.7 diff --git a/pkgs/objective_c/pubspec.yaml b/pkgs/objective_c/pubspec.yaml index 4581f9f43..7f72c557c 100644 --- a/pkgs/objective_c/pubspec.yaml +++ b/pkgs/objective_c/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: dev_dependencies: args: ^2.6.0 - coverage: ^1.10.0 + coverage: ^1.11.0 dart_flutter_team_lints: ^2.0.0 ffigen: ^16.0.0 flutter_lints: ^3.0.0