diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index e9c11c149e..86e532f22a 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -12,6 +12,8 @@ - Remove `useSupportedTypedefs`, treating it as always true - Fix [a bug](https://github.com/dart-lang/native/issues/3504) in handling of small structs in ObjC on mac/iOS x64. +- Fix [a bug](https://github.com/dart-lang/native/issues/3546) in the way that + ObjC category methods returning `instancetype` are filtered. - Minor Objective-C code generator and function type signature fixes. - Bump `package:code_assets` dependency to `^2.0.0`. diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index a5c0bfe631..e53f8613ed 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -10,7 +10,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// WARNING: AVAudioFormat is a stub. To generate bindings for this class, include /// AVAudioFormat in your config's objc-interfaces list. diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index 71cab810fc..2757db9db3 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -10,7 +10,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// SwiftClass extension type SwiftClass._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index 5805ff1819..de1ead354c 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -129,7 +129,7 @@ const objcPkgImport = LibraryImport( importPathWhenImportedByPackageObjC: '../objective_c.dart', ); const objcMajorVersion = 9; -const objcMinorVersion = 5; +const objcMinorVersion = 6; const selfImport = LibraryImport('self', ''); final builtInLibraries = { for (final l in [ diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart index 194e77f1de..8dad91ee04 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_types.dart @@ -124,8 +124,16 @@ const objCBuiltInProtocols = { }; const objCBuiltInCategories = { + 'NSArrayCreation', + 'NSAttributedStringCreateFromMarkdown', + 'NSAttributedStringFormatting', + 'NSDataBase64Encoding', + 'NSDataCompression', 'NSDataCreation', + 'NSDateCreation', + 'NSDictionaryCreation', 'NSExtendedArray', + 'NSExtendedAttributedString', 'NSExtendedData', 'NSExtendedDate', 'NSExtendedDictionary', @@ -137,8 +145,19 @@ const objCBuiltInCategories = { 'NSExtendedMutableSet', 'NSExtendedOrderedSet', 'NSExtendedSet', + 'NSInputStreamExtensions', + 'NSLocaleCreation', + 'NSMutableArrayCreation', + 'NSMutableDataCreation', + 'NSMutableDictionaryCreation', + 'NSMutableOrderedSetCreation', + 'NSMutableSetCreation', + 'NSNotificationCreation', 'NSNumberCreation', - 'NSNumberIsFloat', 'NSNumberIsBool', + 'NSNumberIsFloat', + 'NSOrderedSetCreation', + 'NSOutputStreamExtensions', + 'NSSetCreation', 'NSStringExtensionMethods', }; diff --git a/pkgs/ffigen/lib/src/code_generator/objc_methods.dart b/pkgs/ffigen/lib/src/code_generator/objc_methods.dart index bac4a4c0d3..221fb7ca16 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_methods.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_methods.dart @@ -13,6 +13,7 @@ import 'local_variables.dart'; import 'native_type.dart'; import 'objc_block.dart'; import 'objc_built_in_functions.dart'; +import 'objc_category.dart'; import 'objc_interface.dart'; import 'objc_nullable.dart'; import 'pointer.dart'; @@ -49,12 +50,12 @@ mixin ObjCMethods { } } - void copyMethod(ObjCMethod method) { + void copyMethod(ObjCMethod method, {ObjCCategory? originCategory}) { // To maintain the pairing between getters and setters after cloning, // instead of directly cloning the setter, we clone the setter when we clone // the getter. This lets us, for example, share the symbol between them. if (method.kind == ObjCMethodKind.propertySetter) return; - final cloned = method.clone(); + final cloned = method.clone(originCategory: originCategory); addMethod(cloned); addMethod(cloned.setter); } @@ -213,6 +214,7 @@ class ObjCMethod extends AstNode with HasLocalScope { ObjCMethods? parent; ObjCMethod? setter; bool isIncluded = true; + ObjCCategory? originCategory; @override void visitChildren(Visitor visitor, {bool omitMethodName = false}) { @@ -332,7 +334,11 @@ class ObjCMethod extends AstNode with HasLocalScope { bool get isInstanceMethod => !isClassMethod; bool get unavailable => apiAvailability.availability == Availability.none; - ObjCMethod _cloneWithSymbol(Symbol newSymbol, {ObjCMethods? parent}) { + ObjCMethod _cloneWithSymbol( + Symbol newSymbol, { + ObjCMethods? parent, + ObjCCategory? originCategory, + }) { final clonedMethod = ObjCMethod.withSymbol( context: context, originalName: originalName, @@ -352,19 +358,25 @@ class ObjCMethod extends AstNode with HasLocalScope { clonedMethod.parent = parent; clonedMethod.protocolMethodName = protocolMethodName?.clone(); clonedMethod.isIncluded = isIncluded; + clonedMethod.originCategory = originCategory ?? this.originCategory; return clonedMethod; } - ObjCMethod clone({ObjCMethods? parent}) { + ObjCMethod clone({ObjCMethods? parent, ObjCCategory? originCategory}) { assert(kind != ObjCMethodKind.propertySetter); final clonedSymbol = symbol.clone(); - final clonedMethod = _cloneWithSymbol(clonedSymbol, parent: parent); + final clonedMethod = _cloneWithSymbol( + clonedSymbol, + parent: parent, + originCategory: originCategory, + ); if (setter != null) { assert(setter!.kind == ObjCMethodKind.propertySetter); assert(setter!.symbol == symbol); final clonedSetter = setter!._cloneWithSymbol( clonedSymbol, parent: parent, + originCategory: originCategory, ); clonedSetter.isIncluded = clonedMethod.isIncluded; clonedMethod.setter = clonedSetter; diff --git a/pkgs/ffigen/lib/src/visitor/apply_config_filters.dart b/pkgs/ffigen/lib/src/visitor/apply_config_filters.dart index 8b873d7aaf..db7d85171e 100644 --- a/pkgs/ffigen/lib/src/visitor/apply_config_filters.dart +++ b/pkgs/ffigen/lib/src/visitor/apply_config_filters.dart @@ -51,7 +51,15 @@ class ApplyConfigFiltersVisitation extends Visitation { if (context.config.objectiveC == null) return; if (!node.isInternal) { - node.filterMethods((m) => !m.unavailable && m.isIncluded); + node.filterMethods((m) { + if (m.unavailable) return false; + if (m.originCategory != null && + m.originCategory!.originalName.isNotEmpty && + !m.originCategory!.isIncluded) { + return false; + } + return m.isIncluded; + }); } _visitImpl(node, node.isIncluded); diff --git a/pkgs/ffigen/lib/src/visitor/copy_methods_from_super_type.dart b/pkgs/ffigen/lib/src/visitor/copy_methods_from_super_type.dart index 4f4f82ce09..387fc6abca 100644 --- a/pkgs/ffigen/lib/src/visitor/copy_methods_from_super_type.dart +++ b/pkgs/ffigen/lib/src/visitor/copy_methods_from_super_type.dart @@ -70,15 +70,10 @@ class CopyMethodsFromSuperTypesVisitation extends Visitation { // methods return instancetype, because the Dart inheritance rules don't // match the ObjC rules regarding instancetype. // Also copy all methods from any anonymous categories. - // NOTE: The methods are copied regardless of whether the category is - // included by the config filters, since this method copying visit happens - // before the filtering visit. This is technically a bug, but it's unlikely - // to bother anyone, and the fix would be complicated. So we'll ignore it - // for now. for (final category in node.categories) { for (final m in category.methods) { if (category.shouldCopyMethodToInterface(m)) { - node.copyMethod(m); + node.copyMethod(m, originCategory: category); } } } diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d2ed222eaf..fca4bb2dee 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -43,7 +43,8 @@ dev_dependencies: dart_flutter_team_lints: ^3.5.2 json_schema: ^5.1.1 leak_tracker: ^11.0.2 - objective_c: ^9.5.0 + objective_c: + path: ../objective_c test: ^1.26.2 dependency_overrides: diff --git a/pkgs/ffigen/test/native_objc_test/arc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/arc_test_bindings.dart index 12fd500fb5..33347986a9 100644 --- a/pkgs/ffigen/test/native_objc_test/arc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/arc_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native)>() external void objc_autoreleasePoolPop(ffi.Pointer pool); diff --git a/pkgs/ffigen/test/native_objc_test/bad_method_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/bad_method_test_bindings.dart index 3ae3ec75a3..53a8a0f400 100644 --- a/pkgs/ffigen/test/native_objc_test/bad_method_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/bad_method_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// BadMethodTestObject extension type BadMethodTestObject._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/bad_override_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/bad_override_test_bindings.dart index ba2f1ffb2b..be694629d0 100644 --- a/pkgs/ffigen/test/native_objc_test/bad_override_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/bad_override_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// BadOverrideAunt extension type BadOverrideAunt._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/block_annotation_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/block_annotation_test_bindings.dart index 1854786c48..877f430247 100644 --- a/pkgs/ffigen/test/native_objc_test/block_annotation_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/block_annotation_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< ffi.Void Function( ffi.Pointer, diff --git a/pkgs/ffigen/test/native_objc_test/block_inherit_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/block_inherit_test_bindings.dart index 3dc34fbed9..88f75dbb00 100644 --- a/pkgs/ffigen/test/native_objc_test/block_inherit_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/block_inherit_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); typedef AcceptMammal = ffi.Pointer; typedef DartAcceptMammal = objc.ObjCBlock; typedef AcceptPlatypus = ffi.Pointer; diff --git a/pkgs/ffigen/test/native_objc_test/block_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/block_test_bindings.dart index 194a5064d8..bab538ac0f 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< ffi.Pointer Function( ffi.Int64, diff --git a/pkgs/ffigen/test/native_objc_test/cast_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/cast_test_bindings.dart index 463cd4713c..cf4e7b4f3a 100644 --- a/pkgs/ffigen/test/native_objc_test/cast_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/cast_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// Castaway extension type Castaway._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/category_config.yaml b/pkgs/ffigen/test/native_objc_test/category_config.yaml index ee80696998..7f09b1db23 100644 --- a/pkgs/ffigen/test/native_objc_test/category_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/category_config.yaml @@ -20,6 +20,8 @@ objc-categories: - InterfaceOnBuiltInType - StaticAndInstanceMethodsWithSameNameCategory - NSString + - NSURLCategory +include-transitive-objc-categories: false ffi-native: asset-id: 'package:ffigen/objc_test' headers: diff --git a/pkgs/ffigen/test/native_objc_test/category_test.dart b/pkgs/ffigen/test/native_objc_test/category_test.dart index f08c0b114d..3a1d69a51f 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.dart +++ b/pkgs/ffigen/test/native_objc_test/category_test.dart @@ -111,5 +111,32 @@ extension type ChildOfNSString._(objc.ObjCObject object\$) '''), ); }); + + test('Excluded category filtering and instancetype methods', () { + final bindings = File( + path.join( + packagePathForTests, + 'test', + 'native_objc_test', + 'category_test_bindings.dart', + ), + ).readAsStringSync(); + + // ExcludedCategory extension and its methods should not be generated. + expect(bindings, isNot(contains('extension ExcludedCategory'))); + expect( + bindings, + isNot(contains('excludedCategoryNonInstancetypeMethod')), + ); + expect( + bindings, + isNot(contains('excludedCategoryStaticNonInstancetypeMethod')), + ); + expect(bindings, isNot(contains('excludedCategoryInstancetypeMethod'))); + expect( + bindings, + isNot(contains('excludedCategoryStaticInstancetypeMethod')), + ); + }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/category_test.h b/pkgs/ffigen/test/native_objc_test/category_test.h index 487f481fe8..bf1a24f2a8 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.h +++ b/pkgs/ffigen/test/native_objc_test/category_test.h @@ -33,6 +33,13 @@ -(instancetype)instancetypeMethod; @end +@interface Thing (ExcludedCategory) +-(instancetype)excludedCategoryInstancetypeMethod; ++(instancetype)excludedCategoryStaticInstancetypeMethod; +-(int32_t)excludedCategoryNonInstancetypeMethod; ++(int32_t)excludedCategoryStaticNonInstancetypeMethod; +@end + @interface Thing () -(int32_t)anonymousCategoryMethod; +(int32_t)anonymousCategoryStaticMethod; diff --git a/pkgs/ffigen/test/native_objc_test/category_test.m b/pkgs/ffigen/test/native_objc_test/category_test.m index 3a777043e6..227e3a2dda 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test.m +++ b/pkgs/ffigen/test/native_objc_test/category_test.m @@ -54,6 +54,21 @@ -(instancetype)instancetypeMethod { } @end +@implementation Thing (ExcludedCategory) +-(instancetype)excludedCategoryInstancetypeMethod { + return [[self class] new]; +} ++(instancetype)excludedCategoryStaticInstancetypeMethod { + return [[self class] new]; +} +-(int32_t)excludedCategoryNonInstancetypeMethod { + return 111; +} ++(int32_t)excludedCategoryStaticNonInstancetypeMethod { + return 222; +} +@end + @implementation ChildOfThing @end diff --git a/pkgs/ffigen/test/native_objc_test/category_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/category_test_bindings.dart index 6d48048e5d..7e0b448feb 100644 --- a/pkgs/ffigen/test/native_objc_test/category_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/category_test_bindings.dart @@ -9,37 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); -@ffi.Native< - ffi.Pointer Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer args) - > - >, - ) ->(isLeaf: true) -external ffi.Pointer _l3cf7j_wrapBlockingBlock_pfv6jd( - int port, - ffi.Pointer context, - ffi.Pointer< - ffi.NativeFunction args)> - > - directInvoke, -); - -@ffi.Native< - ffi.Pointer Function( - ffi.Int64, - ffi.Pointer, - ) ->(isLeaf: true) -external ffi.Pointer _l3cf7j_wrapListenerBlock_pfv6jd( - int port, - ffi.Pointer context, -); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// CatImplementsProto extension CatImplementsProto on Thing { @@ -288,252 +258,6 @@ extension Mul on Thing { } } -/// NSItemProvider -extension NSItemProvider on objc.NSURL { - /// itemProviderVisibilityForRepresentationWithTypeIdentifier: - objc.NSItemProviderRepresentationVisibility - itemProviderVisibilityForRepresentationWithTypeIdentifier( - objc.NSString typeIdentifier, - ) { - final _$$ref = object$.ref; - final _$$ref$1 = typeIdentifier.ref; - objc.checkOsVersionInternal( - 'NSURL.itemProviderVisibilityForRepresentationWithTypeIdentifier:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - if (!objc.respondsToSelector( - _$$ref.pointer, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - )) { - throw objc.UnimplementedOptionalMethodException( - 'NSURL', - 'itemProviderVisibilityForRepresentationWithTypeIdentifier:', - ); - } - final $ret = _objc_msgSend_16fy0up( - _$$ref.pointer, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - _$$ref$1.pointer, - ); - return objc.NSItemProviderRepresentationVisibility.fromValue($ret); - } - - /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: - objc.NSProgress? loadDataWithTypeIdentifier( - objc.NSString typeIdentifier, { - required objc.ObjCBlock - forItemProviderCompletionHandler, - }) { - final _$$ref = object$.ref; - final _$$ref$1 = typeIdentifier.ref; - final _$$ref$2 = forItemProviderCompletionHandler.ref; - objc.checkOsVersionInternal( - 'NSURL.loadDataWithTypeIdentifier:forItemProviderCompletionHandler:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final $ret = _objc_msgSend_r0bo0s( - _$$ref.pointer, - _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, - _$$ref$1.pointer, - _$$ref$2.pointer, - ); - return $ret.address == 0 - ? null - : objc.NSProgress.fromPointer($ret, retain: true, release: true); - } - - /// writableTypeIdentifiersForItemProvider - objc.NSArray get writableTypeIdentifiersForItemProvider { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.writableTypeIdentifiersForItemProvider', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - if (!objc.respondsToSelector( - _$$ref.pointer, - _sel_writableTypeIdentifiersForItemProvider, - )) { - throw objc.UnimplementedOptionalMethodException( - 'NSURL', - 'writableTypeIdentifiersForItemProvider', - ); - } - final $ret = _objc_msgSend_151sglz( - _$$ref.pointer, - _sel_writableTypeIdentifiersForItemProvider, - ); - return objc.NSArray.fromPointer($ret, retain: true, release: true); - } - - /// itemProviderVisibilityForRepresentationWithTypeIdentifier: - static objc.NSItemProviderRepresentationVisibility - itemProviderVisibilityForRepresentationWithTypeIdentifier$1( - objc.NSString typeIdentifier, - ) { - final _$$ref = typeIdentifier.ref; - objc.checkOsVersionInternal( - 'NSURL.itemProviderVisibilityForRepresentationWithTypeIdentifier:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - if (!objc.respondsToSelector( - _class_NSURL, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - )) { - throw objc.UnimplementedOptionalMethodException( - 'NSURL', - 'itemProviderVisibilityForRepresentationWithTypeIdentifier:', - ); - } - final $ret = _objc_msgSend_16fy0up( - _class_NSURL, - _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, - _$$ref.pointer, - ); - return objc.NSItemProviderRepresentationVisibility.fromValue($ret); - } - - /// objectWithItemProviderData:typeIdentifier:error: - static objc.NSURL? objectWithItemProviderData( - objc.NSData data, { - required objc.NSString typeIdentifier, - }) { - final _$$ref = data.ref; - final _$$ref$1 = typeIdentifier.ref; - objc.checkOsVersionInternal( - 'NSURL.objectWithItemProviderData:typeIdentifier:error:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final $err = pkg_ffi.calloc>(); - try { - final $ret = _objc_msgSend_1pnyuds( - _class_NSURL, - _sel_objectWithItemProviderData_typeIdentifier_error_, - _$$ref.pointer, - _$$ref$1.pointer, - $err, - ); - objc.NSErrorException.checkErrorPointer($err.value); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } finally { - pkg_ffi.calloc.free($err); - } - } - - /// readableTypeIdentifiersForItemProvider - static objc.NSArray getReadableTypeIdentifiersForItemProvider() { - objc.checkOsVersionInternal( - 'NSURL.readableTypeIdentifiersForItemProvider', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final $ret = _objc_msgSend_151sglz( - _class_NSURL, - _sel_readableTypeIdentifiersForItemProvider, - ); - return objc.NSArray.fromPointer($ret, retain: true, release: true); - } - - /// writableTypeIdentifiersForItemProvider - static objc.NSArray getWritableTypeIdentifiersForItemProvider$1() { - objc.checkOsVersionInternal( - 'NSURL.writableTypeIdentifiersForItemProvider', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final $ret = _objc_msgSend_151sglz( - _class_NSURL, - _sel_writableTypeIdentifiersForItemProvider, - ); - return objc.NSArray.fromPointer($ret, retain: true, release: true); - } -} - -/// NSPromisedItems -extension NSPromisedItems on objc.NSURL { - /// checkPromisedItemIsReachableAndReturnError: - bool checkPromisedItemIsReachableAndReturnError() { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.checkPromisedItemIsReachableAndReturnError:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - final $err = pkg_ffi.calloc>(); - try { - final $ret = _objc_msgSend_1dom33q( - _$$ref.pointer, - _sel_checkPromisedItemIsReachableAndReturnError_, - $err, - ); - objc.NSErrorException.checkErrorPointer($err.value); - return $ret; - } finally { - pkg_ffi.calloc.free($err); - } - } - - /// getPromisedItemResourceValue:forKey:error: - bool getPromisedItemResourceValue( - ffi.Pointer> value, { - required objc.NSString forKey, - }) { - final _$$ref = object$.ref; - final _$$ref$1 = forKey.ref; - objc.checkOsVersionInternal( - 'NSURL.getPromisedItemResourceValue:forKey:error:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - final $err = pkg_ffi.calloc>(); - try { - final $ret = _objc_msgSend_1j9bhml( - _$$ref.pointer, - _sel_getPromisedItemResourceValue_forKey_error_, - value, - _$$ref$1.pointer, - $err, - ); - objc.NSErrorException.checkErrorPointer($err.value); - return $ret; - } finally { - pkg_ffi.calloc.free($err); - } - } - - /// promisedItemResourceValuesForKeys:error: - objc.NSDictionary? promisedItemResourceValuesForKeys(objc.NSArray keys) { - final _$$ref = object$.ref; - final _$$ref$1 = keys.ref; - objc.checkOsVersionInternal( - 'NSURL.promisedItemResourceValuesForKeys:error:', - iOS: (false, (8, 0, 0)), - macOS: (false, (10, 10, 0)), - ); - final $err = pkg_ffi.calloc>(); - try { - final $ret = _objc_msgSend_1lhpu4m( - _$$ref.pointer, - _sel_promisedItemResourceValuesForKeys_error_, - _$$ref$1.pointer, - $err, - ); - objc.NSErrorException.checkErrorPointer($err.value); - return $ret.address == 0 - ? null - : objc.NSDictionary.fromPointer($ret, retain: true, release: true); - } finally { - pkg_ffi.calloc.free($err); - } - } -} - /// NSString extension NSString on Thing { /// nsStringExtension @@ -552,545 +276,6 @@ extension NSURLCategory on objc.NSURL { } } -/// NSURLLoading -extension NSURLLoading on objc.NSURL { - /// URLHandleUsingCache: - @Deprecated('Use NSURLConnection instead') - objc.NSURLHandle? URLHandleUsingCache(bool shouldUseCache) { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.URLHandleUsingCache:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final $ret = _objc_msgSend_1t6aok9( - _$$ref.pointer, - _sel_URLHandleUsingCache_, - shouldUseCache, - ); - return $ret.address == 0 - ? null - : objc.NSURLHandle.fromPointer($ret, retain: true, release: true); - } - - /// loadResourceDataNotifyingClient:usingCache: - @Deprecated('Use NSURLConnection instead') - void loadResourceDataNotifyingClient( - objc.ObjCObject client, { - required bool usingCache, - }) { - final _$$ref = object$.ref; - final _$$ref$1 = client.ref; - objc.checkOsVersionInternal( - 'NSURL.loadResourceDataNotifyingClient:usingCache:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - _objc_msgSend_6p7ndb( - _$$ref.pointer, - _sel_loadResourceDataNotifyingClient_usingCache_, - _$$ref$1.pointer, - usingCache, - ); - } - - /// propertyForKey: - @Deprecated('Use NSURLConnection instead') - objc.ObjCObject? propertyForKey(objc.NSString propertyKey) { - final _$$ref = object$.ref; - final _$$ref$1 = propertyKey.ref; - objc.checkOsVersionInternal( - 'NSURL.propertyForKey:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final $ret = _objc_msgSend_1sotr3r( - _$$ref.pointer, - _sel_propertyForKey_, - _$$ref$1.pointer, - ); - return $ret.address == 0 - ? null - : objc.ObjCObject($ret, retain: true, release: true); - } - - /// resourceDataUsingCache: - @Deprecated('Use NSURLConnection instead') - objc.NSData? resourceDataUsingCache(bool shouldUseCache) { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.resourceDataUsingCache:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - final $ret = _objc_msgSend_1t6aok9( - _$$ref.pointer, - _sel_resourceDataUsingCache_, - shouldUseCache, - ); - return $ret.address == 0 - ? null - : objc.NSData.fromPointer($ret, retain: true, release: true); - } - - /// setProperty:forKey: - @Deprecated('Use NSURLConnection instead') - bool setProperty(objc.ObjCObject property, {required objc.NSString forKey}) { - final _$$ref = object$.ref; - final _$$ref$1 = property.ref; - final _$$ref$2 = forKey.ref; - objc.checkOsVersionInternal( - 'NSURL.setProperty:forKey:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - return _objc_msgSend_1lsax7n( - _$$ref.pointer, - _sel_setProperty_forKey_, - _$$ref$1.pointer, - _$$ref$2.pointer, - ); - } - - /// setResourceData: - @Deprecated('Use NSURLConnection instead') - bool setResourceData(objc.NSData data) { - final _$$ref = object$.ref; - final _$$ref$1 = data.ref; - objc.checkOsVersionInternal( - 'NSURL.setResourceData:', - iOS: (false, (2, 0, 0)), - macOS: (false, (10, 0, 0)), - ); - return _objc_msgSend_19nvye5( - _$$ref.pointer, - _sel_setResourceData_, - _$$ref$1.pointer, - ); - } -} - -/// NSURLPathUtilities -extension NSURLPathUtilities on objc.NSURL { - /// URLByAppendingPathComponent: - objc.NSURL? URLByAppendingPathComponent(objc.NSString pathComponent) { - final _$$ref = object$.ref; - final _$$ref$1 = pathComponent.ref; - objc.checkOsVersionInternal( - 'NSURL.URLByAppendingPathComponent:', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_1sotr3r( - _$$ref.pointer, - _sel_URLByAppendingPathComponent_, - _$$ref$1.pointer, - ); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } - - /// URLByAppendingPathComponent:isDirectory: - objc.NSURL? URLByAppendingPathComponent$1( - objc.NSString pathComponent, { - required bool isDirectory, - }) { - final _$$ref = object$.ref; - final _$$ref$1 = pathComponent.ref; - objc.checkOsVersionInternal( - 'NSURL.URLByAppendingPathComponent:isDirectory:', - iOS: (false, (5, 0, 0)), - macOS: (false, (10, 7, 0)), - ); - final $ret = _objc_msgSend_17amj0z( - _$$ref.pointer, - _sel_URLByAppendingPathComponent_isDirectory_, - _$$ref$1.pointer, - isDirectory, - ); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } - - /// URLByAppendingPathExtension: - objc.NSURL? URLByAppendingPathExtension(objc.NSString pathExtension) { - final _$$ref = object$.ref; - final _$$ref$1 = pathExtension.ref; - objc.checkOsVersionInternal( - 'NSURL.URLByAppendingPathExtension:', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_1sotr3r( - _$$ref.pointer, - _sel_URLByAppendingPathExtension_, - _$$ref$1.pointer, - ); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } - - /// URLByDeletingLastPathComponent - objc.NSURL? get URLByDeletingLastPathComponent { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.URLByDeletingLastPathComponent', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_151sglz( - _$$ref.pointer, - _sel_URLByDeletingLastPathComponent, - ); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } - - /// URLByDeletingPathExtension - objc.NSURL? get URLByDeletingPathExtension { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.URLByDeletingPathExtension', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_151sglz( - _$$ref.pointer, - _sel_URLByDeletingPathExtension, - ); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } - - /// URLByResolvingSymlinksInPath - objc.NSURL? get URLByResolvingSymlinksInPath { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.URLByResolvingSymlinksInPath', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_151sglz( - _$$ref.pointer, - _sel_URLByResolvingSymlinksInPath, - ); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } - - /// URLByStandardizingPath - objc.NSURL? get URLByStandardizingPath { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.URLByStandardizingPath', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_151sglz( - _$$ref.pointer, - _sel_URLByStandardizingPath, - ); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } - - /// checkResourceIsReachableAndReturnError: - bool checkResourceIsReachableAndReturnError() { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.checkResourceIsReachableAndReturnError:', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $err = pkg_ffi.calloc>(); - try { - final $ret = _objc_msgSend_1dom33q( - _$$ref.pointer, - _sel_checkResourceIsReachableAndReturnError_, - $err, - ); - objc.NSErrorException.checkErrorPointer($err.value); - return $ret; - } finally { - pkg_ffi.calloc.free($err); - } - } - - /// lastPathComponent - objc.NSString? get lastPathComponent { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.lastPathComponent', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_151sglz(_$$ref.pointer, _sel_lastPathComponent); - return $ret.address == 0 - ? null - : objc.NSString.fromPointer($ret, retain: true, release: true); - } - - /// pathComponents - objc.NSArray? get pathComponents { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.pathComponents', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_151sglz(_$$ref.pointer, _sel_pathComponents); - return $ret.address == 0 - ? null - : objc.NSArray.fromPointer($ret, retain: true, release: true); - } - - /// pathExtension - objc.NSString? get pathExtension { - final _$$ref = object$.ref; - objc.checkOsVersionInternal( - 'NSURL.pathExtension', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_151sglz(_$$ref.pointer, _sel_pathExtension); - return $ret.address == 0 - ? null - : objc.NSString.fromPointer($ret, retain: true, release: true); - } - - /// fileURLWithPathComponents: - static objc.NSURL? fileURLWithPathComponents(objc.NSArray components) { - final _$$ref = components.ref; - objc.checkOsVersionInternal( - 'NSURL.fileURLWithPathComponents:', - iOS: (false, (4, 0, 0)), - macOS: (false, (10, 6, 0)), - ); - final $ret = _objc_msgSend_1sotr3r( - _class_NSURL, - _sel_fileURLWithPathComponents_, - _$$ref.pointer, - ); - return $ret.address == 0 - ? null - : objc.NSURL.fromPointer($ret, retain: true, release: true); - } -} - -/// Construction methods for `objc.ObjCBlock`. -abstract final class ObjCBlock_ffiVoid_NSData_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock - fromPointer( - 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(_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. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock - fromFunction( - void Function(objc.NSData?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) => objc.ObjCBlock( - objc.newClosureBlock(_closureCallable, ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return fn( - arg0.address == 0 - ? null - : objc.NSData.fromPointer(arg0, retain: true, release: true), - arg1.address == 0 - ? null - : objc.NSError.fromPointer(arg1, retain: true, release: true), - ); - }, keepIsolateAlive), - retain: false, - release: true, - ); - - /// Creates a listener block from a Dart function. - /// - /// This block can be invoked from any thread, but only supports void - /// functions, and is not run synchronously. Async functions (ie returning - /// Future) are not supported. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock - listener( - void Function(objc.NSData?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) { - return objc.ObjCBlock( - objc.newBlockPort(_l3cf7j_wrapListenerBlock_pfv6jd, ( - ffi.Pointer rawArgs, - ) { - final args = _BlockArgs_x5cg0.fromPointer( - rawArgs, - retain: false, - release: false, - ); - - fn(args.arg0, args.arg1); - }, keepIsolateAlive), - retain: false, - release: true, - ); - } - - /// Creates a blocking block from a Dart function. - /// - /// This callback can be invoked from any native thread, and will block the - /// caller until the callback is handled by the Dart isolate that created - /// the block. Async functions (ie returning Future) are not supported. - /// - /// If `keepIsolateAlive` is true, this block will keep this isolate alive - /// until it is garbage collected by both Dart and ObjC. If the owner isolate - /// has shut down, and the block is invoked by native code, it may block - /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock - blocking( - void Function(objc.NSData?, objc.NSError?) fn, { - bool keepIsolateAlive = true, - }) { - return objc.ObjCBlock( - objc.newBlockingBlockPort(_l3cf7j_wrapBlockingBlock_pfv6jd, ( - ffi.Pointer rawArgs, - ) { - final args = _BlockArgs_x5cg0.fromPointer( - rawArgs, - retain: false, - release: false, - ); - - fn(args.arg0, args.arg1); - }, keepIsolateAlive), - retain: false, - release: true, - ); - } - - static void _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); - static ffi.Pointer _fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_fnPtrTrampoline) - .cast(); - static void _closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ) => - (objc.getBlockClosure(block) - as void Function( - ffi.Pointer, - ffi.Pointer, - ))(arg0, arg1); - static ffi.Pointer _closureCallable = - ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(_closureTrampoline) - .cast(); -} - -/// Call operator for `objc.ObjCBlock`. -extension ObjCBlock_ffiVoid_NSData_NSError$CallExtension - on objc.ObjCBlock { - void call(objc.NSData? arg0, objc.NSError? arg1) { - final _$$ref = arg0?.ref; - final _$$ref$1 = arg1?.ref; - return 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, - _$$ref?.pointer ?? ffi.nullptr, - _$$ref$1?.pointer ?? ffi.nullptr, - ); - } -} - /// StaticAndInstanceMethodsWithSameNameCategory extension StaticAndInstanceMethodsWithSameNameCategory on Thing { /// sameNameMethod @@ -1211,50 +396,6 @@ extension Thing$Methods on Thing { } } -extension type _BlockArgs_x5cg0._(objc.ObjCObject object$) - implements objc.ObjCObject { - /// Constructs a [_BlockArgs_x5cg0] that points to the same underlying object as [other]. - _BlockArgs_x5cg0.as(objc.ObjCObject other) : object$ = other { - assert(isA(object$)); - } - - /// Constructs a [_BlockArgs_x5cg0] that wraps the given raw object pointer. - _BlockArgs_x5cg0.fromPointer( - ffi.Pointer other, { - bool retain = false, - bool release = false, - }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { - assert(isA(object$)); - } - - /// Returns whether [obj] is an instance of [_BlockArgs_x5cg0]. - static bool isA(objc.ObjCObject? obj) => obj == null - ? false - : _objc_msgSend_19nvye5( - obj.ref.pointer, - _sel_isKindOfClass_, - _class__BlockArgs_x5cg0, - ); -} - -extension _BlockArgs_x5cg0$Methods on _BlockArgs_x5cg0 { - objc.NSData? get arg0 { - final _$$ref = object$.ref; - final $ret = _objc_msgSend_151sglz(_$$ref.pointer, _sel_arg0); - return $ret.address == 0 - ? null - : objc.NSData.fromPointer($ret, retain: true, release: true); - } - - objc.NSError? get arg1 { - final _$$ref = object$.ref; - final $ret = _objc_msgSend_151sglz(_$$ref.pointer, _sel_arg1); - return $ret.address == 0 - ? null - : objc.NSError.fromPointer($ret, retain: true, release: true); - } -} - @ffi.Native>( symbol: 'OBJC_CLASS_\$_ChildOfNSString', ) @@ -1299,16 +440,6 @@ final _class_Thing = objc.getClass( _class_Thing_raw, ).cast(), ); -@ffi.Native>( - symbol: 'OBJC_CLASS_\$__l3cf7j_BlockArgs_pfv6jd', -) -external ffi.Pointer _class__BlockArgs_x5cg0_raw; -final _class__BlockArgs_x5cg0 = objc.getClass( - "_l3cf7j_BlockArgs_pfv6jd", - () => ffi.Native.addressOf>( - _class__BlockArgs_x5cg0_raw, - ).cast(), -); final _objc_msgSend_151sglz = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -1324,42 +455,6 @@ final _objc_msgSend_151sglz = objc.msgSendPointer ffi.Pointer, ) >(); -final _objc_msgSend_16fy0up = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - > - >() - .asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ) - >(); -final _objc_msgSend_17amj0z = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ) - >(); final _objc_msgSend_19nvye5 = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -1394,23 +489,6 @@ final _objc_msgSend_1cwp428 = objc.msgSendPointer ffi.Pointer, ) >(); -final _objc_msgSend_1dom33q = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - > - >() - .asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >(); final _objc_msgSend_1gcq84o = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -1426,86 +504,6 @@ final _objc_msgSend_1gcq84o = objc.msgSendPointer ffi.Pointer, ) >(); -final _objc_msgSend_1j9bhml = 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>, - ) - >(); -final _objc_msgSend_1lhpu4m = 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>, - ) - >(); -final _objc_msgSend_1lsax7n = 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, - ) - >(); -final _objc_msgSend_1pnyuds = 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>, - ) - >(); final _objc_msgSend_1q0lyci = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -1542,42 +540,6 @@ final _objc_msgSend_1sotr3r = objc.msgSendPointer ffi.Pointer, ) >(); -final _objc_msgSend_1t6aok9 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - bool, - ) - >(); -final _objc_msgSend_6p7ndb = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ) - > - >() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ) - >(); final _objc_msgSend_91o635 = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -1593,49 +555,6 @@ final _objc_msgSend_91o635 = objc.msgSendPointer ffi.Pointer, ) >(); -final _objc_msgSend_r0bo0s = 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_URLByAppendingPathComponent_ = objc.registerName( - "URLByAppendingPathComponent:", -); -late final _sel_URLByAppendingPathComponent_isDirectory_ = objc.registerName( - "URLByAppendingPathComponent:isDirectory:", -); -late final _sel_URLByAppendingPathExtension_ = objc.registerName( - "URLByAppendingPathExtension:", -); -late final _sel_URLByDeletingLastPathComponent = objc.registerName( - "URLByDeletingLastPathComponent", -); -late final _sel_URLByDeletingPathExtension = objc.registerName( - "URLByDeletingPathExtension", -); -late final _sel_URLByResolvingSymlinksInPath = objc.registerName( - "URLByResolvingSymlinksInPath", -); -late final _sel_URLByStandardizingPath = objc.registerName( - "URLByStandardizingPath", -); -late final _sel_URLHandleUsingCache_ = objc.registerName( - "URLHandleUsingCache:", -); late final _sel_add_Y_ = objc.registerName("add:Y:"); late final _sel_alloc = objc.registerName("alloc"); late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); @@ -1645,59 +564,17 @@ late final _sel_anonymousCategoryMethod = objc.registerName( late final _sel_anonymousCategoryStaticMethod = objc.registerName( "anonymousCategoryStaticMethod", ); -late final _sel_arg0 = objc.registerName("arg0"); -late final _sel_arg1 = objc.registerName("arg1"); -late final _sel_checkPromisedItemIsReachableAndReturnError_ = objc.registerName( - "checkPromisedItemIsReachableAndReturnError:", -); -late final _sel_checkResourceIsReachableAndReturnError_ = objc.registerName( - "checkResourceIsReachableAndReturnError:", -); late final _sel_extensionMethod = objc.registerName("extensionMethod"); -late final _sel_fileURLWithPathComponents_ = objc.registerName( - "fileURLWithPathComponents:", -); -late final _sel_getPromisedItemResourceValue_forKey_error_ = objc.registerName( - "getPromisedItemResourceValue:forKey:error:", -); late final _sel_init = objc.registerName("init"); late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); late final _sel_instancetypeMethod = objc.registerName("instancetypeMethod"); late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); -late final _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_ = - objc.registerName( - "itemProviderVisibilityForRepresentationWithTypeIdentifier:", - ); -late final _sel_lastPathComponent = objc.registerName("lastPathComponent"); -late final _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = - objc.registerName( - "loadDataWithTypeIdentifier:forItemProviderCompletionHandler:", - ); -late final _sel_loadResourceDataNotifyingClient_usingCache_ = objc.registerName( - "loadResourceDataNotifyingClient:usingCache:", -); late final _sel_method = objc.registerName("method"); late final _sel_mul_Y_ = objc.registerName("mul:Y:"); late final _sel_new = objc.registerName("new"); late final _sel_nsStringExtension = objc.registerName("nsStringExtension"); -late final _sel_objectWithItemProviderData_typeIdentifier_error_ = objc - .registerName("objectWithItemProviderData:typeIdentifier:error:"); -late final _sel_pathComponents = objc.registerName("pathComponents"); -late final _sel_pathExtension = objc.registerName("pathExtension"); -late final _sel_promisedItemResourceValuesForKeys_error_ = objc.registerName( - "promisedItemResourceValuesForKeys:error:", -); -late final _sel_propertyForKey_ = objc.registerName("propertyForKey:"); late final _sel_protoMethod = objc.registerName("protoMethod"); -late final _sel_readableTypeIdentifiersForItemProvider = objc.registerName( - "readableTypeIdentifiersForItemProvider", -); -late final _sel_resourceDataUsingCache_ = objc.registerName( - "resourceDataUsingCache:", -); late final _sel_sameNameMethod = objc.registerName("sameNameMethod"); -late final _sel_setProperty_forKey_ = objc.registerName("setProperty:forKey:"); -late final _sel_setResourceData_ = objc.registerName("setResourceData:"); late final _sel_someProperty = objc.registerName("someProperty"); late final _sel_staticMethod = objc.registerName("staticMethod"); late final _sel_staticProtoMethod = objc.registerName("staticProtoMethod"); @@ -1705,11 +582,5 @@ late final _sel_sub_Y_ = objc.registerName("sub:Y:"); late final _sel_supportsSecureCoding = objc.registerName( "supportsSecureCoding", ); -late final _sel_writableTypeIdentifiersForItemProvider = objc.registerName( - "writableTypeIdentifiersForItemProvider", -); typedef instancetype = ffi.Pointer; typedef Dartinstancetype = objc.ObjCObject; - -/// -extension unnamed on Thing {} diff --git a/pkgs/ffigen/test/native_objc_test/category_test_bindings.m b/pkgs/ffigen/test/native_objc_test/category_test_bindings.m deleted file mode 100644 index f0761e700f..0000000000 --- a/pkgs/ffigen/test/native_objc_test/category_test_bindings.m +++ /dev/null @@ -1,111 +0,0 @@ -#include -#import -#import -#import "category_test.h" -#import "category_test.h" - -#if !__has_feature(objc_arc) -#error "This file must be compiled with ARC enabled" -#endif - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wundeclared-selector" - -typedef struct { - int64_t version; - void* (*newWaiter)(void); - void (*awaitWaiter)(void*); - void* (*currentIsolate)(void); - void (*enterIsolate)(void*); - void (*exitIsolate)(void); - int64_t (*getMainPortId)(void); - bool (*getCurrentThreadOwnsIsolate)(int64_t); - void (*invokeListenerPortBlock)(int64_t port, void*); - void (*invokeBlockingPortBlock)(int64_t port, void*, void*); -} DOBJC_Context; - -id objc_retainBlock(id); - -#define BLOCKING_BLOCK_IMPL(ctx, TYPE, SIG, INVOKE_DIRECT, INVOKE_LISTENER) \ - assert(ctx->version >= 1); \ - void* targetIsolate = ctx->currentIsolate(); \ - int64_t targetPort = ctx->getMainPortId == NULL ? 0 : ctx->getMainPortId(); \ - __block __weak TYPE weakSelfBlock = nil; \ - TYPE strongSelfBlock = [SIG { \ - void* currentIsolate = ctx->currentIsolate(); \ - bool mayEnterIsolate = \ - currentIsolate == NULL && \ - ctx->getCurrentThreadOwnsIsolate != NULL && \ - ctx->getCurrentThreadOwnsIsolate(targetPort); \ - if (currentIsolate == targetIsolate || mayEnterIsolate) { \ - if (mayEnterIsolate) { \ - ctx->enterIsolate(targetIsolate); \ - } \ - INVOKE_DIRECT; \ - if (mayEnterIsolate) { \ - ctx->exitIsolate(); \ - } \ - } else { \ - void* waiter = ctx->newWaiter(); \ - TYPE selfRetain = [weakSelfBlock copy]; \ - INVOKE_LISTENER; \ - ctx->awaitWaiter(waiter); \ - (void)selfRetain; \ - } \ - } copy]; \ - weakSelfBlock = strongSelfBlock; \ - return strongSelfBlock; - - -__attribute__((visibility("default"))) -@interface _l3cf7j_BlockArgs_pfv6jd : NSObject -@property (copy) id block; -@property (strong) id arg0; -@property (strong) id arg1; -@end -@implementation _l3cf7j_BlockArgs_pfv6jd -@end - -typedef void (^_ListenerTrampoline)(id arg0, id arg1); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline _l3cf7j_wrapListenerBlock_pfv6jd( - int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline weakSelfBlock = nil; - _ListenerTrampoline strongSelfBlock = [^void(id arg0, id arg1) { - @autoreleasepool { - _l3cf7j_BlockArgs_pfv6jd* args = [[_l3cf7j_BlockArgs_pfv6jd alloc] init]; - args.block = weakSelfBlock; - args.arg0 = arg0; - args.arg1 = arg1; - ctx->invokeListenerPortBlock(port, (__bridge_retained void*)args); - } - } copy]; - weakSelfBlock = strongSelfBlock; - return strongSelfBlock; -} - -typedef void (^_BlockingTrampoline)(void * waiter, id arg0, id arg1); -__attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline _l3cf7j_wrapBlockingBlock_pfv6jd(int64_t port, DOBJC_Context* ctx, - void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline, ^void(id arg0, id arg1), { - @autoreleasepool { - _l3cf7j_BlockArgs_pfv6jd* args = [[_l3cf7j_BlockArgs_pfv6jd alloc] init]; - args.block = weakSelfBlock; - args.arg0 = arg0; - args.arg1 = arg1; - directInvoke((__bridge_retained void*)args); - } - }, { - @autoreleasepool { - _l3cf7j_BlockArgs_pfv6jd* args = [[_l3cf7j_BlockArgs_pfv6jd alloc] init]; - args.block = weakSelfBlock; - args.arg0 = arg0; - args.arg1 = arg1; - ctx->invokeBlockingPortBlock(port, (__bridge_retained void*)args, waiter); - } - }); -} -#undef BLOCKING_BLOCK_IMPL - -#pragma clang diagnostic pop diff --git a/pkgs/ffigen/test/native_objc_test/enum_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/enum_test_bindings.dart index 624ad51faa..03a4b99de9 100644 --- a/pkgs/ffigen/test/native_objc_test/enum_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/enum_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); sealed class CoffeeOptions { static const CoffeeOptionsNone = 0; diff --git a/pkgs/ffigen/test/native_objc_test/error_method_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/error_method_test_bindings.dart index 342e32e50b..0bf729e0f0 100644 --- a/pkgs/ffigen/test/native_objc_test/error_method_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/error_method_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// ErrorMethodTestObject extension type ErrorMethodTestObject._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/failed_to_load_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/failed_to_load_test_bindings.dart index 8bd3c48f48..7f9cf3d353 100644 --- a/pkgs/ffigen/test/native_objc_test/failed_to_load_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/failed_to_load_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// ClassThatWillFailToLoad extension type ClassThatWillFailToLoad._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/forward_decl_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/forward_decl_test_bindings.dart index 855bf1a850..aa9058bef1 100644 --- a/pkgs/ffigen/test/native_objc_test/forward_decl_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/forward_decl_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// ForwardDeclaredClass extension type ForwardDeclaredClass._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/global_native_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/global_native_test_bindings.dart index 579aa3cfee..9e46feba64 100644 --- a/pkgs/ffigen/test/native_objc_test/global_native_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/global_native_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native>(symbol: 'globalBlock') external ffi.Pointer _globalBlock; diff --git a/pkgs/ffigen/test/native_objc_test/global_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/global_test_bindings.dart index 750eb425ce..7685d5d4d3 100644 --- a/pkgs/ffigen/test/native_objc_test/global_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/global_test_bindings.dart @@ -6,7 +6,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// Tests global variables class GlobalTestObjCLibrary { diff --git a/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test_bindings.dart index 2afa773d54..31d4bcb145 100644 --- a/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/inherited_instancetype_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// BaseClass extension type BaseClass._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/is_instance_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/is_instance_test_bindings.dart index 486f0fa35c..af497cd4be 100644 --- a/pkgs/ffigen/test/native_objc_test/is_instance_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/is_instance_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// IsInstanceBaseClass extension type IsInstanceBaseClass._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/isolate_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/isolate_test_bindings.dart index fb2451e90b..4d05011e94 100644 --- a/pkgs/ffigen/test/native_objc_test/isolate_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/isolate_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< ffi.Pointer Function( ffi.Int64, diff --git a/pkgs/ffigen/test/native_objc_test/log_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/log_test_bindings.dart index cb06d2dcb3..2af0cb8655 100644 --- a/pkgs/ffigen/test/native_objc_test/log_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/log_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// LogSpamBaseClass extension type LogSpamBaseClass._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/method_filtering_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_filtering_test_bindings.dart index d3464955d5..4b8e77b291 100644 --- a/pkgs/ffigen/test/native_objc_test/method_filtering_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_filtering_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< instancetype Function(ffi.Pointer, ffi.Pointer) >() diff --git a/pkgs/ffigen/test/native_objc_test/method_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/method_test_bindings.dart index 8071e21574..416a7ec484 100644 --- a/pkgs/ffigen/test/native_objc_test/method_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/method_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// MethodInterface extension type MethodInterface._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart index 9ddfe020c2..6edf575d60 100644 --- a/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/native_objc_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// Foo extension type Foo._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test_bindings.dart index f808138798..bb274ddc57 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_inheritance_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// NullableBase extension type NullableBase._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/nullable_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/nullable_test_bindings.dart index ba8f6f1664..943e4d3770 100644 --- a/pkgs/ffigen/test/native_objc_test/nullable_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/nullable_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// NullableInterface extension type NullableInterface._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/property_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/property_test_bindings.dart index c153f673a9..ed143313ff 100644 --- a/pkgs/ffigen/test/native_objc_test/property_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/property_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// PropertyInterface extension type PropertyInterface._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/protocol_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/protocol_test_bindings.dart index d38bd0fd15..69a1a86174 100644 --- a/pkgs/ffigen/test/native_objc_test/protocol_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/protocol_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< ffi.Void Function( ffi.Pointer, diff --git a/pkgs/ffigen/test/native_objc_test/ref_count_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/ref_count_test_bindings.dart index 79e372972b..51d53a4f5a 100644 --- a/pkgs/ffigen/test/native_objc_test/ref_count_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/ref_count_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native)>() external void objc_autoreleasePoolPop(ffi.Pointer pool); diff --git a/pkgs/ffigen/test/native_objc_test/rename_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/rename_test_bindings.dart index ea453eea06..7e01d93889 100644 --- a/pkgs/ffigen/test/native_objc_test/rename_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/rename_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); final class CollidingStructName extends ffi.Opaque {} diff --git a/pkgs/ffigen/test/native_objc_test/runtime_version_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/runtime_version_test_bindings.dart index 8dfee2df47..662ad48782 100644 --- a/pkgs/ffigen/test/native_objc_test/runtime_version_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/runtime_version_test_bindings.dart @@ -11,7 +11,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// FutureAPICategoryMethods extension FutureAPICategoryMethods on objc.NSObject { diff --git a/pkgs/ffigen/test/native_objc_test/sdk_variable_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/sdk_variable_test_bindings.dart index 10cef0b27b..feea06a8fb 100644 --- a/pkgs/ffigen/test/native_objc_test/sdk_variable_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/sdk_variable_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// WARNING: NSAccessibility is a stub. To generate bindings for this class, include /// NSAccessibility in your config's objc-protocols list. diff --git a/pkgs/ffigen/test/native_objc_test/small_struct_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/small_struct_test_bindings.dart index 6cc9fabcbd..c52c6fa3d8 100644 --- a/pkgs/ffigen/test/native_objc_test/small_struct_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/small_struct_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// Construction methods for `objc.ObjCBlock`. abstract final class ObjCBlock_Struct16 { diff --git a/pkgs/ffigen/test/native_objc_test/static_func_native_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/static_func_native_test_bindings.dart index 41ff128938..74a503aac1 100644 --- a/pkgs/ffigen/test/native_objc_test/static_func_native_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/static_func_native_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native() external int foo(int x); diff --git a/pkgs/ffigen/test/native_objc_test/static_func_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/static_func_test_bindings.dart index a4ea0b3383..55e7bd133a 100644 --- a/pkgs/ffigen/test/native_objc_test/static_func_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/static_func_test_bindings.dart @@ -6,7 +6,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// Test ObjC static functions class StaticFuncTestObjCLibrary { diff --git a/pkgs/ffigen/test/native_objc_test/string_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/string_test_bindings.dart index 94a21fdc76..9ea5aa01b0 100644 --- a/pkgs/ffigen/test/native_objc_test/string_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/string_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// StringUtil extension type StringUtil._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/native_objc_test/swift_class_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/swift_class_test_bindings.dart index eb4465ca4e..167e394a77 100644 --- a/pkgs/ffigen/test/native_objc_test/swift_class_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/swift_class_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< NSInteger Function(ffi.Pointer, ffi.Pointer) >() diff --git a/pkgs/ffigen/test/native_objc_test/typedef_test_bindings.dart b/pkgs/ffigen/test/native_objc_test/typedef_test_bindings.dart index 7b04acef7b..e4083e2e5c 100644 --- a/pkgs/ffigen/test/native_objc_test/typedef_test_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/typedef_test_bindings.dart @@ -9,7 +9,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// AnotherClass extension type AnotherClass._(objc.ObjCObject object$) diff --git a/pkgs/ffigen/test/unit_tests/objc_inheritance_edge_case_test.dart b/pkgs/ffigen/test/unit_tests/objc_inheritance_edge_case_test.dart index 1f811bdf1a..31a8839493 100644 --- a/pkgs/ffigen/test/unit_tests/objc_inheritance_edge_case_test.dart +++ b/pkgs/ffigen/test/unit_tests/objc_inheritance_edge_case_test.dart @@ -5,6 +5,8 @@ import 'package:ffigen/src/code_generator.dart'; import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; +import 'package:ffigen/src/config_provider/public_visitor.dart' + as public_visitor; import 'package:ffigen/src/context.dart'; import 'package:ffigen/src/header_parser/parser.dart'; import 'package:ffigen/src/header_parser/sub_parsers/api_availability.dart'; @@ -60,15 +62,16 @@ void main() { ObjCCategory makeCategory( String name, ObjCInterface parent, - List methods, - ) { + List methods, { + bool isIncluded = true, + }) { final category = ObjCCategory( context: context, usr: name, originalName: name, parent: parent, apiAvailability: availability, - )..isIncluded = true; + )..isIncluded = isIncluded; parent.categories.add(category); for (final m in methods) { category.addMethod(m); @@ -81,6 +84,7 @@ void main() { Type returnType, List params, { bool isClassMethod = false, + bool isIncluded = true, }) => ObjCMethod( context: context, originalName: name, @@ -94,7 +98,7 @@ void main() { params: params, ownershipAttribute: null, consumesSelfAttribute: false, - ); + )..isIncluded = isIncluded; Parameter makeParam(String name, Type type) => Parameter(name: name, type: type, objCConsumed: false); @@ -253,5 +257,165 @@ void main() { expect(getMethod(child, 'm1').parent, child); expect(getMethod(grandChild, 'm1').parent, grandChild); }); + + test('excluded category methods are not copied to interface', () { + final catMethod = makeMethod('catMethod', instanceType, []); + final parent = makeInterface('Parent', null, []); + final child = makeInterface('Child', parent, []); + final category = makeCategory('ExcludedCategory', parent, [ + catMethod, + ], isIncluded: false); + + final bindings = transformBindings([parent, child, category], context); + + expect(bindings, contains(parent)); + expect(bindings, contains(child)); + + expect( + parent.methods.map((m) => m.originalName), + isNot(contains('catMethod')), + ); + expect( + child.methods.map((m) => m.originalName), + isNot(contains('catMethod')), + ); + }); + + test( + 'excluded methods on included category are not copied to interface', + () { + final includedMethod = makeMethod( + 'includedMethod', + instanceType, + [], + isIncluded: true, + ); + final excludedMethod = makeMethod( + 'excludedMethod', + instanceType, + [], + isIncluded: false, + ); + final parent = makeInterface('Parent', null, []); + final child = makeInterface('Child', parent, []); + final category = makeCategory('IncludedCategory', parent, [ + includedMethod, + excludedMethod, + ], isIncluded: true); + + final bindings = transformBindings([parent, child, category], context); + + expect(bindings, contains(parent)); + expect(bindings, contains(child)); + expect(bindings, contains(category)); + + expect( + parent.methods.map((m) => m.originalName), + contains('includedMethod'), + ); + expect( + parent.methods.map((m) => m.originalName), + isNot(contains('excludedMethod')), + ); + expect( + child.methods.map((m) => m.originalName), + contains('includedMethod'), + ); + expect( + child.methods.map((m) => m.originalName), + isNot(contains('excludedMethod')), + ); + }, + ); + + test( + 'anonymous category methods are copied even if not explicitly included', + () { + final anonMethod = makeMethod('anonMethod', instanceType, []); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('', parent, [ + anonMethod, + ], isIncluded: false); + + final bindings = transformBindings([parent, category], context); + + expect(bindings, contains(parent)); + expect( + parent.methods.map((m) => m.originalName), + contains('anonMethod'), + ); + }, + ); + + test('visitors see copied category methods before filter pass', () { + final catMethod = makeMethod('catMethod', instanceType, []); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('Category', parent, [catMethod]); + + var visitorSawMethodOnInterface = false; + + final testConfig = FfiGenerator( + output: Output(dartFile: Uri.file('unused')), + objectiveC: const ObjectiveC(), + visitors: [ + public_visitor.Visitor( + objCInterface: (itf) { + if (itf.originalName == 'Parent') { + visitorSawMethodOnInterface = itf.methods.any( + (m) => m.originalName == 'catMethod', + ); + } + }, + ), + ], + ); + final customContext = testContext(testConfig); + + final bindings = transformBindings([parent, category], customContext); + + expect(visitorSawMethodOnInterface, isTrue); + expect(bindings, contains(parent)); + expect(bindings, contains(category)); + expect(parent.methods.map((m) => m.originalName), contains('catMethod')); + }); + + test('visitor excluding origin category prunes method from interface', () { + final catMethod = makeMethod('catMethod', instanceType, []); + final parent = makeInterface('Parent', null, []); + final child = makeInterface('Child', parent, []); + final category = makeCategory('Category', parent, [catMethod]); + + final testConfig = FfiGenerator( + output: Output(dartFile: Uri.file('unused')), + objectiveC: const ObjectiveC(), + visitors: [ + public_visitor.Visitor( + objCCategory: (cat) { + if (cat.originalName == 'Category') { + cat.isIncluded = false; + } + }, + ), + ], + ); + final customContext = testContext(testConfig); + + final bindings = transformBindings([ + parent, + child, + category, + ], customContext); + + expect(bindings, contains(parent)); + expect(bindings, contains(child)); + expect( + parent.methods.map((m) => m.originalName), + isNot(contains('catMethod')), + ); + expect( + child.methods.map((m) => m.originalName), + isNot(contains('catMethod')), + ); + }); }); } diff --git a/pkgs/ffigen/test/unit_tests/objc_method_clone_test.dart b/pkgs/ffigen/test/unit_tests/objc_method_clone_test.dart index 600d90a668..6cc60d64c2 100644 --- a/pkgs/ffigen/test/unit_tests/objc_method_clone_test.dart +++ b/pkgs/ffigen/test/unit_tests/objc_method_clone_test.dart @@ -52,6 +52,26 @@ void main() { return itf; } + ObjCCategory makeCategory( + String name, + ObjCInterface parent, + List methods, { + bool isIncluded = true, + }) { + final category = ObjCCategory( + context: context, + usr: name, + originalName: name, + parent: parent, + apiAvailability: availability, + )..isIncluded = isIncluded; + parent.categories.add(category); + for (final m in methods) { + category.addMethod(m); + } + return category; + } + ObjCMethod makeMethod( String name, Type returnType, @@ -172,5 +192,131 @@ void main() { expect(source.methods.length, 2); }, ); + + test('copyMethod with originCategory sets originCategory', () { + final method = makeMethod('catMethod', voidType, []); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('Category', parent, [method]); + final dest = makeInterface('Destination', null, []); + + dest.copyMethod(method, originCategory: category); + + expect(dest.methods.length, 1); + final clonedMethod = dest.methods.single; + expect(clonedMethod.originCategory, category); + }); + + test('copying a property with originCategory sets originCategory on getter ' + 'and setter', () { + final (getter, setter) = makeProperty('prop', intType); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('Category', parent, [getter, setter]); + final dest = makeInterface('Destination', null, []); + + dest.copyMethod(getter, originCategory: category); + + expect(dest.methods.length, 2); + final clonedGetter = dest.methods.firstWhere( + (m) => m.kind == ObjCMethodKind.propertyGetter, + ); + final clonedSetter = dest.methods.firstWhere( + (m) => m.kind == ObjCMethodKind.propertySetter, + ); + + expect(clonedGetter.originCategory, category); + expect(clonedSetter.originCategory, category); + }); + + test('copyMethod preserves originCategory across multiple copies', () { + final method = makeMethod('catMethod', voidType, []); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('Category', parent, [method]); + final mid = makeInterface('Mid', null, []); + final dest = makeInterface('Destination', null, []); + + mid.copyMethod(method, originCategory: category); + final midMethod = mid.methods.single; + expect(midMethod.originCategory, category); + + dest.copyMethod(midMethod); + final destMethod = dest.methods.single; + expect(destMethod.originCategory, category); + }); + + test('clone with originCategory sets originCategory', () { + final method = makeMethod('catMethod', voidType, []); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('Category', parent, []); + + final cloned = method.clone(originCategory: category); + expect(cloned.originCategory, category); + }); + + test('clone with originCategory overrides existing originCategory', () { + final method = makeMethod('catMethod', voidType, []); + final parent = makeInterface('Parent', null, []); + final category1 = makeCategory('Category1', parent, []); + final category2 = makeCategory('Category2', parent, []); + + method.originCategory = category1; + final cloned = method.clone(originCategory: category2); + expect(cloned.originCategory, category2); + }); + + test('clone property with originCategory sets originCategory on getter and ' + 'setter', () { + final (getter, setter) = makeProperty('prop', intType); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('Category', parent, []); + + final clonedGetter = getter.clone(originCategory: category); + expect(clonedGetter.originCategory, category); + expect(clonedGetter.setter?.originCategory, category); + }); + + test( + 'clone property with originCategory overrides existing originCategory on ' + 'getter and setter', + () { + final (getter, setter) = makeProperty('prop', intType); + final parent = makeInterface('Parent', null, []); + final category1 = makeCategory('Category1', parent, []); + final category2 = makeCategory('Category2', parent, []); + + getter.originCategory = category1; + setter.originCategory = category1; + + final clonedGetter = getter.clone(originCategory: category2); + expect(clonedGetter.originCategory, category2); + expect(clonedGetter.setter?.originCategory, category2); + }, + ); + + test('clone preserves originCategory', () { + final method = makeMethod('catMethod', voidType, []); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('Category', parent, [method]); + final dest1 = makeInterface('Dest1', null, []); + final dest2 = makeInterface('Dest2', null, []); + + dest1.copyMethod(method, originCategory: category); + final dest1Method = dest1.methods.single; + + final cloned = dest1Method.clone(parent: dest2); + expect(cloned.originCategory, category); + }); + + test('clone property preserves originCategory on getter and setter', () { + final (getter, setter) = makeProperty('prop', intType); + final parent = makeInterface('Parent', null, []); + final category = makeCategory('Category', parent, []); + + getter.originCategory = category; + setter.originCategory = category; + + final clonedGetter = getter.clone(); + expect(clonedGetter.originCategory, category); + expect(clonedGetter.setter?.originCategory, category); + }); }); } diff --git a/pkgs/objective_c/CHANGELOG.md b/pkgs/objective_c/CHANGELOG.md index e668cad81c..4b8cc0cbfd 100644 --- a/pkgs/objective_c/CHANGELOG.md +++ b/pkgs/objective_c/CHANGELOG.md @@ -1,5 +1,6 @@ -## 9.5.1-wip +## 9.6.0-wip +- Add a bunch more categories to the bindings. - Bump `package:code_assets` dependency to `^2.0.0`. ## 9.5.0 @@ -8,6 +9,7 @@ - Make an internal-only FFI struct, `DOBJC_Context`, opaque. This is technically a breaking change, but it's extremely unlikely that any users are using these internal structs (and doing so would be a mistake). + ## 9.4.1 - Fix a [bug](https://github.com/flutter/flutter/issues/186794) related to diff --git a/pkgs/objective_c/ffigen_objc.yaml b/pkgs/objective_c/ffigen_objc.yaml index 3dc2299304..76b3ab6c7c 100644 --- a/pkgs/objective_c/ffigen_objc.yaml +++ b/pkgs/objective_c/ffigen_objc.yaml @@ -106,8 +106,16 @@ objc-protocols: 'NSObject': 'NSObjectProtocol' objc-categories: include: + - NSArrayCreation + - NSAttributedStringCreateFromMarkdown + - NSAttributedStringFormatting + - NSDataBase64Encoding + - NSDataCompression - NSDataCreation + - NSDateCreation + - NSDictionaryCreation - NSExtendedArray + - NSExtendedAttributedString - NSExtendedData - NSExtendedDate - NSExtendedDictionary @@ -119,9 +127,20 @@ objc-categories: - NSExtendedMutableSet - NSExtendedOrderedSet - NSExtendedSet + - NSInputStreamExtensions + - NSLocaleCreation + - NSMutableArrayCreation + - NSMutableDataCreation + - NSMutableDictionaryCreation + - NSMutableOrderedSetCreation + - NSMutableSetCreation + - NSNotificationCreation - NSNumberCreation - - NSNumberIsFloat - NSNumberIsBool + - NSNumberIsFloat + - NSOrderedSetCreation + - NSOutputStreamExtensions + - NSSetCreation - NSStringExtensionMethods structs: include: diff --git a/pkgs/objective_c/lib/src/objective_c_bindings_exported.dart b/pkgs/objective_c/lib/src/objective_c_bindings_exported.dart index 5e3700d8b4..cc260c0963 100644 --- a/pkgs/objective_c/lib/src/objective_c_bindings_exported.dart +++ b/pkgs/objective_c/lib/src/objective_c_bindings_exported.dart @@ -25,9 +25,12 @@ export 'objective_c_bindings_generated.dart' NSAppleEventSendOptions, NSArray, NSArray$Methods, + NSArrayCreation, NSAttributedString, NSAttributedString$Methods, + NSAttributedStringCreateFromMarkdown, NSAttributedStringEnumerationOptions, + NSAttributedStringFormatting, NSAttributedStringFormattingOptions, NSAttributedStringMarkdownInterpretedSyntax, NSAttributedStringMarkdownParsingFailurePolicy, @@ -51,7 +54,9 @@ export 'objective_c_bindings_generated.dart' NSData, NSData$Methods, NSDataBase64DecodingOptions, + NSDataBase64Encoding, NSDataBase64EncodingOptions, + NSDataCompression, NSDataCompressionAlgorithm, NSDataCreation, NSDataReadingOptions, @@ -59,9 +64,11 @@ export 'objective_c_bindings_generated.dart' NSDataWritingOptions, NSDate, NSDate$Methods, + NSDateCreation, NSDecodingFailurePolicy, NSDictionary, NSDictionary$Methods, + NSDictionaryCreation, NSEdgeInsets, NSEnumerationOptions, NSEnumerator, @@ -69,6 +76,7 @@ export 'objective_c_bindings_generated.dart' NSError, NSError$Methods, NSExtendedArray, + NSExtendedAttributedString, NSExtendedData, NSExtendedDate, NSExtendedDictionary, @@ -88,6 +96,7 @@ export 'objective_c_bindings_generated.dart' NSIndexSet$Methods, NSInputStream, NSInputStream$Methods, + NSInputStreamExtensions, NSInvocation, NSInvocation$Methods, NSItemProvider, @@ -106,28 +115,35 @@ export 'objective_c_bindings_generated.dart' NSLinguisticTaggerOptions, NSLocale, NSLocale$Methods, + NSLocaleCreation, NSLocaleLanguageDirection, NSMethodSignature, NSMethodSignature$Methods, NSMutableArray, NSMutableArray$Methods, + NSMutableArrayCreation, NSMutableCopying, NSMutableCopying$Builder, NSMutableCopying$Methods, NSMutableData, NSMutableData$Methods, + NSMutableDataCreation, NSMutableDictionary, NSMutableDictionary$Methods, + NSMutableDictionaryCreation, NSMutableIndexSet, NSMutableIndexSet$Methods, NSMutableOrderedSet, NSMutableOrderedSet$Methods, + NSMutableOrderedSetCreation, NSMutableSet, NSMutableSet$Methods, + NSMutableSetCreation, NSMutableString, NSMutableString$Methods, NSNotification, NSNotification$Methods, + NSNotificationCreation, NSNull, NSNull$Methods, NSNumber, @@ -147,8 +163,10 @@ export 'objective_c_bindings_generated.dart' NSOrderedCollectionDifferenceCalculationOptions, NSOrderedSet, NSOrderedSet$Methods, + NSOrderedSetCreation, NSOutputStream, NSOutputStream$Methods, + NSOutputStreamExtensions, NSPort, NSPort$Methods, NSPortDelegate, @@ -168,6 +186,7 @@ export 'objective_c_bindings_generated.dart' NSSecureCoding$Methods, NSSet, NSSet$Methods, + NSSetCreation, NSSortOptions, NSStream, NSStream$Methods, diff --git a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart index 886e68b264..c438634718 100644 --- a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart +++ b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart @@ -18,7 +18,7 @@ import 'dart:ffi' as ffi; import '../objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< NSUInteger Function( ffi.Pointer, @@ -274,6 +274,26 @@ external ffi.Pointer _1wx624s_wrapBlockingBlock_18v1jvf( directInvoke, ); +@ffi.Native< + ffi.Pointer Function( + ffi.Int64, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer args) + > + >, + ) +>(isLeaf: true) +external ffi.Pointer _1wx624s_wrapBlockingBlock_1a22wz( + int port, + ffi.Pointer context, + ffi.Pointer< + ffi.NativeFunction args)> + > + directInvoke, +); + @ffi.Native< ffi.Pointer Function( ffi.Int64, @@ -625,6 +645,17 @@ external ffi.Pointer _1wx624s_wrapListenerBlock_18v1jvf( ffi.Pointer context, ); +@ffi.Native< + ffi.Pointer Function( + ffi.Int64, + ffi.Pointer, + ) +>(isLeaf: true) +external ffi.Pointer _1wx624s_wrapListenerBlock_1a22wz( + int port, + ffi.Pointer context, +); + @ffi.Native< ffi.Pointer Function( ffi.Int64, @@ -1850,6 +1881,60 @@ extension NSArray$Methods on NSArray { } } +/// NSArrayCreation +extension NSArrayCreation on NSArray { + /// initWithContentsOfURL:error: + NSArray? initWithContentsOfURL(NSURL url) { + final _$$ref = object$.ref; + final _$$ref$1 = url.ref; + objc.checkOsVersionInternal( + 'NSArray.initWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + _$$ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_error_, + _$$ref$1.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : NSArray.fromPointer($ret, retain: false, release: true); + } finally { + pkg_ffi.calloc.free($err); + } + } + + /// arrayWithContentsOfURL:error: + static NSArray? arrayWithContentsOfURL(NSURL url) { + final _$$ref = url.ref; + objc.checkOsVersionInternal( + 'NSArray.arrayWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + _class_NSArray, + _sel_arrayWithContentsOfURL_error_, + _$$ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : NSArray.fromPointer($ret, retain: true, release: true); + } finally { + pkg_ffi.calloc.free($err); + } + } +} + /// NSAttributedString extension type NSAttributedString._(objc.ObjCObject object$) implements @@ -2317,12 +2402,18 @@ extension NSAttributedString$Methods on NSAttributedString { } } +/// NSAttributedStringCreateFromMarkdown +extension NSAttributedStringCreateFromMarkdown on NSAttributedString {} + sealed class NSAttributedStringEnumerationOptions { static const NSAttributedStringEnumerationReverse = 2; static const NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = 1048576; } +/// NSAttributedStringFormatting +extension NSAttributedStringFormatting on NSAttributedString {} + sealed class NSAttributedStringFormattingOptions { static const NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging = 1; @@ -4937,6 +5028,41 @@ sealed class NSDataBase64DecodingOptions { static const NSDataBase64DecodingIgnoreUnknownCharacters = 1; } +/// NSDataBase64Encoding +extension NSDataBase64Encoding on NSData { + /// base64EncodedDataWithOptions: + NSData base64EncodedDataWithOptions(DartNSUInteger options) { + final _$$ref = object$.ref; + objc.checkOsVersionInternal( + 'NSData.base64EncodedDataWithOptions:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_ylninc( + _$$ref.pointer, + _sel_base64EncodedDataWithOptions_, + options, + ); + return NSData.fromPointer($ret, retain: true, release: true); + } + + /// base64EncodedStringWithOptions: + NSString base64EncodedStringWithOptions(DartNSUInteger options) { + final _$$ref = object$.ref; + objc.checkOsVersionInternal( + 'NSData.base64EncodedStringWithOptions:', + iOS: (false, (7, 0, 0)), + macOS: (false, (10, 9, 0)), + ); + final $ret = _objc_msgSend_ylninc( + _$$ref.pointer, + _sel_base64EncodedStringWithOptions_, + options, + ); + return NSString.fromPointer($ret, retain: true, release: true); + } +} + sealed class NSDataBase64EncodingOptions { static const NSDataBase64Encoding64CharacterLineLength = 1; static const NSDataBase64Encoding76CharacterLineLength = 2; @@ -4944,6 +5070,9 @@ sealed class NSDataBase64EncodingOptions { static const NSDataBase64EncodingEndLineWithLineFeed = 32; } +/// NSDataCompression +extension NSDataCompression on NSData {} + /// iOS: introduced 13.0.0 /// macOS: introduced 10.15.0 enum NSDataCompressionAlgorithm { @@ -5225,6 +5354,33 @@ extension NSDate$Methods on NSDate { } } +/// NSDateCreation +extension NSDateCreation on NSDate { + /// distantFuture + static NSDate getDistantFuture() { + final $ret = _objc_msgSend_151sglz(_class_NSDate, _sel_distantFuture); + return NSDate.fromPointer($ret, retain: true, release: true); + } + + /// distantPast + static NSDate getDistantPast() { + final $ret = _objc_msgSend_151sglz(_class_NSDate, _sel_distantPast); + return NSDate.fromPointer($ret, retain: true, release: true); + } + + /// iOS: introduced 13.0.0 + /// macOS: introduced 10.15.0 + static NSDate getNow() { + objc.checkOsVersionInternal( + 'NSDate.now', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + final $ret = _objc_msgSend_151sglz(_class_NSDate, _sel_now); + return NSDate.fromPointer($ret, retain: true, release: true); + } +} + enum NSDecodingFailurePolicy { NSDecodingFailurePolicyRaiseException(0), NSDecodingFailurePolicySetErrorAndReturn(1); @@ -5547,6 +5703,60 @@ extension NSDictionary$Methods on NSDictionary { } } +/// NSDictionaryCreation +extension NSDictionaryCreation on NSDictionary { + /// initWithContentsOfURL:error: + NSDictionary? initWithContentsOfURL(NSURL url) { + final _$$ref = object$.ref; + final _$$ref$1 = url.ref; + objc.checkOsVersionInternal( + 'NSDictionary.initWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + _$$ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_error_, + _$$ref$1.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : NSDictionary.fromPointer($ret, retain: false, release: true); + } finally { + pkg_ffi.calloc.free($err); + } + } + + /// dictionaryWithContentsOfURL:error: + static NSDictionary? dictionaryWithContentsOfURL(NSURL url) { + final _$$ref = url.ref; + objc.checkOsVersionInternal( + 'NSDictionary.dictionaryWithContentsOfURL:error:', + iOS: (false, (11, 0, 0)), + macOS: (false, (10, 13, 0)), + ); + final $err = pkg_ffi.calloc>(); + try { + final $ret = _objc_msgSend_1lhpu4m( + _class_NSDictionary, + _sel_dictionaryWithContentsOfURL_error_, + _$$ref.pointer, + $err, + ); + objc.NSErrorException.checkErrorPointer($err.value); + return $ret.address == 0 + ? null + : NSDictionary.fromPointer($ret, retain: true, release: true); + } finally { + pkg_ffi.calloc.free($err); + } + } +} + final class NSEdgeInsets extends ffi.Struct { @ffi.Double() external double top; @@ -6666,6 +6876,183 @@ extension NSExtendedArray on NSArray { } } +/// NSExtendedAttributedString +extension NSExtendedAttributedString on NSAttributedString { + /// attribute:atIndex:effectiveRange: + objc.ObjCObject? attribute( + NSString attrName, { + required DartNSUInteger atIndex, + required ffi.Pointer effectiveRange, + }) { + final _$$ref = object$.ref; + final _$$ref$1 = attrName.ref; + objc.checkOsVersionInternal( + 'NSAttributedString.attribute:atIndex:effectiveRange:', + iOS: (false, (3, 2, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_7km9vu( + _$$ref.pointer, + _sel_attribute_atIndex_effectiveRange_, + _$$ref$1.pointer, + atIndex, + effectiveRange, + ); + return $ret.address == 0 + ? null + : objc.ObjCObject($ret, retain: true, release: true); + } + + /// attribute:atIndex:longestEffectiveRange:inRange: + objc.ObjCObject? attribute$1( + NSString attrName, { + required DartNSUInteger atIndex, + required ffi.Pointer longestEffectiveRange, + required NSRange inRange, + }) { + final _$$ref = object$.ref; + final _$$ref$1 = attrName.ref; + objc.checkOsVersionInternal( + 'NSAttributedString.attribute:atIndex:longestEffectiveRange:inRange:', + iOS: (false, (3, 2, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1k1akuq( + _$$ref.pointer, + _sel_attribute_atIndex_longestEffectiveRange_inRange_, + _$$ref$1.pointer, + atIndex, + longestEffectiveRange, + inRange, + ); + return $ret.address == 0 + ? null + : objc.ObjCObject($ret, retain: true, release: true); + } + + /// attributedSubstringFromRange: + NSAttributedString attributedSubstringFromRange(NSRange range) { + final _$$ref = object$.ref; + objc.checkOsVersionInternal( + 'NSAttributedString.attributedSubstringFromRange:', + iOS: (false, (3, 2, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1k1o1s7( + _$$ref.pointer, + _sel_attributedSubstringFromRange_, + range, + ); + return NSAttributedString.fromPointer($ret, retain: true, release: true); + } + + /// attributesAtIndex:longestEffectiveRange:inRange: + NSDictionary attributesAtIndex$1( + DartNSUInteger location, { + required ffi.Pointer longestEffectiveRange, + required NSRange inRange, + }) { + final _$$ref = object$.ref; + objc.checkOsVersionInternal( + 'NSAttributedString.attributesAtIndex:longestEffectiveRange:inRange:', + iOS: (false, (3, 2, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_1pp2gs8( + _$$ref.pointer, + _sel_attributesAtIndex_longestEffectiveRange_inRange_, + location, + longestEffectiveRange, + inRange, + ); + return NSDictionary.fromPointer($ret, retain: true, release: true); + } + + /// enumerateAttribute:inRange:options:usingBlock: + void enumerateAttribute( + NSString attrName, { + required NSRange inRange, + required DartNSUInteger options, + required objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + > + usingBlock, + }) { + final _$$ref = object$.ref; + final _$$ref$1 = attrName.ref; + final _$$ref$2 = usingBlock.ref; + objc.checkOsVersionInternal( + 'NSAttributedString.enumerateAttribute:inRange:options:usingBlock:', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + _objc_msgSend_ipgwfh( + _$$ref.pointer, + _sel_enumerateAttribute_inRange_options_usingBlock_, + _$$ref$1.pointer, + inRange, + options, + _$$ref$2.pointer, + ); + } + + /// enumerateAttributesInRange:options:usingBlock: + void enumerateAttributesInRange( + NSRange enumerationRange, { + required DartNSUInteger options, + required objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + > + usingBlock, + }) { + final _$$ref = object$.ref; + final _$$ref$1 = usingBlock.ref; + objc.checkOsVersionInternal( + 'NSAttributedString.enumerateAttributesInRange:options:usingBlock:', + iOS: (false, (4, 0, 0)), + macOS: (false, (10, 6, 0)), + ); + _objc_msgSend_1kok4b( + _$$ref.pointer, + _sel_enumerateAttributesInRange_options_usingBlock_, + enumerationRange, + options, + _$$ref$1.pointer, + ); + } + + /// isEqualToAttributedString: + bool isEqualToAttributedString(NSAttributedString other) { + final _$$ref = object$.ref; + final _$$ref$1 = other.ref; + objc.checkOsVersionInternal( + 'NSAttributedString.isEqualToAttributedString:', + iOS: (false, (3, 2, 0)), + macOS: (false, (10, 0, 0)), + ); + return _objc_msgSend_19nvye5( + _$$ref.pointer, + _sel_isEqualToAttributedString_, + _$$ref$1.pointer, + ); + } + + /// length + DartNSUInteger get length { + final _$$ref = object$.ref; + objc.checkOsVersionInternal( + 'NSAttributedString.length', + iOS: (false, (3, 2, 0)), + macOS: (false, (10, 0, 0)), + ); + return _objc_msgSend_xw2lbc(_$$ref.pointer, _sel_length); + } +} + /// NSExtendedData extension NSExtendedData on NSData { /// description @@ -9922,6 +10309,9 @@ extension NSInputStream$Methods on NSInputStream { } } +/// NSInputStreamExtensions +extension NSInputStreamExtensions on NSInputStream {} + /// NSInvocation extension type NSInvocation._(objc.ObjCObject object$) implements objc.ObjCObject, NSObject { @@ -11196,6 +11586,35 @@ extension NSLocale$Methods on NSLocale { } } +/// NSLocaleCreation +extension NSLocaleCreation on NSLocale { + /// autoupdatingCurrentLocale + static NSLocale getAutoupdatingCurrentLocale() { + objc.checkOsVersionInternal( + 'NSLocale.autoupdatingCurrentLocale', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 5, 0)), + ); + final $ret = _objc_msgSend_151sglz( + _class_NSLocale, + _sel_autoupdatingCurrentLocale, + ); + return NSLocale.fromPointer($ret, retain: true, release: true); + } + + /// currentLocale + static NSLocale getCurrentLocale() { + final $ret = _objc_msgSend_151sglz(_class_NSLocale, _sel_currentLocale); + return NSLocale.fromPointer($ret, retain: true, release: true); + } + + /// systemLocale + static NSLocale getSystemLocale() { + final $ret = _objc_msgSend_151sglz(_class_NSLocale, _sel_systemLocale); + return NSLocale.fromPointer($ret, retain: true, release: true); + } +} + enum NSLocaleLanguageDirection { NSLocaleLanguageDirectionUnknown(0), NSLocaleLanguageDirectionLeftToRight(1), @@ -11624,6 +12043,63 @@ extension NSMutableArray$Methods on NSMutableArray { } } +/// NSMutableArrayCreation +extension NSMutableArrayCreation on NSMutableArray { + /// initWithContentsOfFile: + NSMutableArray? initWithContentsOfFile(NSString path) { + final _$$ref = object$.ref; + final _$$ref$1 = path.ref; + final $ret = _objc_msgSend_1sotr3r( + _$$ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, + _$$ref$1.pointer, + ); + return $ret.address == 0 + ? null + : NSMutableArray.fromPointer($ret, retain: false, release: true); + } + + /// initWithContentsOfURL: + NSMutableArray? initWithContentsOfURL(NSURL url) { + final _$$ref = object$.ref; + final _$$ref$1 = url.ref; + final $ret = _objc_msgSend_1sotr3r( + _$$ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, + _$$ref$1.pointer, + ); + return $ret.address == 0 + ? null + : NSMutableArray.fromPointer($ret, retain: false, release: true); + } + + /// arrayWithContentsOfFile: + static NSMutableArray? arrayWithContentsOfFile(NSString path) { + final _$$ref = path.ref; + final $ret = _objc_msgSend_1sotr3r( + _class_NSMutableArray, + _sel_arrayWithContentsOfFile_, + _$$ref.pointer, + ); + return $ret.address == 0 + ? null + : NSMutableArray.fromPointer($ret, retain: true, release: true); + } + + /// arrayWithContentsOfURL: + static NSMutableArray? arrayWithContentsOfURL(NSURL url) { + final _$$ref = url.ref; + final $ret = _objc_msgSend_1sotr3r( + _class_NSMutableArray, + _sel_arrayWithContentsOfURL_, + _$$ref.pointer, + ); + return $ret.address == 0 + ? null + : NSMutableArray.fromPointer($ret, retain: true, release: true); + } +} + /// NSMutableCopying extension type NSMutableCopying._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { @@ -12270,6 +12746,9 @@ extension NSMutableData$Methods on NSMutableData { } } +/// NSMutableDataCreation +extension NSMutableDataCreation on NSMutableData {} + /// NSMutableDictionary extension type NSMutableDictionary._(objc.ObjCObject object$) implements objc.ObjCObject, NSDictionary { @@ -12576,6 +13055,63 @@ extension NSMutableDictionary$Methods on NSMutableDictionary { } } +/// NSMutableDictionaryCreation +extension NSMutableDictionaryCreation on NSMutableDictionary { + /// initWithContentsOfFile: + NSMutableDictionary? initWithContentsOfFile(NSString path) { + final _$$ref = object$.ref; + final _$$ref$1 = path.ref; + final $ret = _objc_msgSend_1sotr3r( + _$$ref.retainAndReturnPointer(), + _sel_initWithContentsOfFile_, + _$$ref$1.pointer, + ); + return $ret.address == 0 + ? null + : NSMutableDictionary.fromPointer($ret, retain: false, release: true); + } + + /// initWithContentsOfURL: + NSMutableDictionary? initWithContentsOfURL(NSURL url) { + final _$$ref = object$.ref; + final _$$ref$1 = url.ref; + final $ret = _objc_msgSend_1sotr3r( + _$$ref.retainAndReturnPointer(), + _sel_initWithContentsOfURL_, + _$$ref$1.pointer, + ); + return $ret.address == 0 + ? null + : NSMutableDictionary.fromPointer($ret, retain: false, release: true); + } + + /// dictionaryWithContentsOfFile: + static NSMutableDictionary? dictionaryWithContentsOfFile(NSString path) { + final _$$ref = path.ref; + final $ret = _objc_msgSend_1sotr3r( + _class_NSMutableDictionary, + _sel_dictionaryWithContentsOfFile_, + _$$ref.pointer, + ); + return $ret.address == 0 + ? null + : NSMutableDictionary.fromPointer($ret, retain: true, release: true); + } + + /// dictionaryWithContentsOfURL: + static NSMutableDictionary? dictionaryWithContentsOfURL(NSURL url) { + final _$$ref = url.ref; + final $ret = _objc_msgSend_1sotr3r( + _class_NSMutableDictionary, + _sel_dictionaryWithContentsOfURL_, + _$$ref.pointer, + ); + return $ret.address == 0 + ? null + : NSMutableDictionary.fromPointer($ret, retain: true, release: true); + } +} + /// NSMutableIndexSet extension type NSMutableIndexSet._(objc.ObjCObject object$) implements objc.ObjCObject, NSIndexSet { @@ -13347,6 +13883,9 @@ extension NSMutableOrderedSet$Methods on NSMutableOrderedSet { } } +/// NSMutableOrderedSetCreation +extension NSMutableOrderedSetCreation on NSMutableOrderedSet {} + /// NSMutableSet extension type NSMutableSet._(objc.ObjCObject object$) implements objc.ObjCObject, NSSet { @@ -13605,6 +14144,9 @@ extension NSMutableSet$Methods on NSMutableSet { } } +/// NSMutableSetCreation +extension NSMutableSetCreation on NSMutableSet {} + /// NSMutableString extension type NSMutableString._(objc.ObjCObject object$) implements objc.ObjCObject, NSString { @@ -14496,6 +15038,9 @@ extension NSNotification$Methods on NSNotification { } } +/// NSNotificationCreation +extension NSNotificationCreation on NSNotification {} + /// NSNull extension type NSNull._(objc.ObjCObject object$) implements objc.ObjCObject, NSObject, NSCopying, NSSecureCoding { @@ -18088,6 +18633,9 @@ extension NSOrderedSet$Methods on NSOrderedSet { } } +/// NSOrderedSetCreation +extension NSOrderedSetCreation on NSOrderedSet {} + /// NSOutputStream extension type NSOutputStream._(objc.ObjCObject object$) implements objc.ObjCObject, NSStream { @@ -18297,6 +18845,9 @@ extension NSOutputStream$Methods on NSOutputStream { } } +/// NSOutputStreamExtensions +extension NSOutputStreamExtensions on NSOutputStream {} + /// NSPort extension type NSPort._(objc.ObjCObject object$) implements objc.ObjCObject, NSObject, NSCopying, NSCoding { @@ -20456,6 +21007,9 @@ extension NSSet$Methods on NSSet { } } +/// NSSetCreation +extension NSSetCreation on NSSet {} + sealed class NSSortOptions { static const NSSortConcurrent = 1; static const NSSortStable = 16; @@ -28319,6 +28873,238 @@ extension ObjCBlock_ffiVoid_NSData_NSError$CallExtension } } +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_NSDictionary_NSRange_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + > + fromPointer( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) => + objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, 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(NSDictionary, NSRange, ffi.Pointer) + > + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) + > + > + ptr, + ) => + objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + >( + objc.newPointerBlock(_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. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + > + fromFunction( + void Function(NSDictionary, NSRange, ffi.Pointer) fn, { + bool keepIsolateAlive = true, + }) => + objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + >( + objc.newClosureBlock(_closureCallable, ( + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) { + return fn( + NSDictionary.fromPointer(arg0, retain: true, release: true), + arg1, + arg2, + ); + }, keepIsolateAlive), + retain: false, + release: true, + ); + + /// Creates a listener block from a Dart function. + /// + /// This block can be invoked from any thread, but only supports void + /// functions, and is not run synchronously. Async functions (ie returning + /// Future) are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + > + listener( + void Function(NSDictionary, NSRange, ffi.Pointer) fn, { + bool keepIsolateAlive = true, + }) { + return objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + >( + objc.newBlockPort(_1wx624s_wrapListenerBlock_1a22wz, ( + ffi.Pointer rawArgs, + ) { + final args = _BlockArgs_v8in3.fromPointer( + rawArgs, + retain: false, + release: false, + ); + + fn(args.arg0, args.arg1, args.arg2); + }, keepIsolateAlive), + retain: false, + release: true, + ); + } + + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions (ie returning Future) are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + > + blocking( + void Function(NSDictionary, NSRange, ffi.Pointer) fn, { + bool keepIsolateAlive = true, + }) { + return objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + >( + objc.newBlockingBlockPort(_1wx624s_wrapBlockingBlock_1a22wz, ( + ffi.Pointer rawArgs, + ) { + final args = _BlockArgs_v8in3.fromPointer( + rawArgs, + retain: false, + release: false, + ); + + fn(args.arg0, args.arg1, args.arg2); + }, keepIsolateAlive), + retain: false, + release: true, + ); + } + + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + NSRange, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + NSRange, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_NSDictionary_NSRange_bool$CallExtension + on + objc.ObjCBlock< + ffi.Void Function(NSDictionary, NSRange, ffi.Pointer) + > { + void call(NSDictionary arg0, NSRange arg1, ffi.Pointer arg2) { + final _$$ref = arg0.ref; + return ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ) + >()(ref.pointer, _$$ref.pointer, arg1, arg2); + } +} + /// Construction methods for `objc.ObjCBlock?, NSError)>, ffi.Pointer, NSDictionary)>`. abstract final class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_objcObjCObjectImpl_NSDictionary { /// Returns a block that wraps the given raw block pointer. @@ -32553,6 +33339,284 @@ extension ObjCBlock_ffiVoid_idNSSecureCoding_NSError$CallExtension } } +/// Construction methods for `objc.ObjCBlock?, NSRange, ffi.Pointer)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObjectImpl_NSRange_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + > + fromPointer( + ffi.Pointer pointer, { + bool retain = false, + bool release = false, + }) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + 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.Pointer?, + NSRange, + ffi.Pointer, + ) + > + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) + > + > + ptr, + ) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + >( + objc.newPointerBlock(_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. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + > + fromFunction( + void Function(objc.ObjCObject?, NSRange, ffi.Pointer) fn, { + bool keepIsolateAlive = true, + }) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + >( + objc.newClosureBlock(_closureCallable, ( + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) { + return fn( + arg0.address == 0 + ? null + : objc.ObjCObject(arg0, retain: true, release: true), + arg1, + arg2, + ); + }, keepIsolateAlive), + retain: false, + release: true, + ); + + /// Creates a listener block from a Dart function. + /// + /// This block can be invoked from any thread, but only supports void + /// functions, and is not run synchronously. Async functions (ie returning + /// Future) are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + > + listener( + void Function(objc.ObjCObject?, NSRange, ffi.Pointer) fn, { + bool keepIsolateAlive = true, + }) { + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + >( + objc.newBlockPort(_1wx624s_wrapListenerBlock_1a22wz, ( + ffi.Pointer rawArgs, + ) { + final args = _BlockArgs_q6fcam.fromPointer( + rawArgs, + retain: false, + release: false, + ); + + fn(args.arg0, args.arg1, args.arg2); + }, keepIsolateAlive), + retain: false, + release: true, + ); + } + + /// Creates a blocking block from a Dart function. + /// + /// This callback can be invoked from any native thread, and will block the + /// caller until the callback is handled by the Dart isolate that created + /// the block. Async functions (ie returning Future) are not supported. + /// + /// If `keepIsolateAlive` is true, this block will keep this isolate alive + /// until it is garbage collected by both Dart and ObjC. If the owner isolate + /// has shut down, and the block is invoked by native code, it may block + /// indefinitely, or have other undefined behavior. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + > + blocking( + void Function(objc.ObjCObject?, NSRange, ffi.Pointer) fn, { + bool keepIsolateAlive = true, + }) { + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + >( + objc.newBlockingBlockPort(_1wx624s_wrapBlockingBlock_1a22wz, ( + ffi.Pointer rawArgs, + ) { + final args = _BlockArgs_q6fcam.fromPointer( + rawArgs, + retain: false, + release: false, + ); + + fn(args.arg0, args.arg1, args.arg2); + }, keepIsolateAlive), + retain: false, + release: true, + ); + } + + static void _fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + NSRange, + ffi.Pointer, + ) + >()(arg0, arg1, arg2); + static ffi.Pointer _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ) + >(_fnPtrTrampoline) + .cast(); + static void _closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer, + NSRange, + ffi.Pointer, + ))(arg0, arg1, arg2); + static ffi.Pointer _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ) + >(_closureTrampoline) + .cast(); +} + +/// Call operator for `objc.ObjCBlock?, NSRange, ffi.Pointer)>`. +extension ObjCBlock_ffiVoid_objcObjCObjectImpl_NSRange_bool$CallExtension + on + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer?, + NSRange, + ffi.Pointer, + ) + > { + void call(objc.ObjCObject? arg0, NSRange arg1, ffi.Pointer arg2) { + final _$$ref = arg0?.ref; + return ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + NSRange arg1, + ffi.Pointer arg2, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + ffi.Pointer, + ) + >()(ref.pointer, _$$ref?.pointer ?? ffi.nullptr, arg1, arg2); + } +} + /// Construction methods for `objc.ObjCBlock, ffi.UnsignedLong, ffi.Pointer)>`. abstract final class ObjCBlock_ffiVoid_objcObjCObjectImpl_ffiUnsignedLong_bool { /// Returns a block that wraps the given raw block pointer. @@ -35525,6 +36589,52 @@ extension _BlockArgs_ounrb4$Methods on _BlockArgs_ounrb4 { } } +extension type _BlockArgs_q6fcam._(objc.ObjCObject object$) + implements objc.ObjCObject { + /// Constructs a [_BlockArgs_q6fcam] that points to the same underlying object as [other]. + _BlockArgs_q6fcam.as(objc.ObjCObject other) : object$ = other { + assert(isA(object$)); + } + + /// Constructs a [_BlockArgs_q6fcam] that wraps the given raw object pointer. + _BlockArgs_q6fcam.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + assert(isA(object$)); + } + + /// Returns whether [obj] is an instance of [_BlockArgs_q6fcam]. + static bool isA(objc.ObjCObject? obj) => obj == null + ? false + : _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class__BlockArgs_q6fcam, + ); +} + +extension _BlockArgs_q6fcam$Methods on _BlockArgs_q6fcam { + objc.ObjCObject? get arg0 { + final _$$ref = object$.ref; + final $ret = _objc_msgSend_151sglz(_$$ref.pointer, _sel_arg0); + return $ret.address == 0 + ? null + : objc.ObjCObject($ret, retain: true, release: true); + } + + NSRange get arg1 { + final _$$ref = object$.ref; + return _objc_msgSend_1u11dbb(_$$ref.pointer, _sel_arg1); + } + + ffi.Pointer get arg2 { + final _$$ref = object$.ref; + return _objc_msgSend_1sbro63(_$$ref.pointer, _sel_arg2); + } +} + extension type _BlockArgs_uckb5m._(objc.ObjCObject object$) implements objc.ObjCObject { /// Constructs a [_BlockArgs_uckb5m] that points to the same underlying object as [other]. @@ -35563,6 +36673,50 @@ extension _BlockArgs_uckb5m$Methods on _BlockArgs_uckb5m { } } +extension type _BlockArgs_v8in3._(objc.ObjCObject object$) + implements objc.ObjCObject { + /// Constructs a [_BlockArgs_v8in3] that points to the same underlying object as [other]. + _BlockArgs_v8in3.as(objc.ObjCObject other) : object$ = other { + assert(isA(object$)); + } + + /// Constructs a [_BlockArgs_v8in3] that wraps the given raw object pointer. + _BlockArgs_v8in3.fromPointer( + ffi.Pointer other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + assert(isA(object$)); + } + + /// Returns whether [obj] is an instance of [_BlockArgs_v8in3]. + static bool isA(objc.ObjCObject? obj) => obj == null + ? false + : _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class__BlockArgs_v8in3, + ); +} + +extension _BlockArgs_v8in3$Methods on _BlockArgs_v8in3 { + NSDictionary get arg0 { + final _$$ref = object$.ref; + final $ret = _objc_msgSend_151sglz(_$$ref.pointer, _sel_arg0); + return NSDictionary.fromPointer($ret, retain: true, release: true); + } + + NSRange get arg1 { + final _$$ref = object$.ref; + return _objc_msgSend_1u11dbb(_$$ref.pointer, _sel_arg1); + } + + ffi.Pointer get arg2 { + final _$$ref = object$.ref; + return _objc_msgSend_1sbro63(_$$ref.pointer, _sel_arg2); + } +} + extension type _BlockArgs_wnzfgp._(objc.ObjCObject object$) implements objc.ObjCObject { /// Constructs a [_BlockArgs_wnzfgp] that points to the same underlying object as [other]. @@ -36311,6 +37465,16 @@ final _class__BlockArgs_ounrb4 = objc.getClass( _class__BlockArgs_ounrb4_raw, ).cast(), ); +@ffi.Native>( + symbol: 'OBJC_CLASS_\$__1wx624s_BlockArgs_1a22wz', +) +external ffi.Pointer _class__BlockArgs_q6fcam_raw; +final _class__BlockArgs_q6fcam = objc.getClass( + "_1wx624s_BlockArgs_1a22wz", + () => ffi.Native.addressOf>( + _class__BlockArgs_q6fcam_raw, + ).cast(), +); @ffi.Native>( symbol: 'OBJC_CLASS_\$__1wx624s_BlockArgs_zkjmn1', ) @@ -36321,6 +37485,16 @@ final _class__BlockArgs_uckb5m = objc.getClass( _class__BlockArgs_uckb5m_raw, ).cast(), ); +@ffi.Native>( + symbol: 'OBJC_CLASS_\$__1wx624s_BlockArgs_1a22wz', +) +external ffi.Pointer _class__BlockArgs_v8in3_raw; +final _class__BlockArgs_v8in3 = objc.getClass( + "_1wx624s_BlockArgs_1a22wz", + () => ffi.Native.addressOf>( + _class__BlockArgs_v8in3_raw, + ).cast(), +); @ffi.Native>( symbol: 'OBJC_CLASS_\$__1wx624s_BlockArgs_t8l8el', ) @@ -37622,6 +38796,29 @@ final _objc_msgSend_1k101e3 = objc.msgSendPointer ffi.Pointer, ) >(); +final _objc_msgSend_1k1akuq = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + NSRange, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + NSRange, + ) + >(); final _objc_msgSend_1k1o1s7 = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -37692,6 +38889,27 @@ final _objc_msgSend_1ko4qka = objc.msgSendPointer ffi.Pointer, ) >(); +final _objc_msgSend_1kok4b = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + NSUInteger, + ffi.Pointer, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + NSRange, + int, + ffi.Pointer, + ) + >(); final _objc_msgSend_1lbgrac = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -38073,6 +39291,27 @@ final _objc_msgSend_1pnyuds = objc.msgSendPointer ffi.Pointer>, ) >(); +final _objc_msgSend_1pp2gs8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + NSRange, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + NSRange, + ) + >(); final _objc_msgSend_1q30cs4 = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -38923,6 +40162,27 @@ final _objc_msgSend_7g3u2y = objc.msgSendPointer int, ) >(); +final _objc_msgSend_7km9vu = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ) + >(); final _objc_msgSend_7kpg7m = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -39678,6 +40938,29 @@ final _objc_msgSend_i30zh3 = objc.msgSendPointer ffi.Pointer, ) >(); +final _objc_msgSend_ipgwfh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange, + NSUInteger, + ffi.Pointer, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSRange, + int, + ffi.Pointer, + ) + >(); final _objc_msgSend_jjgvjt = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -40596,6 +41879,23 @@ final _objc_msgSend_xw2lbc = objc.msgSendPointer ffi.Pointer, ) >(); +final _objc_msgSend_ylninc = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + ) + > + >() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ) + >(); final _objc_msgSend_yx8yc6 = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -40859,19 +42159,47 @@ late final _sel_arrayByAddingObjectsFromArray_ = objc.registerName( ); late final _sel_arrayWithArray_ = objc.registerName("arrayWithArray:"); late final _sel_arrayWithCapacity_ = objc.registerName("arrayWithCapacity:"); +late final _sel_arrayWithContentsOfFile_ = objc.registerName( + "arrayWithContentsOfFile:", +); +late final _sel_arrayWithContentsOfURL_ = objc.registerName( + "arrayWithContentsOfURL:", +); +late final _sel_arrayWithContentsOfURL_error_ = objc.registerName( + "arrayWithContentsOfURL:error:", +); late final _sel_arrayWithObject_ = objc.registerName("arrayWithObject:"); late final _sel_arrayWithObjects_ = objc.registerName("arrayWithObjects:"); late final _sel_arrayWithObjects_count_ = objc.registerName( "arrayWithObjects:count:", ); late final _sel_associatedIndex = objc.registerName("associatedIndex"); +late final _sel_attribute_atIndex_effectiveRange_ = objc.registerName( + "attribute:atIndex:effectiveRange:", +); +late final _sel_attribute_atIndex_longestEffectiveRange_inRange_ = objc + .registerName("attribute:atIndex:longestEffectiveRange:inRange:"); +late final _sel_attributedSubstringFromRange_ = objc.registerName( + "attributedSubstringFromRange:", +); late final _sel_attributesAtIndex_effectiveRange_ = objc.registerName( "attributesAtIndex:effectiveRange:", ); +late final _sel_attributesAtIndex_longestEffectiveRange_inRange_ = objc + .registerName("attributesAtIndex:longestEffectiveRange:inRange:"); late final _sel_autorelease = objc.registerName("autorelease"); +late final _sel_autoupdatingCurrentLocale = objc.registerName( + "autoupdatingCurrentLocale", +); late final _sel_availableStringEncodings = objc.registerName( "availableStringEncodings", ); +late final _sel_base64EncodedDataWithOptions_ = objc.registerName( + "base64EncodedDataWithOptions:", +); +late final _sel_base64EncodedStringWithOptions_ = objc.registerName( + "base64EncodedStringWithOptions:", +); late final _sel_baseURL = objc.registerName("baseURL"); late final _sel_becomeCurrentWithPendingUnitCount_ = objc.registerName( "becomeCurrentWithPendingUnitCount:", @@ -40989,6 +42317,7 @@ late final _sel_countByEnumeratingWithState_objects_count_ = objc.registerName( late final _sel_countOfIndexesInRange_ = objc.registerName( "countOfIndexesInRange:", ); +late final _sel_currentLocale = objc.registerName("currentLocale"); late final _sel_currentMode = objc.registerName("currentMode"); late final _sel_currentProgress = objc.registerName("currentProgress"); late final _sel_currentRunLoop = objc.registerName("currentRunLoop"); @@ -41081,6 +42410,15 @@ late final _sel_dictionary = objc.registerName("dictionary"); late final _sel_dictionaryWithCapacity_ = objc.registerName( "dictionaryWithCapacity:", ); +late final _sel_dictionaryWithContentsOfFile_ = objc.registerName( + "dictionaryWithContentsOfFile:", +); +late final _sel_dictionaryWithContentsOfURL_ = objc.registerName( + "dictionaryWithContentsOfURL:", +); +late final _sel_dictionaryWithContentsOfURL_error_ = objc.registerName( + "dictionaryWithContentsOfURL:error:", +); late final _sel_dictionaryWithDictionary_ = objc.registerName( "dictionaryWithDictionary:", ); @@ -41105,6 +42443,8 @@ late final _sel_discreteProgressWithTotalUnitCount_ = objc.registerName( late final _sel_displayNameForKey_value_ = objc.registerName( "displayNameForKey:value:", ); +late final _sel_distantFuture = objc.registerName("distantFuture"); +late final _sel_distantPast = objc.registerName("distantPast"); late final _sel_doesNotRecognizeSelector_ = objc.registerName( "doesNotRecognizeSelector:", ); @@ -41116,6 +42456,10 @@ late final _sel_encodeValueOfObjCType_at_ = objc.registerName( "encodeValueOfObjCType:at:", ); late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); +late final _sel_enumerateAttribute_inRange_options_usingBlock_ = objc + .registerName("enumerateAttribute:inRange:options:usingBlock:"); +late final _sel_enumerateAttributesInRange_options_usingBlock_ = objc + .registerName("enumerateAttributesInRange:options:usingBlock:"); late final _sel_enumerateByteRangesUsingBlock_ = objc.registerName( "enumerateByteRangesUsingBlock:", ); @@ -41447,6 +42791,9 @@ late final _sel_initWithContentsOfURL_ = objc.registerName( late final _sel_initWithContentsOfURL_encoding_error_ = objc.registerName( "initWithContentsOfURL:encoding:error:", ); +late final _sel_initWithContentsOfURL_error_ = objc.registerName( + "initWithContentsOfURL:error:", +); late final _sel_initWithContentsOfURL_options_error_ = objc.registerName( "initWithContentsOfURL:options:error:", ); @@ -41661,6 +43008,9 @@ late final _sel_isBool = objc.registerName("isBool"); late final _sel_isCancellable = objc.registerName("isCancellable"); late final _sel_isCancelled = objc.registerName("isCancelled"); late final _sel_isEqualToArray_ = objc.registerName("isEqualToArray:"); +late final _sel_isEqualToAttributedString_ = objc.registerName( + "isEqualToAttributedString:", +); late final _sel_isEqualToData_ = objc.registerName("isEqualToData:"); late final _sel_isEqualToDate_ = objc.registerName("isEqualToDate:"); late final _sel_isEqualToDictionary_ = objc.registerName( @@ -41872,6 +43222,7 @@ late final _sel_notificationWithName_object_ = objc.registerName( late final _sel_notificationWithName_object_userInfo_ = objc.registerName( "notificationWithName:object:userInfo:", ); +late final _sel_now = objc.registerName("now"); late final _sel_null = objc.registerName("null"); late final _sel_numberOfArguments = objc.registerName("numberOfArguments"); late final _sel_numberWithBool_ = objc.registerName("numberWithBool:"); @@ -42424,6 +43775,7 @@ late final _sel_supportsSecureCoding = objc.registerName( "supportsSecureCoding", ); late final _sel_symbolCharacterSet = objc.registerName("symbolCharacterSet"); +late final _sel_systemLocale = objc.registerName("systemLocale"); late final _sel_target = objc.registerName("target"); late final _sel_throughput = objc.registerName("throughput"); late final _sel_timeInterval = objc.registerName("timeInterval"); diff --git a/pkgs/objective_c/lib/src/version_check.dart b/pkgs/objective_c/lib/src/version_check.dart index 37e06cbdc1..5f84282e0d 100644 --- a/pkgs/objective_c/lib/src/version_check.dart +++ b/pkgs/objective_c/lib/src/version_check.dart @@ -9,7 +9,7 @@ class ObjCVersionCheck { static const int actualMajorVersion = 9; @visibleForTesting - static const int actualMinorVersion = 5; + static const int actualMinorVersion = 6; const ObjCVersionCheck(int major, int minor) : assert( diff --git a/pkgs/objective_c/pubspec.yaml b/pkgs/objective_c/pubspec.yaml index 9748d1808c..37c744f2fa 100644 --- a/pkgs/objective_c/pubspec.yaml +++ b/pkgs/objective_c/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: objective_c description: 'A library to access Objective C from Flutter that acts as a support library for package:ffigen.' -version: 9.5.1-wip +version: 9.6.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/objective_c issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aobjective_c diff --git a/pkgs/objective_c/src/objective_c_bindings_generated.m b/pkgs/objective_c/src/objective_c_bindings_generated.m index 346384e903..858eca2541 100644 --- a/pkgs/objective_c/src/objective_c_bindings_generated.m +++ b/pkgs/objective_c/src/objective_c_bindings_generated.m @@ -294,6 +294,60 @@ _ListenerTrampoline_2 _1wx624s_wrapBlockingBlock_pfv6jd(int64_t port, DOBJC_Cont }); } +__attribute__((visibility("default"))) +@interface _1wx624s_BlockArgs_1a22wz : NSObject +@property (copy) id block; +@property (strong) id arg0; +@property struct _NSRange arg1; +@property BOOL * arg2; +@end +@implementation _1wx624s_BlockArgs_1a22wz +@end + +typedef void (^_ListenerTrampoline_3)(id arg0, struct _NSRange arg1, BOOL * arg2); +__attribute__((visibility("default"))) __attribute__((used)) +_ListenerTrampoline_3 _1wx624s_wrapListenerBlock_1a22wz( + int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { + __block __weak _ListenerTrampoline_3 weakSelfBlock = nil; + _ListenerTrampoline_3 strongSelfBlock = [^void(id arg0, struct _NSRange arg1, BOOL * arg2) { + @autoreleasepool { + _1wx624s_BlockArgs_1a22wz* args = [[_1wx624s_BlockArgs_1a22wz alloc] init]; + args.block = weakSelfBlock; + args.arg0 = arg0; + args.arg1 = arg1; + args.arg2 = arg2; + ctx->invokeListenerPortBlock(port, (__bridge_retained void*)args); + } + } copy]; + weakSelfBlock = strongSelfBlock; + return strongSelfBlock; +} + +typedef void (^_BlockingTrampoline_3)(void * waiter, id arg0, struct _NSRange arg1, BOOL * arg2); +__attribute__((visibility("default"))) __attribute__((used)) +_ListenerTrampoline_3 _1wx624s_wrapBlockingBlock_1a22wz(int64_t port, DOBJC_Context* ctx, + void (*directInvoke)(void*)) NS_RETURNS_RETAINED { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_3, ^void(id arg0, struct _NSRange arg1, BOOL * arg2), { + @autoreleasepool { + _1wx624s_BlockArgs_1a22wz* args = [[_1wx624s_BlockArgs_1a22wz alloc] init]; + args.block = weakSelfBlock; + args.arg0 = arg0; + args.arg1 = arg1; + args.arg2 = arg2; + directInvoke((__bridge_retained void*)args); + } + }, { + @autoreleasepool { + _1wx624s_BlockArgs_1a22wz* args = [[_1wx624s_BlockArgs_1a22wz alloc] init]; + args.block = weakSelfBlock; + args.arg0 = arg0; + args.arg1 = arg1; + args.arg2 = arg2; + ctx->invokeBlockingPortBlock(port, (__bridge_retained void*)args, waiter); + } + }); +} + __attribute__((visibility("default"))) @interface _1wx624s_BlockArgs_1b3bb6a : NSObject @property (copy) id block; @@ -304,12 +358,12 @@ @interface _1wx624s_BlockArgs_1b3bb6a : NSObject @implementation _1wx624s_BlockArgs_1b3bb6a @end -typedef void (^_ListenerTrampoline_3)(id arg0, id arg1, id arg2); +typedef void (^_ListenerTrampoline_4)(id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_3 _1wx624s_wrapListenerBlock_1b3bb6a( +_ListenerTrampoline_4 _1wx624s_wrapListenerBlock_1b3bb6a( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_3 weakSelfBlock = nil; - _ListenerTrampoline_3 strongSelfBlock = [^void(id arg0, id arg1, id arg2) { + __block __weak _ListenerTrampoline_4 weakSelfBlock = nil; + _ListenerTrampoline_4 strongSelfBlock = [^void(id arg0, id arg1, id arg2) { @autoreleasepool { _1wx624s_BlockArgs_1b3bb6a* args = [[_1wx624s_BlockArgs_1b3bb6a alloc] init]; args.block = weakSelfBlock; @@ -323,11 +377,11 @@ _ListenerTrampoline_3 _1wx624s_wrapListenerBlock_1b3bb6a( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_3)(void * waiter, id arg0, id arg1, id arg2); +typedef void (^_BlockingTrampoline_4)(void * waiter, id arg0, id arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_3 _1wx624s_wrapBlockingBlock_1b3bb6a(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_4 _1wx624s_wrapBlockingBlock_1b3bb6a(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_3, ^void(id arg0, id arg1, id arg2), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_4, ^void(id arg0, id arg1, id arg2), { @autoreleasepool { _1wx624s_BlockArgs_1b3bb6a* args = [[_1wx624s_BlockArgs_1b3bb6a alloc] init]; args.block = weakSelfBlock; @@ -357,12 +411,12 @@ @interface _1wx624s_BlockArgs_zkjmn1 : NSObject @implementation _1wx624s_BlockArgs_zkjmn1 @end -typedef void (^_ListenerTrampoline_4)(struct _NSRange arg0, BOOL * arg1); +typedef void (^_ListenerTrampoline_5)(struct _NSRange arg0, BOOL * arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_4 _1wx624s_wrapListenerBlock_zkjmn1( +_ListenerTrampoline_5 _1wx624s_wrapListenerBlock_zkjmn1( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_4 weakSelfBlock = nil; - _ListenerTrampoline_4 strongSelfBlock = [^void(struct _NSRange arg0, BOOL * arg1) { + __block __weak _ListenerTrampoline_5 weakSelfBlock = nil; + _ListenerTrampoline_5 strongSelfBlock = [^void(struct _NSRange arg0, BOOL * arg1) { @autoreleasepool { _1wx624s_BlockArgs_zkjmn1* args = [[_1wx624s_BlockArgs_zkjmn1 alloc] init]; args.block = weakSelfBlock; @@ -375,11 +429,11 @@ _ListenerTrampoline_4 _1wx624s_wrapListenerBlock_zkjmn1( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_4)(void * waiter, struct _NSRange arg0, BOOL * arg1); +typedef void (^_BlockingTrampoline_5)(void * waiter, struct _NSRange arg0, BOOL * arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_4 _1wx624s_wrapBlockingBlock_zkjmn1(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_5 _1wx624s_wrapBlockingBlock_zkjmn1(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_4, ^void(struct _NSRange arg0, BOOL * arg1), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_5, ^void(struct _NSRange arg0, BOOL * arg1), { @autoreleasepool { _1wx624s_BlockArgs_zkjmn1* args = [[_1wx624s_BlockArgs_zkjmn1 alloc] init]; args.block = weakSelfBlock; @@ -409,12 +463,12 @@ @interface _1wx624s_BlockArgs_lmc3p5 : NSObject @implementation _1wx624s_BlockArgs_lmc3p5 @end -typedef void (^_ListenerTrampoline_5)(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); +typedef void (^_ListenerTrampoline_6)(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_5 _1wx624s_wrapListenerBlock_lmc3p5( +_ListenerTrampoline_6 _1wx624s_wrapListenerBlock_lmc3p5( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_5 weakSelfBlock = nil; - _ListenerTrampoline_5 strongSelfBlock = [^void(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3) { + __block __weak _ListenerTrampoline_6 weakSelfBlock = nil; + _ListenerTrampoline_6 strongSelfBlock = [^void(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3) { @autoreleasepool { _1wx624s_BlockArgs_lmc3p5* args = [[_1wx624s_BlockArgs_lmc3p5 alloc] init]; args.block = weakSelfBlock; @@ -429,11 +483,11 @@ _ListenerTrampoline_5 _1wx624s_wrapListenerBlock_lmc3p5( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_5)(void * waiter, id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); +typedef void (^_BlockingTrampoline_6)(void * waiter, id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_5 _1wx624s_wrapBlockingBlock_lmc3p5(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_6 _1wx624s_wrapBlockingBlock_lmc3p5(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_5, ^void(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_6, ^void(id arg0, struct _NSRange arg1, struct _NSRange arg2, BOOL * arg3), { @autoreleasepool { _1wx624s_BlockArgs_lmc3p5* args = [[_1wx624s_BlockArgs_lmc3p5 alloc] init]; args.block = weakSelfBlock; @@ -465,12 +519,12 @@ @interface _1wx624s_BlockArgs_t8l8el : NSObject @implementation _1wx624s_BlockArgs_t8l8el @end -typedef void (^_ListenerTrampoline_6)(id arg0, BOOL * arg1); +typedef void (^_ListenerTrampoline_7)(id arg0, BOOL * arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_6 _1wx624s_wrapListenerBlock_t8l8el( +_ListenerTrampoline_7 _1wx624s_wrapListenerBlock_t8l8el( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_6 weakSelfBlock = nil; - _ListenerTrampoline_6 strongSelfBlock = [^void(id arg0, BOOL * arg1) { + __block __weak _ListenerTrampoline_7 weakSelfBlock = nil; + _ListenerTrampoline_7 strongSelfBlock = [^void(id arg0, BOOL * arg1) { @autoreleasepool { _1wx624s_BlockArgs_t8l8el* args = [[_1wx624s_BlockArgs_t8l8el alloc] init]; args.block = weakSelfBlock; @@ -483,11 +537,11 @@ _ListenerTrampoline_6 _1wx624s_wrapListenerBlock_t8l8el( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_6)(void * waiter, id arg0, BOOL * arg1); +typedef void (^_BlockingTrampoline_7)(void * waiter, id arg0, BOOL * arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_6 _1wx624s_wrapBlockingBlock_t8l8el(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_7 _1wx624s_wrapBlockingBlock_t8l8el(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_6, ^void(id arg0, BOOL * arg1), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_7, ^void(id arg0, BOOL * arg1), { @autoreleasepool { _1wx624s_BlockArgs_t8l8el* args = [[_1wx624s_BlockArgs_t8l8el alloc] init]; args.block = weakSelfBlock; @@ -514,12 +568,12 @@ @interface _1wx624s_BlockArgs_xtuoz7 : NSObject @implementation _1wx624s_BlockArgs_xtuoz7 @end -typedef void (^_ListenerTrampoline_7)(id arg0); +typedef void (^_ListenerTrampoline_8)(id arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_7 _1wx624s_wrapListenerBlock_xtuoz7( +_ListenerTrampoline_8 _1wx624s_wrapListenerBlock_xtuoz7( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_7 weakSelfBlock = nil; - _ListenerTrampoline_7 strongSelfBlock = [^void(id arg0) { + __block __weak _ListenerTrampoline_8 weakSelfBlock = nil; + _ListenerTrampoline_8 strongSelfBlock = [^void(id arg0) { @autoreleasepool { _1wx624s_BlockArgs_xtuoz7* args = [[_1wx624s_BlockArgs_xtuoz7 alloc] init]; args.block = weakSelfBlock; @@ -531,11 +585,11 @@ _ListenerTrampoline_7 _1wx624s_wrapListenerBlock_xtuoz7( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_7)(void * waiter, id arg0); +typedef void (^_BlockingTrampoline_8)(void * waiter, id arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_7 _1wx624s_wrapBlockingBlock_xtuoz7(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_8 _1wx624s_wrapBlockingBlock_xtuoz7(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_7, ^void(id arg0), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_8, ^void(id arg0), { @autoreleasepool { _1wx624s_BlockArgs_xtuoz7* args = [[_1wx624s_BlockArgs_xtuoz7 alloc] init]; args.block = weakSelfBlock; @@ -561,12 +615,12 @@ @interface _1wx624s_BlockArgs_q5jeyk : NSObject @implementation _1wx624s_BlockArgs_q5jeyk @end -typedef void (^_ListenerTrampoline_8)(unsigned long arg0, BOOL * arg1); +typedef void (^_ListenerTrampoline_9)(unsigned long arg0, BOOL * arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_8 _1wx624s_wrapListenerBlock_q5jeyk( +_ListenerTrampoline_9 _1wx624s_wrapListenerBlock_q5jeyk( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_8 weakSelfBlock = nil; - _ListenerTrampoline_8 strongSelfBlock = [^void(unsigned long arg0, BOOL * arg1) { + __block __weak _ListenerTrampoline_9 weakSelfBlock = nil; + _ListenerTrampoline_9 strongSelfBlock = [^void(unsigned long arg0, BOOL * arg1) { @autoreleasepool { _1wx624s_BlockArgs_q5jeyk* args = [[_1wx624s_BlockArgs_q5jeyk alloc] init]; args.block = weakSelfBlock; @@ -579,11 +633,11 @@ _ListenerTrampoline_8 _1wx624s_wrapListenerBlock_q5jeyk( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_8)(void * waiter, unsigned long arg0, BOOL * arg1); +typedef void (^_BlockingTrampoline_9)(void * waiter, unsigned long arg0, BOOL * arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_8 _1wx624s_wrapBlockingBlock_q5jeyk(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_9 _1wx624s_wrapBlockingBlock_q5jeyk(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_8, ^void(unsigned long arg0, BOOL * arg1), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_9, ^void(unsigned long arg0, BOOL * arg1), { @autoreleasepool { _1wx624s_BlockArgs_q5jeyk* args = [[_1wx624s_BlockArgs_q5jeyk alloc] init]; args.block = weakSelfBlock; @@ -612,12 +666,12 @@ @interface _1wx624s_BlockArgs_rnu2c5 : NSObject @implementation _1wx624s_BlockArgs_rnu2c5 @end -typedef void (^_ListenerTrampoline_9)(id arg0, BOOL arg1, id arg2); +typedef void (^_ListenerTrampoline_10)(id arg0, BOOL arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_9 _1wx624s_wrapListenerBlock_rnu2c5( +_ListenerTrampoline_10 _1wx624s_wrapListenerBlock_rnu2c5( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_9 weakSelfBlock = nil; - _ListenerTrampoline_9 strongSelfBlock = [^void(id arg0, BOOL arg1, id arg2) { + __block __weak _ListenerTrampoline_10 weakSelfBlock = nil; + _ListenerTrampoline_10 strongSelfBlock = [^void(id arg0, BOOL arg1, id arg2) { @autoreleasepool { _1wx624s_BlockArgs_rnu2c5* args = [[_1wx624s_BlockArgs_rnu2c5 alloc] init]; args.block = weakSelfBlock; @@ -631,11 +685,11 @@ _ListenerTrampoline_9 _1wx624s_wrapListenerBlock_rnu2c5( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_9)(void * waiter, id arg0, BOOL arg1, id arg2); +typedef void (^_BlockingTrampoline_10)(void * waiter, id arg0, BOOL arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_9 _1wx624s_wrapBlockingBlock_rnu2c5(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_10 _1wx624s_wrapBlockingBlock_rnu2c5(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_9, ^void(id arg0, BOOL arg1, id arg2), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_10, ^void(id arg0, BOOL arg1, id arg2), { @autoreleasepool { _1wx624s_BlockArgs_rnu2c5* args = [[_1wx624s_BlockArgs_rnu2c5 alloc] init]; args.block = weakSelfBlock; @@ -664,12 +718,12 @@ @interface _1wx624s_BlockArgs_ovsamd : NSObject @implementation _1wx624s_BlockArgs_ovsamd @end -typedef void (^_ListenerTrampoline_10)(void * arg0); +typedef void (^_ListenerTrampoline_11)(void * arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_10 _1wx624s_wrapListenerBlock_ovsamd( +_ListenerTrampoline_11 _1wx624s_wrapListenerBlock_ovsamd( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_10 weakSelfBlock = nil; - _ListenerTrampoline_10 strongSelfBlock = [^void(void * arg0) { + __block __weak _ListenerTrampoline_11 weakSelfBlock = nil; + _ListenerTrampoline_11 strongSelfBlock = [^void(void * arg0) { @autoreleasepool { _1wx624s_BlockArgs_ovsamd* args = [[_1wx624s_BlockArgs_ovsamd alloc] init]; args.block = weakSelfBlock; @@ -681,11 +735,11 @@ _ListenerTrampoline_10 _1wx624s_wrapListenerBlock_ovsamd( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_10)(void * waiter, void * arg0); +typedef void (^_BlockingTrampoline_11)(void * waiter, void * arg0); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_10 _1wx624s_wrapBlockingBlock_ovsamd(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_11 _1wx624s_wrapBlockingBlock_ovsamd(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_10, ^void(void * arg0), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_11, ^void(void * arg0), { @autoreleasepool { _1wx624s_BlockArgs_ovsamd* args = [[_1wx624s_BlockArgs_ovsamd alloc] init]; args.block = weakSelfBlock; @@ -717,12 +771,12 @@ @interface _1wx624s_BlockArgs_18v1jvf : NSObject @implementation _1wx624s_BlockArgs_18v1jvf @end -typedef void (^_ListenerTrampoline_11)(void * arg0, id arg1); +typedef void (^_ListenerTrampoline_12)(void * arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_11 _1wx624s_wrapListenerBlock_18v1jvf( +_ListenerTrampoline_12 _1wx624s_wrapListenerBlock_18v1jvf( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_11 weakSelfBlock = nil; - _ListenerTrampoline_11 strongSelfBlock = [^void(void * arg0, id arg1) { + __block __weak _ListenerTrampoline_12 weakSelfBlock = nil; + _ListenerTrampoline_12 strongSelfBlock = [^void(void * arg0, id arg1) { @autoreleasepool { _1wx624s_BlockArgs_18v1jvf* args = [[_1wx624s_BlockArgs_18v1jvf alloc] init]; args.block = weakSelfBlock; @@ -735,11 +789,11 @@ _ListenerTrampoline_11 _1wx624s_wrapListenerBlock_18v1jvf( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_11)(void * waiter, void * arg0, id arg1); +typedef void (^_BlockingTrampoline_12)(void * waiter, void * arg0, id arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_11 _1wx624s_wrapBlockingBlock_18v1jvf(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_12 _1wx624s_wrapBlockingBlock_18v1jvf(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_11, ^void(void * arg0, id arg1), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_12, ^void(void * arg0, id arg1), { @autoreleasepool { _1wx624s_BlockArgs_18v1jvf* args = [[_1wx624s_BlockArgs_18v1jvf alloc] init]; args.block = weakSelfBlock; @@ -774,12 +828,12 @@ @interface _1wx624s_BlockArgs_1q8ia8l : NSObject @implementation _1wx624s_BlockArgs_1q8ia8l @end -typedef void (^_ListenerTrampoline_12)(void * arg0, struct _NSRange arg1, BOOL * arg2); +typedef void (^_ListenerTrampoline_13)(void * arg0, struct _NSRange arg1, BOOL * arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_12 _1wx624s_wrapListenerBlock_1q8ia8l( +_ListenerTrampoline_13 _1wx624s_wrapListenerBlock_1q8ia8l( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_12 weakSelfBlock = nil; - _ListenerTrampoline_12 strongSelfBlock = [^void(void * arg0, struct _NSRange arg1, BOOL * arg2) { + __block __weak _ListenerTrampoline_13 weakSelfBlock = nil; + _ListenerTrampoline_13 strongSelfBlock = [^void(void * arg0, struct _NSRange arg1, BOOL * arg2) { @autoreleasepool { _1wx624s_BlockArgs_1q8ia8l* args = [[_1wx624s_BlockArgs_1q8ia8l alloc] init]; args.block = weakSelfBlock; @@ -793,11 +847,11 @@ _ListenerTrampoline_12 _1wx624s_wrapListenerBlock_1q8ia8l( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_12)(void * waiter, void * arg0, struct _NSRange arg1, BOOL * arg2); +typedef void (^_BlockingTrampoline_13)(void * waiter, void * arg0, struct _NSRange arg1, BOOL * arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_12 _1wx624s_wrapBlockingBlock_1q8ia8l(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_13 _1wx624s_wrapBlockingBlock_1q8ia8l(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_12, ^void(void * arg0, struct _NSRange arg1, BOOL * arg2), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_13, ^void(void * arg0, struct _NSRange arg1, BOOL * arg2), { @autoreleasepool { _1wx624s_BlockArgs_1q8ia8l* args = [[_1wx624s_BlockArgs_1q8ia8l alloc] init]; args.block = weakSelfBlock; @@ -828,12 +882,12 @@ @interface _1wx624s_BlockArgs_hoampi : NSObject @implementation _1wx624s_BlockArgs_hoampi @end -typedef void (^_ListenerTrampoline_13)(void * arg0, id arg1, NSStreamEvent arg2); +typedef void (^_ListenerTrampoline_14)(void * arg0, id arg1, NSStreamEvent arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_13 _1wx624s_wrapListenerBlock_hoampi( +_ListenerTrampoline_14 _1wx624s_wrapListenerBlock_hoampi( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_13 weakSelfBlock = nil; - _ListenerTrampoline_13 strongSelfBlock = [^void(void * arg0, id arg1, NSStreamEvent arg2) { + __block __weak _ListenerTrampoline_14 weakSelfBlock = nil; + _ListenerTrampoline_14 strongSelfBlock = [^void(void * arg0, id arg1, NSStreamEvent arg2) { @autoreleasepool { _1wx624s_BlockArgs_hoampi* args = [[_1wx624s_BlockArgs_hoampi alloc] init]; args.block = weakSelfBlock; @@ -847,11 +901,11 @@ _ListenerTrampoline_13 _1wx624s_wrapListenerBlock_hoampi( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_13)(void * waiter, void * arg0, id arg1, NSStreamEvent arg2); +typedef void (^_BlockingTrampoline_14)(void * waiter, void * arg0, id arg1, NSStreamEvent arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_13 _1wx624s_wrapBlockingBlock_hoampi(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_14 _1wx624s_wrapBlockingBlock_hoampi(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_13, ^void(void * arg0, id arg1, NSStreamEvent arg2), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_14, ^void(void * arg0, id arg1, NSStreamEvent arg2), { @autoreleasepool { _1wx624s_BlockArgs_hoampi* args = [[_1wx624s_BlockArgs_hoampi alloc] init]; args.block = weakSelfBlock; @@ -890,12 +944,12 @@ @interface _1wx624s_BlockArgs_1sr3ozv : NSObject @implementation _1wx624s_BlockArgs_1sr3ozv @end -typedef void (^_ListenerTrampoline_14)(void * arg0, id arg1, id arg2, id arg3, void * arg4); +typedef void (^_ListenerTrampoline_15)(void * arg0, id arg1, id arg2, id arg3, void * arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_14 _1wx624s_wrapListenerBlock_1sr3ozv( +_ListenerTrampoline_15 _1wx624s_wrapListenerBlock_1sr3ozv( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_14 weakSelfBlock = nil; - _ListenerTrampoline_14 strongSelfBlock = [^void(void * arg0, id arg1, id arg2, id arg3, void * arg4) { + __block __weak _ListenerTrampoline_15 weakSelfBlock = nil; + _ListenerTrampoline_15 strongSelfBlock = [^void(void * arg0, id arg1, id arg2, id arg3, void * arg4) { @autoreleasepool { _1wx624s_BlockArgs_1sr3ozv* args = [[_1wx624s_BlockArgs_1sr3ozv alloc] init]; args.block = weakSelfBlock; @@ -911,11 +965,11 @@ _ListenerTrampoline_14 _1wx624s_wrapListenerBlock_1sr3ozv( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_14)(void * waiter, void * arg0, id arg1, id arg2, id arg3, void * arg4); +typedef void (^_BlockingTrampoline_15)(void * waiter, void * arg0, id arg1, id arg2, id arg3, void * arg4); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_14 _1wx624s_wrapBlockingBlock_1sr3ozv(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_15 _1wx624s_wrapBlockingBlock_1sr3ozv(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_14, ^void(void * arg0, id arg1, id arg2, id arg3, void * arg4), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_15, ^void(void * arg0, id arg1, id arg2, id arg3, void * arg4), { @autoreleasepool { _1wx624s_BlockArgs_1sr3ozv* args = [[_1wx624s_BlockArgs_1sr3ozv alloc] init]; args.block = weakSelfBlock; @@ -955,12 +1009,12 @@ @interface _1wx624s_BlockArgs_zuf90e : NSObject @implementation _1wx624s_BlockArgs_zuf90e @end -typedef void (^_ListenerTrampoline_15)(void * arg0, unsigned long arg1); +typedef void (^_ListenerTrampoline_16)(void * arg0, unsigned long arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_15 _1wx624s_wrapListenerBlock_zuf90e( +_ListenerTrampoline_16 _1wx624s_wrapListenerBlock_zuf90e( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_15 weakSelfBlock = nil; - _ListenerTrampoline_15 strongSelfBlock = [^void(void * arg0, unsigned long arg1) { + __block __weak _ListenerTrampoline_16 weakSelfBlock = nil; + _ListenerTrampoline_16 strongSelfBlock = [^void(void * arg0, unsigned long arg1) { @autoreleasepool { _1wx624s_BlockArgs_zuf90e* args = [[_1wx624s_BlockArgs_zuf90e alloc] init]; args.block = weakSelfBlock; @@ -973,11 +1027,11 @@ _ListenerTrampoline_15 _1wx624s_wrapListenerBlock_zuf90e( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_15)(void * waiter, void * arg0, unsigned long arg1); +typedef void (^_BlockingTrampoline_16)(void * waiter, void * arg0, unsigned long arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_15 _1wx624s_wrapBlockingBlock_zuf90e(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_16 _1wx624s_wrapBlockingBlock_zuf90e(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_15, ^void(void * arg0, unsigned long arg1), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_16, ^void(void * arg0, unsigned long arg1), { @autoreleasepool { _1wx624s_BlockArgs_zuf90e* args = [[_1wx624s_BlockArgs_zuf90e alloc] init]; args.block = weakSelfBlock; @@ -1006,12 +1060,12 @@ @interface _1wx624s_BlockArgs_1p9ui4q : NSObject @implementation _1wx624s_BlockArgs_1p9ui4q @end -typedef void (^_ListenerTrampoline_16)(id arg0, unsigned long arg1, BOOL * arg2); +typedef void (^_ListenerTrampoline_17)(id arg0, unsigned long arg1, BOOL * arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_16 _1wx624s_wrapListenerBlock_1p9ui4q( +_ListenerTrampoline_17 _1wx624s_wrapListenerBlock_1p9ui4q( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_16 weakSelfBlock = nil; - _ListenerTrampoline_16 strongSelfBlock = [^void(id arg0, unsigned long arg1, BOOL * arg2) { + __block __weak _ListenerTrampoline_17 weakSelfBlock = nil; + _ListenerTrampoline_17 strongSelfBlock = [^void(id arg0, unsigned long arg1, BOOL * arg2) { @autoreleasepool { _1wx624s_BlockArgs_1p9ui4q* args = [[_1wx624s_BlockArgs_1p9ui4q alloc] init]; args.block = weakSelfBlock; @@ -1025,11 +1079,11 @@ _ListenerTrampoline_16 _1wx624s_wrapListenerBlock_1p9ui4q( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_16)(void * waiter, id arg0, unsigned long arg1, BOOL * arg2); +typedef void (^_BlockingTrampoline_17)(void * waiter, id arg0, unsigned long arg1, BOOL * arg2); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_16 _1wx624s_wrapBlockingBlock_1p9ui4q(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_17 _1wx624s_wrapBlockingBlock_1p9ui4q(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_16, ^void(id arg0, unsigned long arg1, BOOL * arg2), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_17, ^void(id arg0, unsigned long arg1, BOOL * arg2), { @autoreleasepool { _1wx624s_BlockArgs_1p9ui4q* args = [[_1wx624s_BlockArgs_1p9ui4q alloc] init]; args.block = weakSelfBlock; @@ -1059,12 +1113,12 @@ @interface _1wx624s_BlockArgs_vhbh5h : NSObject @implementation _1wx624s_BlockArgs_vhbh5h @end -typedef void (^_ListenerTrampoline_17)(unsigned short * arg0, unsigned long arg1); +typedef void (^_ListenerTrampoline_18)(unsigned short * arg0, unsigned long arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_17 _1wx624s_wrapListenerBlock_vhbh5h( +_ListenerTrampoline_18 _1wx624s_wrapListenerBlock_vhbh5h( int64_t port, DOBJC_Context* ctx) NS_RETURNS_RETAINED { - __block __weak _ListenerTrampoline_17 weakSelfBlock = nil; - _ListenerTrampoline_17 strongSelfBlock = [^void(unsigned short * arg0, unsigned long arg1) { + __block __weak _ListenerTrampoline_18 weakSelfBlock = nil; + _ListenerTrampoline_18 strongSelfBlock = [^void(unsigned short * arg0, unsigned long arg1) { @autoreleasepool { _1wx624s_BlockArgs_vhbh5h* args = [[_1wx624s_BlockArgs_vhbh5h alloc] init]; args.block = weakSelfBlock; @@ -1077,11 +1131,11 @@ _ListenerTrampoline_17 _1wx624s_wrapListenerBlock_vhbh5h( return strongSelfBlock; } -typedef void (^_BlockingTrampoline_17)(void * waiter, unsigned short * arg0, unsigned long arg1); +typedef void (^_BlockingTrampoline_18)(void * waiter, unsigned short * arg0, unsigned long arg1); __attribute__((visibility("default"))) __attribute__((used)) -_ListenerTrampoline_17 _1wx624s_wrapBlockingBlock_vhbh5h(int64_t port, DOBJC_Context* ctx, +_ListenerTrampoline_18 _1wx624s_wrapBlockingBlock_vhbh5h(int64_t port, DOBJC_Context* ctx, void (*directInvoke)(void*)) NS_RETURNS_RETAINED { - BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_17, ^void(unsigned short * arg0, unsigned long arg1), { + BLOCKING_BLOCK_IMPL(ctx, _ListenerTrampoline_18, ^void(unsigned short * arg0, unsigned long arg1), { @autoreleasepool { _1wx624s_BlockArgs_vhbh5h* args = [[_1wx624s_BlockArgs_vhbh5h alloc] init]; args.block = weakSelfBlock; diff --git a/pkgs/swiftgen/example/avf_audio_bindings.dart b/pkgs/swiftgen/example/avf_audio_bindings.dart index ad7cd06994..15c3f5fba0 100644 --- a/pkgs/swiftgen/example/avf_audio_bindings.dart +++ b/pkgs/swiftgen/example/avf_audio_bindings.dart @@ -12,7 +12,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// WARNING: AVAudioFormatWrapper is a stub. To generate bindings for this class, include /// AVAudioFormatWrapper in your config's objc-interfaces list. diff --git a/pkgs/swiftgen/pubspec.yaml b/pkgs/swiftgen/pubspec.yaml index dac3d30c1a..dcc28ec53f 100644 --- a/pkgs/swiftgen/pubspec.yaml +++ b/pkgs/swiftgen/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: ffi: ^2.1.0 ffigen: ^22.0.0-wip logging: ^1.3.0 - objective_c: ^9.5.0 + objective_c: ^9.6.0-wip package_config: '>=2.2.0 <4.0.0' path: ^1.9.1 swift2objc: ^0.2.0 diff --git a/pkgs/swiftgen/test/integration/callbacks_bindings.dart b/pkgs/swiftgen/test/integration/callbacks_bindings.dart index 70c28196dd..a822a6423c 100644 --- a/pkgs/swiftgen/test/integration/callbacks_bindings.dart +++ b/pkgs/swiftgen/test/integration/callbacks_bindings.dart @@ -12,7 +12,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< ffi.Pointer Function( ffi.Int64, diff --git a/pkgs/swiftgen/test/integration/classes_bindings.dart b/pkgs/swiftgen/test/integration/classes_bindings.dart index 7ea6144e7d..8ac5263bd9 100644 --- a/pkgs/swiftgen/test/integration/classes_bindings.dart +++ b/pkgs/swiftgen/test/integration/classes_bindings.dart @@ -12,7 +12,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// TestClassWrapper extension type TestClassWrapper._(objc.ObjCObject object$) diff --git a/pkgs/swiftgen/test/integration/protocols_bindings.dart b/pkgs/swiftgen/test/integration/protocols_bindings.dart index a17b9c98ee..f947a728ad 100644 --- a/pkgs/swiftgen/test/integration/protocols_bindings.dart +++ b/pkgs/swiftgen/test/integration/protocols_bindings.dart @@ -12,7 +12,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); @ffi.Native< ffi.Void Function( ffi.Pointer, diff --git a/pkgs/swiftgen/test/integration/target_bindings.dart b/pkgs/swiftgen/test/integration/target_bindings.dart index 5ece77fdf7..318bdbeb3d 100644 --- a/pkgs/swiftgen/test/integration/target_bindings.dart +++ b/pkgs/swiftgen/test/integration/target_bindings.dart @@ -12,7 +12,7 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -const _$objcVersionCheck = objc.ObjCVersionCheck(9, 5); +const _$objcVersionCheck = objc.ObjCVersionCheck(9, 6); /// TestTargetWrapper extension type TestTargetWrapper._(objc.ObjCObject object$)