diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart index bae49b2ad..38c04aa67 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart @@ -12,17 +12,6 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) ->() -external ffi.Pointer _AVFAudio_protocolTrampoline_1mbt9g9( - ffi.Pointer target, - ffi.Pointer arg0, -); - final class AudioStreamBasicDescription extends ffi.Struct { @ffi.Double() external double mSampleRate; @@ -641,141 +630,6 @@ final _objc_msgSend_1cwp428 = objc.msgSendPointer ) >(); late final _sel_alloc = objc.registerName("alloc"); -late final _sel_self = objc.registerName("self"); - -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - castFromPointer( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - > - ptr, - ) => - objc.ObjCBlock< - ffi.Pointer Function(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.Pointer Function(ffi.Pointer) - > - fromFunction( - objc.ObjCObjectBase Function(ffi.Pointer) fn, { - bool keepIsolateAlive = true, - }) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >( - objc.newClosureBlock( - _closureCallable, - (ffi.Pointer arg0) => fn(arg0).ref.retainAndAutorelease(), - keepIsolateAlive, - ), - retain: false, - release: true, - ); - - static ffi.Pointer _fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - >() - .asFunction< - ffi.Pointer Function(ffi.Pointer) - >()(arg0); - static ffi.Pointer _fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_fnPtrTrampoline) - .cast(); - static ffi.Pointer _closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ) => - (objc.getBlockClosure(block) - as ffi.Pointer Function(ffi.Pointer))( - arg0, - ); - static ffi.Pointer _closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_closureTrampoline) - .cast(); -} - -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid$CallExtension - on - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > { - objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0), - retain: true, - release: true, - ); -} - -late final _sel_retain = objc.registerName("retain"); -late final _sel_autorelease = objc.registerName("autorelease"); /// AVAudioPlayer class AVAudioPlayer extends objc.NSObject { @@ -818,11 +672,11 @@ class AVAudioPlayer extends objc.NSObject { } /// allocWithZone: - static AVAudioPlayer allocWithZone(ffi.Pointer zone) { + static AVAudioPlayer allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_AVAudioPlayer, _sel_allocWithZone_, - zone, + zone$1, ); return AVAudioPlayer.castFromPointer($ret, retain: false, release: true); } @@ -838,12 +692,6 @@ class AVAudioPlayer extends objc.NSObject { } extension AVAudioPlayer$Methods on AVAudioPlayer { - /// autorelease - AVAudioPlayer autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return AVAudioPlayer.castFromPointer($ret, retain: true, release: true); - } - /// averagePowerForChannel: double averagePowerForChannel(int channelNumber) { objc.checkOsVersionInternal( @@ -996,7 +844,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { /// initWithContentsOfURL:error: AVAudioPlayer? initWithContentsOfURL( - objc.NSURL url, { + objc.NSURL url$1, { required ffi.Pointer> error, }) { objc.checkOsVersionInternal( @@ -1007,7 +855,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { final $ret = _objc_msgSend_1lhpu4m( this.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_error_, - url.ref.pointer, + url$1.ref.pointer, error, ); return $ret.address == 0 @@ -1017,7 +865,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { /// initWithContentsOfURL:fileTypeHint:error: AVAudioPlayer? initWithContentsOfURL$1( - objc.NSURL url, { + objc.NSURL url$1, { objc.NSString? fileTypeHint, required ffi.Pointer> error, }) { @@ -1029,7 +877,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { final $ret = _objc_msgSend_1pnyuds( this.ref.retainAndReturnPointer(), _sel_initWithContentsOfURL_fileTypeHint_error_, - url.ref.pointer, + url$1.ref.pointer, fileTypeHint?.ref.pointer ?? ffi.nullptr, error, ); @@ -1040,7 +888,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { /// initWithData:error: AVAudioPlayer? initWithData( - objc.NSData data, { + objc.NSData data$1, { required ffi.Pointer> error, }) { objc.checkOsVersionInternal( @@ -1051,7 +899,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { final $ret = _objc_msgSend_1lhpu4m( this.ref.retainAndReturnPointer(), _sel_initWithData_error_, - data.ref.pointer, + data$1.ref.pointer, error, ); return $ret.address == 0 @@ -1061,7 +909,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { /// initWithData:fileTypeHint:error: AVAudioPlayer? initWithData$1( - objc.NSData data, { + objc.NSData data$1, { objc.NSString? fileTypeHint, required ffi.Pointer> error, }) { @@ -1073,7 +921,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { final $ret = _objc_msgSend_1pnyuds( this.ref.retainAndReturnPointer(), _sel_initWithData_fileTypeHint_error_, - data.ref.pointer, + data$1.ref.pointer, fileTypeHint?.ref.pointer ?? ffi.nullptr, error, ); @@ -1224,18 +1072,6 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { : _objc_msgSend_2cgrxl(this.ref.pointer, _sel_rate); } - /// retain - AVAudioPlayer retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return AVAudioPlayer.castFromPointer($ret, retain: true, release: true); - } - - /// self - AVAudioPlayer self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return AVAudioPlayer.castFromPointer($ret, retain: true, release: true); - } - /// setChannelAssignments: set channelAssignments(objc.NSArray? value) { objc.checkOsVersionInternal( @@ -1363,7 +1199,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { } /// setVolume:fadeDuration: - void setVolume(double volume, {required double fadeDuration}) { + void setVolume(double volume$1, {required double fadeDuration}) { objc.checkOsVersionInternal( 'AVAudioPlayer.setVolume:fadeDuration:', iOS: (false, (10, 0, 0)), @@ -1372,7 +1208,7 @@ extension AVAudioPlayer$Methods on AVAudioPlayer { _objc_msgSend_1p4uk9e( this.ref.pointer, _sel_setVolume_fadeDuration_, - volume, + volume$1, fadeDuration, ); } diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart.m b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart.m index 690cc3a31..c608a65e6 100644 --- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart.m +++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart.m @@ -50,12 +50,6 @@ Protocol* _AVFAudio_AVAudioPlayerDelegate(void) { return @protocol(AVAudioPlayerDelegate); } - -typedef id (^_ProtocolTrampoline)(void * sel); -__attribute__((visibility("default"))) __attribute__((used)) -id _AVFAudio_protocolTrampoline_1mbt9g9(id target, void * sel) { - return ((_ProtocolTrampoline)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); -} #undef BLOCKING_BLOCK_IMPL #pragma clang diagnostic pop diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart b/pkgs/ffigen/example/swift/swift_api_bindings.dart index e85b239bd..baf1cb836 100644 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart +++ b/pkgs/ffigen/example/swift/swift_api_bindings.dart @@ -16,17 +16,6 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) ->() -external ffi.Pointer _SwiftLibrary_protocolTrampoline_1mbt9g9( - ffi.Pointer target, - ffi.Pointer arg0, -); - late final _class_SwiftClass = objc.getClass("swift_module.SwiftClass"); late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); final _objc_msgSend_19nvye5 = objc.msgSendPointer @@ -116,141 +105,6 @@ final _objc_msgSend_1cwp428 = objc.msgSendPointer ) >(); late final _sel_alloc = objc.registerName("alloc"); -late final _sel_self = objc.registerName("self"); - -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - castFromPointer( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - > - ptr, - ) => - objc.ObjCBlock< - ffi.Pointer Function(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.Pointer Function(ffi.Pointer) - > - fromFunction( - objc.ObjCObjectBase Function(ffi.Pointer) fn, { - bool keepIsolateAlive = true, - }) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >( - objc.newClosureBlock( - _closureCallable, - (ffi.Pointer arg0) => fn(arg0).ref.retainAndAutorelease(), - keepIsolateAlive, - ), - retain: false, - release: true, - ); - - static ffi.Pointer _fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - >() - .asFunction< - ffi.Pointer Function(ffi.Pointer) - >()(arg0); - static ffi.Pointer _fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_fnPtrTrampoline) - .cast(); - static ffi.Pointer _closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ) => - (objc.getBlockClosure(block) - as ffi.Pointer Function(ffi.Pointer))( - arg0, - ); - static ffi.Pointer _closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_closureTrampoline) - .cast(); -} - -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid$CallExtension - on - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > { - objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0), - retain: true, - release: true, - ); -} - -late final _sel_retain = objc.registerName("retain"); -late final _sel_autorelease = objc.registerName("autorelease"); /// SwiftClass class SwiftClass extends objc.NSObject { @@ -287,11 +141,11 @@ class SwiftClass extends objc.NSObject { } /// allocWithZone: - static SwiftClass allocWithZone(ffi.Pointer zone) { + static SwiftClass allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_SwiftClass, _sel_allocWithZone_, - zone, + zone$1, ); return SwiftClass.castFromPointer($ret, retain: false, release: true); } @@ -307,12 +161,6 @@ class SwiftClass extends objc.NSObject { } extension SwiftClass$Methods on SwiftClass { - /// autorelease - SwiftClass autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return SwiftClass.castFromPointer($ret, retain: true, release: true); - } - /// init SwiftClass init() { objc.checkOsVersionInternal( @@ -327,24 +175,12 @@ extension SwiftClass$Methods on SwiftClass { return SwiftClass.castFromPointer($ret, retain: false, release: true); } - /// retain - SwiftClass retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return SwiftClass.castFromPointer($ret, retain: true, release: true); - } - /// sayHello objc.NSString sayHello() { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_sayHello); return objc.NSString.castFromPointer($ret, retain: true, release: true); } - /// self - SwiftClass self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return SwiftClass.castFromPointer($ret, retain: true, release: true); - } - /// setSomeField: set someField(int value) { _objc_msgSend_4sp4xj(this.ref.pointer, _sel_setSomeField_, value); diff --git a/pkgs/ffigen/example/swift/swift_api_bindings.dart.m b/pkgs/ffigen/example/swift/swift_api_bindings.dart.m deleted file mode 100644 index 9252bb51e..000000000 --- a/pkgs/ffigen/example/swift/swift_api_bindings.dart.m +++ /dev/null @@ -1,59 +0,0 @@ -#include -#import -#import -#import "third_party/swift_api.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); -} DOBJC_Context; - -id objc_retainBlock(id); - -#define BLOCKING_BLOCK_IMPL(ctx, BLOCK_SIG, INVOKE_DIRECT, INVOKE_LISTENER) \ - assert(ctx->version >= 1); \ - void* targetIsolate = ctx->currentIsolate(); \ - int64_t targetPort = ctx->getMainPortId == NULL ? 0 : ctx->getMainPortId(); \ - return BLOCK_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(); \ - INVOKE_LISTENER; \ - ctx->awaitWaiter(waiter); \ - } \ - }; - - -typedef id (^_ProtocolTrampoline)(void * sel); -__attribute__((visibility("default"))) __attribute__((used)) -id _SwiftLibrary_protocolTrampoline_1mbt9g9(id target, void * sel) { - return ((_ProtocolTrampoline)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel); -} -#undef BLOCKING_BLOCK_IMPL - -#pragma clang diagnostic pop diff --git a/pkgs/ffigen/lib/src/code_generator/objc_category.dart b/pkgs/ffigen/lib/src/code_generator/objc_category.dart index df6349934..bb5f82fd1 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_category.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_category.dart @@ -64,13 +64,18 @@ ${generateMethodBindings(w, parent)} @override void visit(Visitation visitation) => visitation.visitObjCCategory(this); + // Set typeGraphOnly to true to skip iterating methods and other children, and + // just iterate the DAG of interfaces, categories, and protocols. This is + // useful for visitors that need to ensure super types are visited first. @override - void visitChildren(Visitor visitor) { - super.visitChildren(visitor); + void visitChildren(Visitor visitor, {bool typeGraphOnly = false}) { + if (!typeGraphOnly) { + super.visitChildren(visitor); + visitor.visit(classObject); + visitMethods(visitor); + visitor.visit(objcPkgImport); + } visitor.visit(parent); - visitor.visit(classObject); - visitMethods(visitor); - visitor.visit(objcPkgImport); visitor.visitAll(protocols); } } diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index 85734ea29..00255b952 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -239,16 +239,25 @@ ${generateInstanceMethodBindings(w, this)} @override void visit(Visitation visitation) => visitation.visitObjCInterface(this); + // Set typeGraphOnly to true to skip iterating methods and other children, and + // just iterate the DAG of interfaces, categories, and protocols. This is + // useful for visitors that need to ensure super types are visited first. @override - void visitChildren(Visitor visitor) { - super.visitChildren(visitor); + void visitChildren(Visitor visitor, {bool typeGraphOnly = false}) { + if (!typeGraphOnly) { + super.visitChildren(visitor); + visitor.visit(classObject); + visitor.visit(_isKindOfClass); + visitor.visit(_isKindOfClassMsgSend); + visitMethods(visitor); + visitor.visit(objcPkgImport); + + // In the type DAG, categories link to their parent interface, not the + // other way around. So don't iterate these categories as part of the DAG. + visitor.visitAll(categories); + } + visitor.visit(superType); - visitor.visit(classObject); - visitor.visit(_isKindOfClass); - visitor.visit(_isKindOfClassMsgSend); - visitMethods(visitor); - visitor.visit(objcPkgImport); - visitor.visitAll(categories); visitor.visitAll(protocols); // Note: Don't visit subtypes here, because they shouldn't affect transitive diff --git a/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart b/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart index f08bec19c..660289df2 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_protocol.dart @@ -395,15 +395,20 @@ Protocol* _${wrapName}_$originalName(void) { return @protocol($originalName); } @override void visit(Visitation visitation) => visitation.visitObjCProtocol(this); + // Set typeGraphOnly to true to skip iterating methods and other children, and + // just iterate the DAG of interfaces, categories, and protocols. This is + // useful for visitors that need to ensure super types are visited first. @override - void visitChildren(Visitor visitor) { - super.visitChildren(visitor); - visitor.visit(_protocolPointer); + void visitChildren(Visitor visitor, {bool typeGraphOnly = false}) { + if (!typeGraphOnly) { + super.visitChildren(visitor); + visitor.visit(_protocolPointer); + visitor.visit(_conformsTo); + visitor.visit(_conformsToMsgSend); + visitMethods(visitor); + visitor.visit(ffiImport); + visitor.visit(objcPkgImport); + } visitor.visitAll(superProtocols); - visitor.visit(_conformsTo); - visitor.visit(_conformsToMsgSend); - visitMethods(visitor); - visitor.visit(ffiImport); - visitor.visit(objcPkgImport); } } diff --git a/pkgs/ffigen/lib/src/code_generator/scope.dart b/pkgs/ffigen/lib/src/code_generator/scope.dart index 5e86c2911..5dbb49c2b 100644 --- a/pkgs/ffigen/lib/src/code_generator/scope.dart +++ b/pkgs/ffigen/lib/src/code_generator/scope.dart @@ -18,7 +18,7 @@ import 'dart_keywords.dart'; /// - Use [addPrivate] to create ad-hoc names during code generation class Scope { final String _debugName; - final _symbols = []; + final _symbols = {}; final _children = []; final Scope? _parent; final Set _preUsedNames; @@ -43,7 +43,7 @@ class Scope { /// /// It's fine to add the [Symbol] to this [Scope] multiple times. It's /// also fine to add the [Symbol] to multiple [Scope]s, as long as one of - /// the [Scope]s is an ancestor of the other (this is checked during + /// the [Scope]s is an ancestor of all the others (this is checked during /// [fillNames]). /// /// [fillNames] must not have been called yet. @@ -83,11 +83,13 @@ class Scope { symbol._name = namer.add(symbol.oldName); } else { // Symbol already has a name. This can happen if the symbol is in - // multiple scopes, or in the same scope more than once. It's fine as - // long as the name isn't used by a different symbol earlier in this - // scope. + // multiple scopes. It's fine as long as the name isn't used by a + // different symbol earlier in this scope. namer.markUsed(symbol._name!); - assert(!_symbols.any((s) => s != symbol && s._name == symbol._name)); + assert( + !_symbols.any((s) => s != symbol && s._name == symbol._name), + symbol.oldName, + ); } } for (final ns in _children) { diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 49ff326a2..73aa683c5 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -18,6 +18,7 @@ import '../strings.dart' as strings; import '../visitor/apply_config_filters.dart'; import '../visitor/ast.dart'; import '../visitor/copy_methods_from_super_type.dart'; +import '../visitor/create_scopes.dart'; import '../visitor/fill_method_dependencies.dart'; import '../visitor/find_symbols.dart'; import '../visitor/find_transitive_deps.dart'; @@ -165,12 +166,19 @@ List _findObjectiveCSysroot() => [ @visibleForTesting List transformBindings(List bindings, Context context) { final config = context.config; - visit(context, CopyMethodsFromSuperTypesVisitation(), bindings); - visit(context, FixOverriddenMethodsVisitation(context), bindings); - visit(context, FillMethodDependenciesVisitation(), bindings); + + final allBindings = visit( + context, + FindTransitiveDepsVisitation(), + bindings, + ).transitives; + + visit(context, CopyMethodsFromSuperTypesVisitation(), allBindings); + visit(context, FixOverriddenMethodsVisitation(context), allBindings); + visit(context, FillMethodDependenciesVisitation(), allBindings); final applyConfigFiltersVisitation = ApplyConfigFiltersVisitation(config); - visit(context, applyConfigFiltersVisitation, bindings); + visit(context, applyConfigFiltersVisitation, allBindings); final directlyIncluded = applyConfigFiltersVisitation.directlyIncluded; final included = directlyIncluded.union( applyConfigFiltersVisitation.indirectlyIncluded, @@ -184,7 +192,7 @@ List transformBindings(List bindings, Context context) { visit( context, ClearOpaqueCompoundMembersVisitation(config, byValueCompounds, included), - bindings, + allBindings, ); final transitives = visit( @@ -203,7 +211,7 @@ List transformBindings(List bindings, Context context) { ListBindingsVisitation(config, included, transitives, directTransitives), bindings, ).bindings; - visit(context, MarkBindingsVisitation(finalBindings), bindings); + visit(context, MarkBindingsVisitation(finalBindings), allBindings); visit(context, MarkImportsVisitation(context), finalBindings); @@ -255,6 +263,16 @@ void _nameAllSymbols(Context context, Set bindings) { bindings, ).sorted; + visit( + context, + CreateScopesVisitation(context, bindings, orderedPass: true), + namingOrder, + ); + visit( + context, + CreateScopesVisitation(context, bindings, orderedPass: false), + namingOrder, + ); visit(context, FindSymbolsVisitation(context, bindings), namingOrder); context.extraSymbols = _createExtraSymbols(context); 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 7a84d1077..f583989e6 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 @@ -11,9 +11,11 @@ import 'ast.dart'; // these are still accessible via inheritance from NSObject. const _excludedNSObjectMethods = { 'allocWithZone:', + 'autorelease', 'class', 'conformsToProtocol:', 'copyWithZone:', + 'dealloc', 'debugDescription', 'description', 'hash', @@ -25,9 +27,13 @@ const _excludedNSObjectMethods = { 'load', 'mutableCopyWithZone:', 'poseAsClass:', + 'release', 'resolveClassMethod:', 'resolveInstanceMethod:', 'respondsToSelector:', + 'retain', + 'retainCount', + 'self', 'setVersion:', 'superclass', 'version', @@ -36,7 +42,7 @@ const _excludedNSObjectMethods = { class CopyMethodsFromSuperTypesVisitation extends Visitation { @override void visitObjCInterface(ObjCInterface node) { - node.visitChildren(visitor); + node.visitChildren(visitor, typeGraphOnly: true); final isNSObject = ObjCBuiltInFunctions.isNSObject(node.originalName); @@ -86,12 +92,9 @@ class CopyMethodsFromSuperTypesVisitation extends Visitation { void Function(ObjCMethod) addMethod, ) { // Copy all methods from all the protocols. - final isNSObject = ObjCBuiltInFunctions.isNSObject(node.originalName); for (final proto in protocols) { for (final m in proto.methods) { - if (isNSObject) { - addMethod(m); - } else if (!_excludedNSObjectMethods.contains(m.originalName)) { + if (!_excludedNSObjectMethods.contains(m.originalName)) { addMethod(m); } } @@ -100,7 +103,7 @@ class CopyMethodsFromSuperTypesVisitation extends Visitation { @override void visitObjCCategory(ObjCCategory node) { - node.visitChildren(visitor); + node.visitChildren(visitor, typeGraphOnly: true); // Copy all methods from all the category's protocols. _copyMethodFromProtocols(node, node.protocols, node.addMethod); @@ -108,7 +111,7 @@ class CopyMethodsFromSuperTypesVisitation extends Visitation { @override void visitObjCProtocol(ObjCProtocol node) { - node.visitChildren(visitor); + node.visitChildren(visitor, typeGraphOnly: true); for (final superProtocol in node.superProtocols) { if (ObjCBuiltInFunctions.isNSObject(superProtocol.originalName)) { diff --git a/pkgs/ffigen/lib/src/visitor/create_scopes.dart b/pkgs/ffigen/lib/src/visitor/create_scopes.dart new file mode 100644 index 000000000..ffb0a2c67 --- /dev/null +++ b/pkgs/ffigen/lib/src/visitor/create_scopes.dart @@ -0,0 +1,157 @@ +// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import '../code_generator/binding.dart'; +import '../code_generator/func_type.dart'; +import '../code_generator/objc_built_in_functions.dart'; +import '../code_generator/objc_category.dart'; +import '../code_generator/objc_interface.dart'; +import '../code_generator/objc_methods.dart'; +import '../code_generator/objc_protocol.dart'; +import '../code_generator/scope.dart'; +import '../context.dart'; +import 'ast.dart'; + +// Visitation to create all the scopes. +// +// Most local scopes are parented to the root scope (eg functions or structs), +// but some are parented to a non-root scope (eg ObjC interfaces are parented to +// their supertype). +// +// We first do a pass with orderedPass = true, which ensures that supertypes are +// visited before subtypes (but will miss some AST nodes), so that the parenting +// relationships between the ObjC object scopes are setup correctly. Then we do +// a pass with orderedPass = false, to catch the AST nodes that weren't hit in +// the first pass. +class CreateScopesVisitation extends Visitation { + final Context context; + final Set bindings; + final bool orderedPass; + + CreateScopesVisitation( + this.context, + this.bindings, { + required this.orderedPass, + }); + + Scope createScope( + HasLocalScope node, + Scope parentScope, + String debugName, { + Set preUsedNames = const {}, + }) { + if (!node.localScopeFilled) { + node.localScope = parentScope.addChild( + debugName, + preUsedNames: preUsedNames, + ); + } + return node.localScope; + } + + void visitHasLocalScope(HasLocalScope node, String debugName) { + createScope(node, context.rootScope, debugName); + node.visitChildren(visitor); + } + + @override + void visitBinding(Binding node) { + if (node case final HasLocalScope hasLocalScope) { + visitHasLocalScope(hasLocalScope, node.originalName); + } else { + node.visitChildren(visitor); + } + } + + @override + void visitFunctionType(FunctionType node) => + visitHasLocalScope(node, 'FunctionType'); + + @override + void visitObjCMsgSendFunc(ObjCMsgSendFunc node) => + visitHasLocalScope(node, 'objc_msgSend'); + + static const objCObjectBaseMethods = { + 'ref', + 'toString', + 'hashCode', + 'runtimeType', + 'noSuchMethod', + }; + + void visitObjCMethods( + ObjCMethods node, + ObjCInterface? superType, + Scope classScope, + ) { + for (final m in node.methods) { + final parentScope = + _findRootWithMethod(superType, m)?.localScope ?? classScope; + createScope(m, parentScope, m.originalName); + } + } + + @override + void visitObjCCategory(ObjCCategory node) { + if (!bindings.contains(node)) return; + node.visitChildren(visitor, typeGraphOnly: orderedPass); + visitObjCMethods( + node, + node.parent, + createScope( + node, + node.parent.localScope, + node.originalName, + preUsedNames: objCObjectBaseMethods, + ), + ); + } + + @override + void visitObjCInterface(ObjCInterface node) { + if (node.generateAsStub) { + // The supertype heirarchy is generated even if this is a stub. + visitor.visit(node.superType); + } else { + node.visitChildren(visitor, typeGraphOnly: orderedPass); + } + visitObjCMethods( + node, + node.superType, + createScope( + node, + node.superType?.localScope ?? context.rootScope, + node.originalName, + preUsedNames: objCObjectBaseMethods, + ), + ); + } + + @override + void visitObjCProtocol(ObjCProtocol node) { + if (!node.generateAsStub) { + node.visitChildren(visitor, typeGraphOnly: orderedPass); + } + visitObjCMethods( + node, + null, + createScope( + node, + context.rootScope, + node.originalName, + preUsedNames: objCObjectBaseMethods, + ), + ); + } + + ObjCInterface? _findRootWithMethod(ObjCInterface? node, ObjCMethod method) { + ObjCInterface? root; + for (var t = node; t != null; t = t.superType) { + if (t.getSimilarMethod(method) == null) break; + root = t; + } + assert(root == null || root.getSimilarMethod(method) != null); + return root; + } +} diff --git a/pkgs/ffigen/lib/src/visitor/find_symbols.dart b/pkgs/ffigen/lib/src/visitor/find_symbols.dart index 4d18936f8..918b9daa7 100644 --- a/pkgs/ffigen/lib/src/visitor/find_symbols.dart +++ b/pkgs/ffigen/lib/src/visitor/find_symbols.dart @@ -14,16 +14,12 @@ import '../code_generator/typealias.dart'; import '../context.dart'; import 'ast.dart'; -// Visitation to create all the scopes and all the symbols to the correct scope. +// Visitation to add all the symbols to the correct scope. // // A Binding's name Symbol is always added to the root scope. If the Binding has // a local scope, its other symbols (eg a struct's field names) are added to // that local scope. If the Binding doesn't have a local scope all its symbols // are added to the root scope. -// -// Most local scopes are parented to the root scope (eg functions or structs), -// but some are parented to a non-root scope (eg ObjC interfaces are parented to -// their supertype). class FindSymbolsVisitation extends Visitation { final Context context; final Set bindings; @@ -32,45 +28,30 @@ class FindSymbolsVisitation extends Visitation { FindSymbolsVisitation(this.context, this.bindings) : currentScope = context.rootScope; - void visitInsideScope(AstNode node, Scope localScope) { + void insideScope(Scope localScope, void Function() fn) { final oldScope = currentScope; currentScope = localScope; - node.visitChildren(visitor); + fn(); currentScope = oldScope; } - void visitHasLocalScope( - HasLocalScope node, - Scope parentScope, - String debugName, - ) { - if (!node.localScopeFilled) { - node.localScope = parentScope.addChild(debugName); - } - visitInsideScope(node, node.localScope); - } - - // Note: node should be Binding & HasLocalScope, but Dart doesn't have - // intersection types. - void visitBindingHasLocalScope(Binding node, Scope parentScope) { - // Explicitly add the Binding's symbol to the root scope before visiting - // the children, because the name shouldn't be part of the local scope. - // Visiting the children will also add the symbol to the local scope, - // but that's ok because `Scope.fillNames` is built to handle that. - context.rootScope.add(node.symbol); - visitHasLocalScope(node as HasLocalScope, parentScope, node.originalName); - } + void visitInsideScope(AstNode node, Scope localScope) => + insideScope(localScope, () => node.visitChildren(visitor)); @override void visitSymbol(Symbol node) => currentScope.add(node); @override void visitBinding(Binding node) { - if (node is HasLocalScope) { - visitBindingHasLocalScope(node, context.rootScope); - } else { - visitInsideScope(node, context.rootScope); - } + // Explicitly add the Binding's symbol to the root scope before visiting + // the children, because the name shouldn't be part of the local scope. + // Visiting the children will also add the symbol to the local scope, + // but that's ok because `Scope.fillNames` is built to handle that. + context.rootScope.add(node.symbol); + visitInsideScope(node, switch (node) { + final HasLocalScope hasLocalScope => hasLocalScope.localScope, + _ => context.rootScope, + }); } @override @@ -86,64 +67,54 @@ class FindSymbolsVisitation extends Visitation { } } - static const objCObjectBaseMethods = { - 'ref', - 'toString', - 'hashCode', - 'runtimeType', - 'noSuchMethod', - }; + @override + void visitFunctionType(FunctionType node) => + visitInsideScope(node, node.localScope); + + @override + void visitObjCMsgSendFunc(ObjCMsgSendFunc node) => + visitInsideScope(node, node.localScope); + + @override + void visitObjCMethod(ObjCMethod node) => + visitInsideScope(node, node.localScope); + + void visitObjCMethods(ObjCMethods node, Scope localScope) { + visitBinding(node as Binding); // All ObjCMethods are Bindings. + + // Since the methods are AST nodes, the visitor dedupes our implicit visits + // to them. But we want to add each method's symbols to all its classes's, + // so we explicitly visit them here. + insideScope(localScope, () { + for (final m in node.methods) { + currentScope.add(m.symbol); + currentScope.add(m.protocolMethodName); + } + }); + } @override void visitObjCCategory(ObjCCategory node) { if (!bindings.contains(node)) return; - fillObjCInterfaceScopes(node.parent); - visitBindingHasLocalScope(node, node.parent.localScope); + visitObjCMethods(node, node.localScope); } @override void visitObjCInterface(ObjCInterface node) { context.rootScope.add(node.symbol); - fillObjCInterfaceScopes(node.superType); - if (!node.generateAsStub) { - visitBindingHasLocalScope( - node, - node.superType?.localScope ?? context.rootScope, - ); + if (node.generateAsStub) { + // The supertype heirarchy is generated even if this is a stub. + visitor.visit(node.superType); + } else { + visitObjCMethods(node, node.localScope); } } @override void visitObjCProtocol(ObjCProtocol node) { context.rootScope.add(node.symbol); - node.localScope = context.rootScope.addChild( - node.originalName, - preUsedNames: objCObjectBaseMethods, - ); if (!node.generateAsStub) { - visitBindingHasLocalScope(node, context.rootScope); + visitObjCMethods(node, node.localScope); } } - - @override - void visitFunctionType(FunctionType node) => - visitHasLocalScope(node, context.rootScope, 'FunctionType'); - - @override - void visitObjCMsgSendFunc(ObjCMsgSendFunc node) => - visitHasLocalScope(node, context.rootScope, 'objc_msgSend'); - - @override - void visitObjCMethod(ObjCMethod node) { - currentScope.add(node.symbol); - currentScope.add(node.protocolMethodName); - visitHasLocalScope(node, context.rootScope, node.originalName); - } - - void fillObjCInterfaceScopes(ObjCInterface? node) { - if (node == null || node.localScopeFilled) return; - fillObjCInterfaceScopes(node.superType); - node.localScope = (node.superType?.localScope ?? context.rootScope) - .addChild(node.originalName, preUsedNames: objCObjectBaseMethods); - } } diff --git a/pkgs/ffigen/lib/src/visitor/fix_overridden_methods.dart b/pkgs/ffigen/lib/src/visitor/fix_overridden_methods.dart index 99b5be49a..b2af3e117 100644 --- a/pkgs/ffigen/lib/src/visitor/fix_overridden_methods.dart +++ b/pkgs/ffigen/lib/src/visitor/fix_overridden_methods.dart @@ -21,17 +21,21 @@ class FixOverriddenMethodsVisitation extends Visitation { @override void visitObjCInterface(ObjCInterface node) { - // Visit the supertype, then perform all AST mutations, then visit the other - // children. That way we can be sure that the supertype's AST mutations have - // been completed before this node's mutations (this is important for - // _fixContravariantReturns). - visitor.visit(node.superType); + node.visitChildren(visitor, typeGraphOnly: true); _fixMethodVariance(node); _fixMethodsVsProperties(node); _fixMethodSymbols(node); + } - node.visitChildren(visitor); + @override + void visitObjCCategory(ObjCCategory node) { + node.visitChildren(visitor, typeGraphOnly: true); + } + + @override + void visitObjCProtocol(ObjCProtocol node) { + node.visitChildren(visitor, typeGraphOnly: true); } (ObjCInterface?, ObjCMethod?) _findNearestWithMethod( diff --git a/pkgs/ffigen/test/example_tests/objective_c_example_test.dart b/pkgs/ffigen/test/example_tests/objective_c_example_test.dart index ff365913c..73f4037e0 100644 --- a/pkgs/ffigen/test/example_tests/objective_c_example_test.dart +++ b/pkgs/ffigen/test/example_tests/objective_c_example_test.dart @@ -31,7 +31,7 @@ void main() { expect( output, contains( - 'AVAudioPlayer? initWithContentsOfURL(objc.NSURL url, ' + 'AVAudioPlayer? initWithContentsOfURL(objc.NSURL url\$1, ' '{required ffi.Pointer> error}) {', ), ); 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 fd71ec81a..45b5576ca 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 @@ -206,5 +206,26 @@ void main() { expect(childMethod.name, 'method\$1'); expect(categoryMethod.name, 'method\$2'); }); + + test('iteration order bug', () { + // Regression test for https://github.com/dart-lang/native/issues/2656 + final instanceTypeMethod = makeMethod('m1', instanceType, []); + + final parent = makeInterface('Parent', null, [instanceTypeMethod]); + final child = makeInterface('Child', parent, []); + final grandChild = makeInterface('GrandChild', child, []); + + final grandChildMethod = makeMethod('m2', grandChild, []); + parent.addMethod(grandChildMethod); + + final bindings = transformBindings([child, parent, grandChild], context); + + expect(bindings, contains(parent)); + expect(bindings, contains(child)); + expect(bindings, contains(grandChild)); + + expect(child.methods, contains(instanceTypeMethod)); + expect(grandChild.methods, contains(instanceTypeMethod)); + }); }); } diff --git a/pkgs/objective_c/lib/src/ns_data.dart b/pkgs/objective_c/lib/src/ns_data.dart index 0a0e690f9..500481701 100644 --- a/pkgs/objective_c/lib/src/ns_data.dart +++ b/pkgs/objective_c/lib/src/ns_data.dart @@ -42,7 +42,7 @@ extension NSDataListExtension on List { final buffer = malloc(length); buffer.asTypedList(length).setAll(0, this); - final nsData = NSData.dataWithBytes(buffer.cast(), length: length); + final nsData = NSData.dataWithBytes(buffer.cast(), length$1: length); malloc.free(buffer); return nsData; diff --git a/pkgs/objective_c/lib/src/ns_input_stream.dart b/pkgs/objective_c/lib/src/ns_input_stream.dart index 7615cd4f5..acb397aae 100644 --- a/pkgs/objective_c/lib/src/ns_input_stream.dart +++ b/pkgs/objective_c/lib/src/ns_input_stream.dart @@ -68,8 +68,8 @@ extension NSInputStreamStreamExtension on Stream> { inputStream.setError( NSError.errorWithDomain( 'DartError'.toNSString(), - code: 0, - userInfo: d, + code$1: 0, + userInfo$1: d, ), ); inputStream.ref.release(); diff --git a/pkgs/objective_c/lib/src/ns_mutable_data.dart b/pkgs/objective_c/lib/src/ns_mutable_data.dart index 9873410ed..fca0dbb54 100644 --- a/pkgs/objective_c/lib/src/ns_mutable_data.dart +++ b/pkgs/objective_c/lib/src/ns_mutable_data.dart @@ -35,7 +35,7 @@ extension NSMutableDataExtensions on NSMutableData { final f = malloc(iterable.length); try { f.asTypedList(iterable.length).setAll(0, iterable); - appendBytes(f.cast(), length: iterable.length); + appendBytes(f.cast(), length$2: iterable.length); } finally { malloc.free(f); } @@ -56,7 +56,7 @@ extension NSMutableDataListExtension on List { final buffer = malloc(length); buffer.asTypedList(length).setAll(0, this); - final data = NSMutableData.dataWithBytes(buffer.cast(), length: length); + final data = NSMutableData.dataWithBytes(buffer.cast(), length$1: length); malloc.free(buffer); return data; 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 c1b5b65c7..43bac669a 100644 --- a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart +++ b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart @@ -132,23 +132,6 @@ set NSLocalizedDescriptionKey(NSString value) { _NSLocalizedDescriptionKey = value.ref.retainAndReturnPointer(); } -@ffi.Native< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) ->() -external instancetype _ObjectiveCBindings_protocolTrampoline_10z9f5k( - ffi.Pointer target, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, -); - @ffi.Native< ffi.UnsignedLong Function( ffi.Pointer, @@ -858,11 +841,11 @@ class DOBJCObservation extends NSObject { } /// allocWithZone: - static DOBJCObservation allocWithZone(ffi.Pointer zone) { + static DOBJCObservation allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_DOBJCObservation, _sel_allocWithZone_, - zone, + zone$1, ); return DOBJCObservation.castFromPointer($ret, retain: false, release: true); } @@ -878,12 +861,6 @@ class DOBJCObservation extends NSObject { } extension DOBJCObservation$Methods on DOBJCObservation { - /// autorelease - DOBJCObservation autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return DOBJCObservation.castFromPointer($ret, retain: true, release: true); - } - /// dealloc void dealloc() { _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_dealloc); @@ -932,18 +909,6 @@ extension DOBJCObservation$Methods on DOBJCObservation { void remove() { _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_remove); } - - /// retain - DOBJCObservation retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return DOBJCObservation.castFromPointer($ret, retain: true, release: true); - } - - /// self - DOBJCObservation self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return DOBJCObservation.castFromPointer($ret, retain: true, release: true); - } } /// Helper class to adapt a Dart stream into a `NSInputStream`. @@ -974,6 +939,33 @@ class DartInputStreamAdapter extends NSInputStream implements NSStreamDelegate { ); } + /// alloc + static DartInputStreamAdapter alloc() { + final $ret = _objc_msgSend_151sglz( + _class_DOBJCDartInputStreamAdapter, + _sel_alloc, + ); + return DartInputStreamAdapter.castFromPointer( + $ret, + retain: false, + release: true, + ); + } + + /// allocWithZone: + static DartInputStreamAdapter allocWithZone(ffi.Pointer zone$1) { + final $ret = _objc_msgSend_1cwp428( + _class_DOBJCDartInputStreamAdapter, + _sel_allocWithZone_, + zone$1, + ); + return DartInputStreamAdapter.castFromPointer( + $ret, + retain: false, + release: true, + ); + } + /// inputStreamWithData: static DartInputStreamAdapter? inputStreamWithData(NSData data) { final $ret = _objc_msgSend_1sotr3r( @@ -1043,6 +1035,22 @@ class DartInputStreamAdapter extends NSInputStream implements NSStreamDelegate { release: true, ); } + + /// new + static DartInputStreamAdapter new$() { + final $ret = _objc_msgSend_151sglz( + _class_DOBJCDartInputStreamAdapter, + _sel_new, + ); + return DartInputStreamAdapter.castFromPointer( + $ret, + retain: false, + release: true, + ); + } + + /// Returns a new instance of DartInputStreamAdapter constructed with the default `new` method. + factory DartInputStreamAdapter() => new$(); } extension DartInputStreamAdapter$Methods on DartInputStreamAdapter { @@ -1055,6 +1063,24 @@ extension DartInputStreamAdapter$Methods on DartInputStreamAdapter { ); } + /// init + DartInputStreamAdapter init() { + objc.checkOsVersionInternal( + 'DOBJCDartInputStreamAdapter.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + this.ref.retainAndReturnPointer(), + _sel_init, + ); + return DartInputStreamAdapter.castFromPointer( + $ret, + retain: false, + release: true, + ); + } + /// initWithData: DartInputStreamAdapter initWithData(NSData data) { final $ret = _objc_msgSend_1sotr3r( @@ -1176,12 +1202,12 @@ class DartInputStreamAdapterWeakHolder extends NSObject { /// allocWithZone: static DartInputStreamAdapterWeakHolder allocWithZone( - ffi.Pointer zone, + ffi.Pointer zone$1, ) { final $ret = _objc_msgSend_1cwp428( _class_DOBJCDartInputStreamAdapterWeakHolder, _sel_allocWithZone_, - zone, + zone$1, ); return DartInputStreamAdapterWeakHolder.castFromPointer( $ret, @@ -1192,12 +1218,12 @@ class DartInputStreamAdapterWeakHolder extends NSObject { /// holderWithInputStreamAdapter: static DartInputStreamAdapterWeakHolder holderWithInputStreamAdapter( - DartInputStreamAdapter adapter, + DartInputStreamAdapter adapter$1, ) { final $ret = _objc_msgSend_1sotr3r( _class_DOBJCDartInputStreamAdapterWeakHolder, _sel_holderWithInputStreamAdapter_, - adapter.ref.pointer, + adapter$1.ref.pointer, ); return DartInputStreamAdapterWeakHolder.castFromPointer( $ret, @@ -1235,16 +1261,6 @@ extension DartInputStreamAdapterWeakHolder$Methods ); } - /// autorelease - DartInputStreamAdapterWeakHolder autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return DartInputStreamAdapterWeakHolder.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - /// init DartInputStreamAdapterWeakHolder init() { objc.checkOsVersionInternal( @@ -1262,26 +1278,6 @@ extension DartInputStreamAdapterWeakHolder$Methods release: true, ); } - - /// retain - DartInputStreamAdapterWeakHolder retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return DartInputStreamAdapterWeakHolder.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - - /// self - DartInputStreamAdapterWeakHolder self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return DartInputStreamAdapterWeakHolder.castFromPointer( - $ret, - retain: true, - release: true, - ); - } } /// Base class of all classes DOBJCDartProtocolBuilder creates. @@ -1319,11 +1315,11 @@ class DartProtocol extends NSObject { } /// allocWithZone: - static DartProtocol allocWithZone(ffi.Pointer zone) { + static DartProtocol allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_DOBJCDartProtocol, _sel_allocWithZone_, - zone, + zone$1, ); return DartProtocol.castFromPointer($ret, retain: false, release: true); } @@ -1339,12 +1335,6 @@ class DartProtocol extends NSObject { } extension DartProtocol$Methods on DartProtocol { - /// autorelease - DartProtocol autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return DartProtocol.castFromPointer($ret, retain: true, release: true); - } - /// dealloc void dealloc() { _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_dealloc); @@ -1389,18 +1379,6 @@ extension DartProtocol$Methods on DartProtocol { ); return DartProtocol.castFromPointer($ret, retain: false, release: true); } - - /// retain - DartProtocol retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return DartProtocol.castFromPointer($ret, retain: true, release: true); - } - - /// self - DartProtocol self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return DartProtocol.castFromPointer($ret, retain: true, release: true); - } } /// Used by the Dart ObjCProtocolBuilder to construct ObjC classes at runtime to @@ -1446,11 +1424,11 @@ class DartProtocolBuilder extends NSObject { } /// allocWithZone: - static DartProtocolBuilder allocWithZone(ffi.Pointer zone) { + static DartProtocolBuilder allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_DOBJCDartProtocolBuilder, _sel_allocWithZone_, - zone, + zone$1, ); return DartProtocolBuilder.castFromPointer( $ret, @@ -1486,16 +1464,6 @@ extension DartProtocolBuilder$Methods on DartProtocolBuilder { ); } - /// autorelease - DartProtocolBuilder autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return DartProtocolBuilder.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - /// buildInstance: DartProtocol buildInstance(int port) { final $ret = _objc_msgSend_1ya1kjn( @@ -1559,26 +1527,6 @@ extension DartProtocolBuilder$Methods on DartProtocolBuilder { void registerClass() { _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_registerClass); } - - /// retain - DartProtocolBuilder retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return DartProtocolBuilder.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - - /// self - DartProtocolBuilder self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return DartProtocolBuilder.castFromPointer( - $ret, - retain: true, - release: true, - ); - } } /// iOS: unavailable @@ -1655,11 +1603,11 @@ class NSArray extends NSObject } /// allocWithZone: - static NSArray allocWithZone(ffi.Pointer zone) { + static NSArray allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSArray, _sel_allocWithZone_, - zone, + zone$1, ); return NSArray.castFromPointer($ret, retain: false, release: true); } @@ -1671,11 +1619,11 @@ class NSArray extends NSObject } /// arrayWithArray: - static NSArray arrayWithArray(NSArray array) { + static NSArray arrayWithArray(NSArray array$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSArray, _sel_arrayWithArray_, - array.ref.pointer, + array$1.ref.pointer, ); return NSArray.castFromPointer($ret, retain: true, release: true); } @@ -1703,13 +1651,13 @@ class NSArray extends NSObject /// arrayWithObjects:count: static NSArray arrayWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { final $ret = _objc_msgSend_zmbtbd( _class_NSArray, _sel_arrayWithObjects_count_, objects, - count, + count$1, ); return NSArray.castFromPointer($ret, retain: true, release: true); } @@ -1774,21 +1722,21 @@ extension NSArray$Methods on NSArray { } /// initWithArray: - NSArray initWithArray(NSArray array) { + NSArray initWithArray(NSArray array$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithArray_, - array.ref.pointer, + array$1.ref.pointer, ); return NSArray.castFromPointer($ret, retain: false, release: true); } /// initWithArray:copyItems: - NSArray initWithArray$1(NSArray array, {required bool copyItems}) { + NSArray initWithArray$1(NSArray array$1, {required bool copyItems}) { final $ret = _objc_msgSend_17amj0z( this.ref.retainAndReturnPointer(), _sel_initWithArray_copyItems_, - array.ref.pointer, + array$1.ref.pointer, copyItems, ); return NSArray.castFromPointer($ret, retain: false, release: true); @@ -1819,13 +1767,13 @@ extension NSArray$Methods on NSArray { /// initWithObjects:count: NSArray initWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { final $ret = _objc_msgSend_zmbtbd( this.ref.retainAndReturnPointer(), _sel_initWithObjects_count_, objects, - count, + count$1, ); return NSArray.castFromPointer($ret, retain: false, release: true); } @@ -1887,11 +1835,11 @@ class NSAttributedString extends NSObject } /// allocWithZone: - static NSAttributedString allocWithZone(ffi.Pointer zone) { + static NSAttributedString allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSAttributedString, _sel_allocWithZone_, - zone, + zone$1, ); return NSAttributedString.castFromPointer( $ret, @@ -2046,16 +1994,6 @@ extension NSAttributedString$Methods on NSAttributedString { return NSDictionary.castFromPointer($ret, retain: true, release: true); } - /// autorelease - NSAttributedString autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSAttributedString.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - /// encodeWithCoder: void encodeWithCoder(NSCoder coder) { _objc_msgSend_xtuoz7( @@ -2314,26 +2252,6 @@ extension NSAttributedString$Methods on NSAttributedString { ); } - /// retain - NSAttributedString retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSAttributedString.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - - /// self - NSAttributedString self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSAttributedString.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - /// string NSString get string { objc.checkOsVersionInternal( @@ -2455,12 +2373,12 @@ class NSAttributedStringMarkdownParsingOptions extends NSObject /// allocWithZone: static NSAttributedStringMarkdownParsingOptions allocWithZone( - ffi.Pointer zone, + ffi.Pointer zone$1, ) { final $ret = _objc_msgSend_1cwp428( _class_NSAttributedStringMarkdownParsingOptions, _sel_allocWithZone_, - zone, + zone$1, ); return NSAttributedStringMarkdownParsingOptions.castFromPointer( $ret, @@ -2516,16 +2434,6 @@ extension NSAttributedStringMarkdownParsingOptions$Methods ); } - /// autorelease - NSAttributedStringMarkdownParsingOptions autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSAttributedStringMarkdownParsingOptions.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - /// iOS: introduced 15.0.0 /// macOS: introduced 12.0.0 NSAttributedStringMarkdownParsingFailurePolicy get failurePolicy { @@ -2582,26 +2490,6 @@ extension NSAttributedStringMarkdownParsingOptions$Methods : NSString.castFromPointer($ret, retain: true, release: true); } - /// retain - NSAttributedStringMarkdownParsingOptions retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSAttributedStringMarkdownParsingOptions.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - - /// self - NSAttributedStringMarkdownParsingOptions self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSAttributedStringMarkdownParsingOptions.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - /// iOS: introduced 15.0.0 /// macOS: introduced 12.0.0 set allowsExtendedAttributes(bool value) { @@ -2775,11 +2663,11 @@ class NSBundle extends NSObject { } /// allocWithZone: - static NSBundle allocWithZone(ffi.Pointer zone) { + static NSBundle allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSBundle, _sel_allocWithZone_, - zone, + zone$1, ); return NSBundle.castFromPointer($ret, retain: false, release: true); } @@ -3051,12 +2939,6 @@ extension NSBundle$Methods on NSBundle { : NSURL.castFromPointer($ret, retain: true, release: true); } - /// autorelease - NSBundle autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSBundle.castFromPointer($ret, retain: true, release: true); - } - /// builtInPlugInsPath NSString? get builtInPlugInsPath { final $ret = _objc_msgSend_151sglz( @@ -3488,18 +3370,6 @@ extension NSBundle$Methods on NSBundle { : NSURL.castFromPointer($ret, retain: true, release: true); } - /// retain - NSBundle retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSBundle.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSBundle self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSBundle.castFromPointer($ret, retain: true, release: true); - } - /// sharedFrameworksPath NSString? get sharedFrameworksPath { final $ret = _objc_msgSend_151sglz( @@ -3593,11 +3463,11 @@ class NSCharacterSet extends NSObject } /// allocWithZone: - static NSCharacterSet allocWithZone(ffi.Pointer zone) { + static NSCharacterSet allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSCharacterSet, _sel_allocWithZone_, - zone, + zone$1, ); return NSCharacterSet.castFromPointer($ret, retain: false, release: true); } @@ -3803,12 +3673,6 @@ class NSCharacterSet extends NSObject } extension NSCharacterSet$Methods on NSCharacterSet { - /// autorelease - NSCharacterSet autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSCharacterSet.castFromPointer($ret, retain: true, release: true); - } - /// bitmapRepresentation NSData get bitmapRepresentation { final $ret = _objc_msgSend_151sglz( @@ -3894,18 +3758,6 @@ extension NSCharacterSet$Methods on NSCharacterSet { theLongChar, ); } - - /// retain - NSCharacterSet retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSCharacterSet.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSCharacterSet self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSCharacterSet.castFromPointer($ret, retain: true, release: true); - } } /// NSCoder @@ -3943,11 +3795,11 @@ class NSCoder extends NSObject { } /// allocWithZone: - static NSCoder allocWithZone(ffi.Pointer zone) { + static NSCoder allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSCoder, _sel_allocWithZone_, - zone, + zone$1, ); return NSCoder.castFromPointer($ret, retain: false, release: true); } @@ -4400,11 +4252,11 @@ class NSData extends NSObject } /// allocWithZone: - static NSData allocWithZone(ffi.Pointer zone) { + static NSData allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSData, _sel_allocWithZone_, - zone, + zone$1, ); return NSData.castFromPointer($ret, retain: false, release: true); } @@ -4417,43 +4269,43 @@ class NSData extends NSObject /// dataWithBytes:length: static NSData dataWithBytes( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, }) { final $ret = _objc_msgSend_3nbx5e( _class_NSData, _sel_dataWithBytes_length_, - bytes, - length, + bytes$1, + length$1, ); return NSData.castFromPointer($ret, retain: true, release: true); } /// dataWithBytesNoCopy:length: static NSData dataWithBytesNoCopy( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, }) { final $ret = _objc_msgSend_3nbx5e( _class_NSData, _sel_dataWithBytesNoCopy_length_, - bytes, - length, + bytes$1, + length$1, ); return NSData.castFromPointer($ret, retain: true, release: true); } /// dataWithBytesNoCopy:length:freeWhenDone: static NSData dataWithBytesNoCopy$1( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, required bool freeWhenDone, }) { final $ret = _objc_msgSend_161ne8y( _class_NSData, _sel_dataWithBytesNoCopy_length_freeWhenDone_, - bytes, - length, + bytes$1, + length$1, freeWhenDone, ); return NSData.castFromPointer($ret, retain: true, release: true); @@ -4520,11 +4372,11 @@ class NSData extends NSObject } /// dataWithData: - static NSData dataWithData(NSData data) { + static NSData dataWithData(NSData data$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSData, _sel_dataWithData_, - data.ref.pointer, + data$1.ref.pointer, ); return NSData.castFromPointer($ret, retain: true, release: true); } @@ -4661,34 +4513,34 @@ extension NSData$Methods on NSData { } /// initWithBytes:length: - NSData initWithBytes(ffi.Pointer bytes, {required int length}) { + NSData initWithBytes(ffi.Pointer bytes$1, {required int length$1}) { final $ret = _objc_msgSend_3nbx5e( this.ref.retainAndReturnPointer(), _sel_initWithBytes_length_, - bytes, - length, + bytes$1, + length$1, ); return NSData.castFromPointer($ret, retain: false, release: true); } /// initWithBytesNoCopy:length: NSData initWithBytesNoCopy( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, }) { final $ret = _objc_msgSend_3nbx5e( this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_, - bytes, - length, + bytes$1, + length$1, ); return NSData.castFromPointer($ret, retain: false, release: true); } /// initWithBytesNoCopy:length:deallocator: NSData initWithBytesNoCopy$1( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, objc.ObjCBlock, ffi.UnsignedLong)>? deallocator, }) { @@ -4700,8 +4552,8 @@ extension NSData$Methods on NSData { final $ret = _objc_msgSend_134vhyh( this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_deallocator_, - bytes, - length, + bytes$1, + length$1, deallocator?.ref.pointer ?? ffi.nullptr, ); return NSData.castFromPointer($ret, retain: false, release: true); @@ -4709,15 +4561,15 @@ extension NSData$Methods on NSData { /// initWithBytesNoCopy:length:freeWhenDone: NSData initWithBytesNoCopy$2( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, required bool freeWhenDone, }) { final $ret = _objc_msgSend_161ne8y( this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_freeWhenDone_, - bytes, - length, + bytes$1, + length$1, freeWhenDone, ); return NSData.castFromPointer($ret, retain: false, release: true); @@ -4796,11 +4648,11 @@ extension NSData$Methods on NSData { } /// initWithData: - NSData initWithData(NSData data) { + NSData initWithData(NSData data$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithData_, - data.ref.pointer, + data$1.ref.pointer, ); return NSData.castFromPointer($ret, retain: false, release: true); } @@ -4909,11 +4761,11 @@ class NSDate extends NSObject implements NSCopying, NSSecureCoding { } /// allocWithZone: - static NSDate allocWithZone(ffi.Pointer zone) { + static NSDate allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSDate, _sel_allocWithZone_, - zone, + zone$1, ); return NSDate.castFromPointer($ret, retain: false, release: true); } @@ -5181,11 +5033,11 @@ class NSDictionary extends NSObject } /// allocWithZone: - static NSDictionary allocWithZone(ffi.Pointer zone) { + static NSDictionary allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSDictionary, _sel_allocWithZone_, - zone, + zone$1, ); return NSDictionary.castFromPointer($ret, retain: false, release: true); } @@ -5238,14 +5090,14 @@ class NSDictionary extends NSObject static NSDictionary dictionaryWithObjects$1( ffi.Pointer> objects, { required ffi.Pointer> forKeys, - required int count, + required int count$1, }) { final $ret = _objc_msgSend_1dydpdi( _class_NSDictionary, _sel_dictionaryWithObjects_forKeys_count_, objects, forKeys, - count, + count$1, ); return NSDictionary.castFromPointer($ret, retain: true, release: true); } @@ -5372,14 +5224,14 @@ extension NSDictionary$Methods on NSDictionary { NSDictionary initWithObjects$1( ffi.Pointer> objects, { required ffi.Pointer> forKeys, - required int count, + required int count$1, }) { final $ret = _objc_msgSend_1dydpdi( this.ref.retainAndReturnPointer(), _sel_initWithObjects_forKeys_count_, objects, forKeys, - count, + count$1, ); return NSDictionary.castFromPointer($ret, retain: false, release: true); } @@ -5480,11 +5332,11 @@ class NSEnumerator extends NSObject } /// allocWithZone: - static NSEnumerator allocWithZone(ffi.Pointer zone) { + static NSEnumerator allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSEnumerator, _sel_allocWithZone_, - zone, + zone$1, ); return NSEnumerator.castFromPointer($ret, retain: false, release: true); } @@ -5573,27 +5425,27 @@ class NSError extends NSObject implements NSCopying, NSSecureCoding { } /// allocWithZone: - static NSError allocWithZone(ffi.Pointer zone) { + static NSError allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSError, _sel_allocWithZone_, - zone, + zone$1, ); return NSError.castFromPointer($ret, retain: false, release: true); } /// errorWithDomain:code:userInfo: static NSError errorWithDomain( - NSString domain, { - required int code, - NSDictionary? userInfo, + NSString domain$1, { + required int code$1, + NSDictionary? userInfo$1, }) { final $ret = _objc_msgSend_rc4ypv( _class_NSError, _sel_errorWithDomain_code_userInfo_, - domain.ref.pointer, - code, - userInfo?.ref.pointer ?? ffi.nullptr, + domain$1.ref.pointer, + code$1, + userInfo$1?.ref.pointer ?? ffi.nullptr, ); return NSError.castFromPointer($ret, retain: true, release: true); } @@ -5719,16 +5571,16 @@ extension NSError$Methods on NSError { /// initWithDomain:code:userInfo: NSError initWithDomain( - NSString domain, { - required int code, - NSDictionary? userInfo, + NSString domain$1, { + required int code$1, + NSDictionary? userInfo$1, }) { final $ret = _objc_msgSend_rc4ypv( this.ref.retainAndReturnPointer(), _sel_initWithDomain_code_userInfo_, - domain.ref.pointer, - code, - userInfo?.ref.pointer ?? ffi.nullptr, + domain$1.ref.pointer, + code$1, + userInfo$1?.ref.pointer ?? ffi.nullptr, ); return NSError.castFromPointer($ret, retain: false, release: true); } @@ -5847,7 +5699,7 @@ extension NSExtendedArray on NSArray { } /// description - NSString get description$2 { + NSString get description$1 { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); return NSString.castFromPointer($ret, retain: true, release: true); } @@ -6437,7 +6289,7 @@ extension NSExtendedArray on NSArray { /// NSExtendedData extension NSExtendedData on NSData { /// description - NSString get description$2 { + NSString get description$1 { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); return NSString.castFromPointer($ret, retain: true, release: true); } @@ -6462,12 +6314,12 @@ extension NSExtendedData on NSData { } /// getBytes:length: - void getBytes(ffi.Pointer buffer, {required int length}) { + void getBytes(ffi.Pointer buffer, {required int length$1}) { _objc_msgSend_zuf90e( this.ref.pointer, _sel_getBytes_length_, buffer, - length, + length$1, ); } @@ -6594,7 +6446,7 @@ extension NSExtendedDate on NSDate { } /// description - NSString get description$2 { + NSString get description$1 { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); return NSString.castFromPointer($ret, retain: true, release: true); } @@ -6712,7 +6564,7 @@ extension NSExtendedDictionary on NSDictionary { } /// description - NSString get description$2 { + NSString get description$1 { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); return NSString.castFromPointer($ret, retain: true, release: true); } @@ -6802,7 +6654,7 @@ extension NSExtendedDictionary on NSDictionary { void getObjects( ffi.Pointer> objects, { required ffi.Pointer> andKeys, - required int count, + required int count$1, }) { objc.checkOsVersionInternal( 'NSDictionary.getObjects:andKeys:count:', @@ -6814,7 +6666,7 @@ extension NSExtendedDictionary on NSDictionary { _sel_getObjects_andKeys_count_, objects, andKeys, - count, + count$1, ); } @@ -7251,12 +7103,12 @@ extension NSExtendedMutableArray on NSMutableArray { /// NSExtendedMutableData extension NSExtendedMutableData on NSMutableData { /// appendBytes:length: - void appendBytes(ffi.Pointer bytes, {required int length}) { + void appendBytes(ffi.Pointer bytes$1, {required int length$2}) { _objc_msgSend_zuf90e( this.ref.pointer, _sel_appendBytes_length_, - bytes, - length, + bytes$1, + length$2, ); } @@ -7291,14 +7143,14 @@ extension NSExtendedMutableData on NSMutableData { void replaceBytesInRange$1( NSRange range, { required ffi.Pointer withBytes, - required int length, + required int length$2, }) { _objc_msgSend_c0vg4w( this.ref.pointer, _sel_replaceBytesInRange_withBytes_length_, range, withBytes, - length, + length$2, ); } @@ -7308,8 +7160,8 @@ extension NSExtendedMutableData on NSMutableData { } /// setData: - void setData(NSData data) { - _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setData_, data.ref.pointer); + void setData(NSData data$1) { + _objc_msgSend_xtuoz7(this.ref.pointer, _sel_setData_, data$1.ref.pointer); } } @@ -7381,7 +7233,7 @@ extension NSExtendedMutableOrderedSet on NSMutableOrderedSet { /// addObjects:count: void addObjects( ffi.Pointer> objects, { - required int count, + required int count$1, }) { objc.checkOsVersionInternal( 'NSMutableOrderedSet.addObjects:count:', @@ -7392,7 +7244,7 @@ extension NSExtendedMutableOrderedSet on NSMutableOrderedSet { this.ref.pointer, _sel_addObjects_count_, objects, - count, + count$1, ); } @@ -7591,7 +7443,7 @@ extension NSExtendedMutableOrderedSet on NSMutableOrderedSet { void replaceObjectsInRange( NSRange range, { required ffi.Pointer> withObjects, - required int count, + required int count$1, }) { objc.checkOsVersionInternal( 'NSMutableOrderedSet.replaceObjectsInRange:withObjects:count:', @@ -7603,7 +7455,7 @@ extension NSExtendedMutableOrderedSet on NSMutableOrderedSet { _sel_replaceObjectsInRange_withObjects_count_, range, withObjects, - count, + count$1, ); } @@ -7811,7 +7663,7 @@ extension NSExtendedOrderedSet on NSOrderedSet { } /// description - NSString get description$2 { + NSString get description$1 { objc.checkOsVersionInternal( 'NSOrderedSet.description', iOS: (false, (5, 0, 0)), @@ -8152,7 +8004,7 @@ extension NSExtendedOrderedSet on NSOrderedSet { } /// intersectsSet: - bool intersectsSet(NSSet set$) { + bool intersectsSet(NSSet set$1) { objc.checkOsVersionInternal( 'NSOrderedSet.intersectsSet:', iOS: (false, (5, 0, 0)), @@ -8161,7 +8013,7 @@ extension NSExtendedOrderedSet on NSOrderedSet { return _objc_msgSend_19nvye5( this.ref.pointer, _sel_intersectsSet_, - set$.ref.pointer, + set$1.ref.pointer, ); } @@ -8194,7 +8046,7 @@ extension NSExtendedOrderedSet on NSOrderedSet { } /// isSubsetOfSet: - bool isSubsetOfSet(NSSet set$) { + bool isSubsetOfSet(NSSet set$1) { objc.checkOsVersionInternal( 'NSOrderedSet.isSubsetOfSet:', iOS: (false, (5, 0, 0)), @@ -8203,7 +8055,7 @@ extension NSExtendedOrderedSet on NSOrderedSet { return _objc_msgSend_19nvye5( this.ref.pointer, _sel_isSubsetOfSet_, - set$.ref.pointer, + set$1.ref.pointer, ); } @@ -8375,7 +8227,7 @@ extension NSExtendedSet on NSSet { } /// description - NSString get description$2 { + NSString get description$1 { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); return NSString.castFromPointer($ret, retain: true, release: true); } @@ -8741,11 +8593,11 @@ class NSIndexSet extends NSObject } /// allocWithZone: - static NSIndexSet allocWithZone(ffi.Pointer zone) { + static NSIndexSet allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSIndexSet, _sel_allocWithZone_, - zone, + zone$1, ); return NSIndexSet.castFromPointer($ret, retain: false, release: true); } @@ -8798,11 +8650,11 @@ extension NSIndexSet$Methods on NSIndexSet { } /// containsIndexes: - bool containsIndexes(NSIndexSet indexSet) { + bool containsIndexes(NSIndexSet indexSet$1) { return _objc_msgSend_19nvye5( this.ref.pointer, _sel_containsIndexes_, - indexSet.ref.pointer, + indexSet$1.ref.pointer, ); } @@ -9178,11 +9030,11 @@ extension NSIndexSet$Methods on NSIndexSet { } /// initWithIndexSet: - NSIndexSet initWithIndexSet(NSIndexSet indexSet) { + NSIndexSet initWithIndexSet(NSIndexSet indexSet$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithIndexSet_, - indexSet.ref.pointer, + indexSet$1.ref.pointer, ); return NSIndexSet.castFromPointer($ret, retain: false, release: true); } @@ -9207,11 +9059,11 @@ extension NSIndexSet$Methods on NSIndexSet { } /// isEqualToIndexSet: - bool isEqualToIndexSet(NSIndexSet indexSet) { + bool isEqualToIndexSet(NSIndexSet indexSet$1) { return _objc_msgSend_19nvye5( this.ref.pointer, _sel_isEqualToIndexSet_, - indexSet.ref.pointer, + indexSet$1.ref.pointer, ); } @@ -9249,6 +9101,22 @@ class NSInputStream extends NSStream { ); } + /// alloc + static NSInputStream alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSInputStream, _sel_alloc); + return NSInputStream.castFromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSInputStream allocWithZone(ffi.Pointer zone$1) { + final $ret = _objc_msgSend_1cwp428( + _class_NSInputStream, + _sel_allocWithZone_, + zone$1, + ); + return NSInputStream.castFromPointer($ret, retain: false, release: true); + } + /// inputStreamWithData: static NSInputStream? inputStreamWithData(NSData data) { final $ret = _objc_msgSend_1sotr3r( @@ -9289,6 +9157,15 @@ class NSInputStream extends NSStream { ? null : NSInputStream.castFromPointer($ret, retain: true, release: true); } + + /// new + static NSInputStream new$() { + final $ret = _objc_msgSend_151sglz(_class_NSInputStream, _sel_new); + return NSInputStream.castFromPointer($ret, retain: false, release: true); + } + + /// Returns a new instance of NSInputStream constructed with the default `new` method. + factory NSInputStream() => new$(); } extension NSInputStream$Methods on NSInputStream { @@ -9310,6 +9187,20 @@ extension NSInputStream$Methods on NSInputStream { return _objc_msgSend_91o635(this.ref.pointer, _sel_hasBytesAvailable); } + /// init + NSInputStream init() { + objc.checkOsVersionInternal( + 'NSInputStream.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + this.ref.retainAndReturnPointer(), + _sel_init, + ); + return NSInputStream.castFromPointer($ret, retain: false, release: true); + } + /// initWithData: NSInputStream initWithData(NSData data) { final $ret = _objc_msgSend_1sotr3r( @@ -9395,11 +9286,11 @@ class NSInvocation extends NSObject { } /// allocWithZone: - static NSInvocation allocWithZone(ffi.Pointer zone) { + static NSInvocation allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSInvocation, _sel_allocWithZone_, - zone, + zone$1, ); return NSInvocation.castFromPointer($ret, retain: false, release: true); } @@ -9475,11 +9366,11 @@ extension NSInvocation$Methods on NSInvocation { } /// invokeWithTarget: - void invokeWithTarget(objc.ObjCObjectBase target) { + void invokeWithTarget(objc.ObjCObjectBase target$1) { _objc_msgSend_xtuoz7( this.ref.pointer, _sel_invokeWithTarget_, - target.ref.pointer, + target$1.ref.pointer, ); } @@ -9581,11 +9472,11 @@ class NSItemProvider extends NSObject implements NSCopying { } /// allocWithZone: - static NSItemProvider allocWithZone(ffi.Pointer zone) { + static NSItemProvider allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSItemProvider, _sel_allocWithZone_, - zone, + zone$1, ); return NSItemProvider.castFromPointer($ret, retain: false, release: true); } @@ -9601,12 +9492,6 @@ class NSItemProvider extends NSObject implements NSCopying { } extension NSItemProvider$Methods on NSItemProvider { - /// autorelease - NSItemProvider autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSItemProvider.castFromPointer($ret, retain: true, release: true); - } - /// canLoadObjectOfClass: bool canLoadObjectOfClass(NSItemProviderReading aClass) { objc.checkOsVersionInternal( @@ -9972,18 +9857,6 @@ extension NSItemProvider$Methods on NSItemProvider { return NSArray.castFromPointer($ret, retain: true, release: true); } - /// retain - NSItemProvider retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSItemProvider.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSItemProvider self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSItemProvider.castFromPointer($ret, retain: true, release: true); - } - /// setSuggestedName: set suggestedName(NSString? value) { objc.checkOsVersionInternal( @@ -10393,11 +10266,11 @@ class NSLocale extends NSObject implements NSCopying, NSSecureCoding { } /// allocWithZone: - static NSLocale allocWithZone(ffi.Pointer zone) { + static NSLocale allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSLocale, _sel_allocWithZone_, - zone, + zone$1, ); return NSLocale.castFromPointer($ret, retain: false, release: true); } @@ -10433,12 +10306,6 @@ class NSLocale extends NSObject implements NSCopying, NSSecureCoding { } extension NSLocale$Methods on NSLocale { - /// autorelease - NSLocale autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSLocale.castFromPointer($ret, retain: true, release: true); - } - /// displayNameForKey:value: NSString? displayNameForKey( NSString key, { @@ -10511,18 +10378,6 @@ extension NSLocale$Methods on NSLocale { ? null : objc.ObjCObjectBase($ret, retain: true, release: true); } - - /// retain - NSLocale retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSLocale.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSLocale self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSLocale.castFromPointer($ret, retain: true, release: true); - } } enum NSLocaleLanguageDirection { @@ -10586,11 +10441,11 @@ class NSMethodSignature extends NSObject { } /// allocWithZone: - static NSMethodSignature allocWithZone(ffi.Pointer zone) { + static NSMethodSignature allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSMethodSignature, _sel_allocWithZone_, - zone, + zone$1, ); return NSMethodSignature.castFromPointer( $ret, @@ -10750,11 +10605,11 @@ class NSMutableArray extends NSArray with ListBase { } /// allocWithZone: - static NSMutableArray allocWithZone(ffi.Pointer zone) { + static NSMutableArray allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSMutableArray, _sel_allocWithZone_, - zone, + zone$1, ); return NSMutableArray.castFromPointer($ret, retain: false, release: true); } @@ -10766,11 +10621,11 @@ class NSMutableArray extends NSArray with ListBase { } /// arrayWithArray: - static NSMutableArray arrayWithArray(NSArray array) { + static NSMutableArray arrayWithArray(NSArray array$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSMutableArray, _sel_arrayWithArray_, - array.ref.pointer, + array$1.ref.pointer, ); return NSMutableArray.castFromPointer($ret, retain: true, release: true); } @@ -10808,13 +10663,13 @@ class NSMutableArray extends NSArray with ListBase { /// arrayWithObjects:count: static NSMutableArray arrayWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { final $ret = _objc_msgSend_zmbtbd( _class_NSMutableArray, _sel_arrayWithObjects_count_, objects, - count, + count$1, ); return NSMutableArray.castFromPointer($ret, retain: true, release: true); } @@ -10862,21 +10717,21 @@ extension NSMutableArray$Methods on NSMutableArray { } /// initWithArray: - NSMutableArray initWithArray(NSArray array) { + NSMutableArray initWithArray(NSArray array$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithArray_, - array.ref.pointer, + array$1.ref.pointer, ); return NSMutableArray.castFromPointer($ret, retain: false, release: true); } /// initWithArray:copyItems: - NSMutableArray initWithArray$1(NSArray array, {required bool copyItems}) { + NSMutableArray initWithArray$1(NSArray array$1, {required bool copyItems}) { final $ret = _objc_msgSend_17amj0z( this.ref.retainAndReturnPointer(), _sel_initWithArray_copyItems_, - array.ref.pointer, + array$1.ref.pointer, copyItems, ); return NSMutableArray.castFromPointer($ret, retain: false, release: true); @@ -10917,13 +10772,13 @@ extension NSMutableArray$Methods on NSMutableArray { /// initWithObjects:count: NSMutableArray initWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { final $ret = _objc_msgSend_zmbtbd( this.ref.retainAndReturnPointer(), _sel_initWithObjects_count_, objects, - count, + count$1, ); return NSMutableArray.castFromPointer($ret, retain: false, release: true); } @@ -11097,11 +10952,11 @@ class NSMutableData extends NSData { } /// allocWithZone: - static NSMutableData allocWithZone(ffi.Pointer zone) { + static NSMutableData allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSMutableData, _sel_allocWithZone_, - zone, + zone$1, ); return NSMutableData.castFromPointer($ret, retain: false, release: true); } @@ -11114,43 +10969,43 @@ class NSMutableData extends NSData { /// dataWithBytes:length: static NSMutableData dataWithBytes( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, }) { final $ret = _objc_msgSend_3nbx5e( _class_NSMutableData, _sel_dataWithBytes_length_, - bytes, - length, + bytes$1, + length$1, ); return NSMutableData.castFromPointer($ret, retain: true, release: true); } /// dataWithBytesNoCopy:length: static NSMutableData dataWithBytesNoCopy( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, }) { final $ret = _objc_msgSend_3nbx5e( _class_NSMutableData, _sel_dataWithBytesNoCopy_length_, - bytes, - length, + bytes$1, + length$1, ); return NSMutableData.castFromPointer($ret, retain: true, release: true); } /// dataWithBytesNoCopy:length:freeWhenDone: static NSMutableData dataWithBytesNoCopy$1( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, required bool freeWhenDone, }) { final $ret = _objc_msgSend_161ne8y( _class_NSMutableData, _sel_dataWithBytesNoCopy_length_freeWhenDone_, - bytes, - length, + bytes$1, + length$1, freeWhenDone, ); return NSMutableData.castFromPointer($ret, retain: true, release: true); @@ -11229,21 +11084,21 @@ class NSMutableData extends NSData { } /// dataWithData: - static NSMutableData dataWithData(NSData data) { + static NSMutableData dataWithData(NSData data$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSMutableData, _sel_dataWithData_, - data.ref.pointer, + data$1.ref.pointer, ); return NSMutableData.castFromPointer($ret, retain: true, release: true); } /// dataWithLength: - static NSMutableData? dataWithLength(int length) { + static NSMutableData? dataWithLength(int length$2) { final $ret = _objc_msgSend_14hpxwa( _class_NSMutableData, _sel_dataWithLength_, - length, + length$2, ); return $ret.address == 0 ? null @@ -11375,36 +11230,36 @@ extension NSMutableData$Methods on NSMutableData { /// initWithBytes:length: NSMutableData initWithBytes( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, }) { final $ret = _objc_msgSend_3nbx5e( this.ref.retainAndReturnPointer(), _sel_initWithBytes_length_, - bytes, - length, + bytes$1, + length$1, ); return NSMutableData.castFromPointer($ret, retain: false, release: true); } /// initWithBytesNoCopy:length: NSMutableData initWithBytesNoCopy( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, }) { final $ret = _objc_msgSend_3nbx5e( this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_, - bytes, - length, + bytes$1, + length$1, ); return NSMutableData.castFromPointer($ret, retain: false, release: true); } /// initWithBytesNoCopy:length:deallocator: NSMutableData initWithBytesNoCopy$1( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, objc.ObjCBlock, ffi.UnsignedLong)>? deallocator, }) { @@ -11416,8 +11271,8 @@ extension NSMutableData$Methods on NSMutableData { final $ret = _objc_msgSend_134vhyh( this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_deallocator_, - bytes, - length, + bytes$1, + length$1, deallocator?.ref.pointer ?? ffi.nullptr, ); return NSMutableData.castFromPointer($ret, retain: false, release: true); @@ -11425,15 +11280,15 @@ extension NSMutableData$Methods on NSMutableData { /// initWithBytesNoCopy:length:freeWhenDone: NSMutableData initWithBytesNoCopy$2( - ffi.Pointer bytes, { - required int length, + ffi.Pointer bytes$1, { + required int length$1, required bool freeWhenDone, }) { final $ret = _objc_msgSend_161ne8y( this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_freeWhenDone_, - bytes, - length, + bytes$1, + length$1, freeWhenDone, ); return NSMutableData.castFromPointer($ret, retain: false, release: true); @@ -11524,21 +11379,21 @@ extension NSMutableData$Methods on NSMutableData { } /// initWithData: - NSMutableData initWithData(NSData data) { + NSMutableData initWithData(NSData data$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithData_, - data.ref.pointer, + data$1.ref.pointer, ); return NSMutableData.castFromPointer($ret, retain: false, release: true); } /// initWithLength: - NSMutableData? initWithLength(int length) { + NSMutableData? initWithLength(int length$2) { final $ret = _objc_msgSend_14hpxwa( this.ref.retainAndReturnPointer(), _sel_initWithLength_, - length, + length$2, ); return $ret.address == 0 ? null @@ -11628,11 +11483,11 @@ class NSMutableDictionary extends NSDictionary { } /// allocWithZone: - static NSMutableDictionary allocWithZone(ffi.Pointer zone) { + static NSMutableDictionary allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSMutableDictionary, _sel_allocWithZone_, - zone, + zone$1, ); return NSMutableDictionary.castFromPointer( $ret, @@ -11722,14 +11577,14 @@ class NSMutableDictionary extends NSDictionary { static NSMutableDictionary dictionaryWithObjects$1( ffi.Pointer> objects, { required ffi.Pointer> forKeys, - required int count, + required int count$1, }) { final $ret = _objc_msgSend_1dydpdi( _class_NSMutableDictionary, _sel_dictionaryWithObjects_forKeys_count_, objects, forKeys, - count, + count$1, ); return NSMutableDictionary.castFromPointer( $ret, @@ -11879,14 +11734,14 @@ extension NSMutableDictionary$Methods on NSMutableDictionary { NSMutableDictionary initWithObjects$1( ffi.Pointer> objects, { required ffi.Pointer> forKeys, - required int count, + required int count$1, }) { final $ret = _objc_msgSend_1dydpdi( this.ref.retainAndReturnPointer(), _sel_initWithObjects_forKeys_count_, objects, forKeys, - count, + count$1, ); return NSMutableDictionary.castFromPointer( $ret, @@ -11968,11 +11823,11 @@ class NSMutableIndexSet extends NSIndexSet { } /// allocWithZone: - static NSMutableIndexSet allocWithZone(ffi.Pointer zone) { + static NSMutableIndexSet allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSMutableIndexSet, _sel_allocWithZone_, - zone, + zone$1, ); return NSMutableIndexSet.castFromPointer( $ret, @@ -12036,11 +11891,11 @@ extension NSMutableIndexSet$Methods on NSMutableIndexSet { } /// addIndexes: - void addIndexes(NSIndexSet indexSet) { + void addIndexes(NSIndexSet indexSet$1) { _objc_msgSend_xtuoz7( this.ref.pointer, _sel_addIndexes_, - indexSet.ref.pointer, + indexSet$1.ref.pointer, ); } @@ -12094,11 +11949,11 @@ extension NSMutableIndexSet$Methods on NSMutableIndexSet { } /// initWithIndexSet: - NSMutableIndexSet initWithIndexSet(NSIndexSet indexSet) { + NSMutableIndexSet initWithIndexSet(NSIndexSet indexSet$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithIndexSet_, - indexSet.ref.pointer, + indexSet$1.ref.pointer, ); return NSMutableIndexSet.castFromPointer( $ret, @@ -12132,11 +11987,11 @@ extension NSMutableIndexSet$Methods on NSMutableIndexSet { } /// removeIndexes: - void removeIndexes(NSIndexSet indexSet) { + void removeIndexes(NSIndexSet indexSet$1) { _objc_msgSend_xtuoz7( this.ref.pointer, _sel_removeIndexes_, - indexSet.ref.pointer, + indexSet$1.ref.pointer, ); } @@ -12201,11 +12056,11 @@ class NSMutableOrderedSet extends NSOrderedSet { } /// allocWithZone: - static NSMutableOrderedSet allocWithZone(ffi.Pointer zone) { + static NSMutableOrderedSet allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSMutableOrderedSet, _sel_allocWithZone_, - zone, + zone$1, ); return NSMutableOrderedSet.castFromPointer( $ret, @@ -12348,7 +12203,7 @@ class NSMutableOrderedSet extends NSOrderedSet { /// orderedSetWithObjects:count: static NSMutableOrderedSet orderedSetWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { objc.checkOsVersionInternal( 'NSMutableOrderedSet.orderedSetWithObjects:count:', @@ -12359,7 +12214,7 @@ class NSMutableOrderedSet extends NSOrderedSet { _class_NSMutableOrderedSet, _sel_orderedSetWithObjects_count_, objects, - count, + count$1, ); return NSMutableOrderedSet.castFromPointer( $ret, @@ -12625,7 +12480,7 @@ extension NSMutableOrderedSet$Methods on NSMutableOrderedSet { /// initWithObjects:count: NSMutableOrderedSet initWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { objc.checkOsVersionInternal( 'NSMutableOrderedSet.initWithObjects:count:', @@ -12636,7 +12491,7 @@ extension NSMutableOrderedSet$Methods on NSMutableOrderedSet { this.ref.retainAndReturnPointer(), _sel_initWithObjects_count_, objects, - count, + count$1, ); return NSMutableOrderedSet.castFromPointer( $ret, @@ -12852,11 +12707,11 @@ class NSMutableSet extends NSSet { } /// allocWithZone: - static NSMutableSet allocWithZone(ffi.Pointer zone) { + static NSMutableSet allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSMutableSet, _sel_allocWithZone_, - zone, + zone$1, ); return NSMutableSet.castFromPointer($ret, retain: false, release: true); } @@ -12916,23 +12771,23 @@ class NSMutableSet extends NSSet { /// setWithObjects:count: static NSMutableSet setWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { final $ret = _objc_msgSend_zmbtbd( _class_NSMutableSet, _sel_setWithObjects_count_, objects, - count, + count$1, ); return NSMutableSet.castFromPointer($ret, retain: true, release: true); } /// setWithSet: - static NSMutableSet setWithSet(NSSet set$) { + static NSMutableSet setWithSet(NSSet set$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSMutableSet, _sel_setWithSet_, - set$.ref.pointer, + set$1.ref.pointer, ); return NSMutableSet.castFromPointer($ret, retain: true, release: true); } @@ -13011,33 +12866,33 @@ extension NSMutableSet$Methods on NSMutableSet { /// initWithObjects:count: NSMutableSet initWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { final $ret = _objc_msgSend_zmbtbd( this.ref.retainAndReturnPointer(), _sel_initWithObjects_count_, objects, - count, + count$1, ); return NSMutableSet.castFromPointer($ret, retain: false, release: true); } /// initWithSet: - NSMutableSet initWithSet(NSSet set$) { + NSMutableSet initWithSet(NSSet set$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithSet_, - set$.ref.pointer, + set$1.ref.pointer, ); return NSMutableSet.castFromPointer($ret, retain: false, release: true); } /// initWithSet:copyItems: - NSMutableSet initWithSet$1(NSSet set$, {required bool copyItems}) { + NSMutableSet initWithSet$1(NSSet set$1, {required bool copyItems}) { final $ret = _objc_msgSend_17amj0z( this.ref.retainAndReturnPointer(), _sel_initWithSet_copyItems_, - set$.ref.pointer, + set$1.ref.pointer, copyItems, ); return NSMutableSet.castFromPointer($ret, retain: false, release: true); @@ -13088,11 +12943,11 @@ class NSMutableString extends NSString { } /// allocWithZone: - static NSMutableString allocWithZone(ffi.Pointer zone) { + static NSMutableString allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSMutableString, _sel_allocWithZone_, - zone, + zone$1, ); return NSMutableString.castFromPointer($ret, retain: false, release: true); } @@ -13136,29 +12991,6 @@ class NSMutableString extends NSString { return NSMutableString.castFromPointer($ret, retain: false, release: true); } - /// objectWithItemProviderData:typeIdentifier:error: - static NSMutableString? objectWithItemProviderData( - NSData data, { - required NSString typeIdentifier, - required ffi.Pointer> error, - }) { - objc.checkOsVersionInternal( - 'NSMutableString.objectWithItemProviderData:typeIdentifier:error:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final $ret = _objc_msgSend_1pnyuds( - _class_NSMutableString, - _sel_objectWithItemProviderData_typeIdentifier_error_, - data.ref.pointer, - typeIdentifier.ref.pointer, - error, - ); - return $ret.address == 0 - ? null - : NSMutableString.castFromPointer($ret, retain: true, release: true); - } - /// string static NSMutableString string() { final $ret = _objc_msgSend_151sglz(_class_NSMutableString, _sel_string); @@ -13184,13 +13016,13 @@ class NSMutableString extends NSString { /// stringWithCharacters:length: static NSMutableString stringWithCharacters( ffi.Pointer characters, { - required int length, + required int length$1, }) { final $ret = _objc_msgSend_9x4k8x( _class_NSMutableString, _sel_stringWithCharacters_length_, characters, - length, + length$1, ); return NSMutableString.castFromPointer($ret, retain: true, release: true); } @@ -13278,11 +13110,11 @@ class NSMutableString extends NSString { } /// stringWithString: - static NSMutableString stringWithString(NSString string) { + static NSMutableString stringWithString(NSString string$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSMutableString, _sel_stringWithString_, - string.ref.pointer, + string$1.ref.pointer, ); return NSMutableString.castFromPointer($ret, retain: true, release: true); } @@ -13337,12 +13169,6 @@ class NSMutableString extends NSString { } extension NSMutableString$Methods on NSMutableString { - /// autorelease - NSMutableString autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSMutableString.castFromPointer($ret, retain: true, release: true); - } - /// init NSMutableString init() { objc.checkOsVersionInternal( @@ -13360,14 +13186,14 @@ extension NSMutableString$Methods on NSMutableString { /// initWithBytes:length:encoding: NSMutableString? initWithBytes( ffi.Pointer bytes, { - required int length, + required int length$1, required int encoding, }) { final $ret = _objc_msgSend_9b3h4v( this.ref.retainAndReturnPointer(), _sel_initWithBytes_length_encoding_, bytes, - length, + length$1, encoding, ); return $ret.address == 0 @@ -13378,7 +13204,7 @@ extension NSMutableString$Methods on NSMutableString { /// initWithBytesNoCopy:length:encoding:deallocator: NSMutableString? initWithBytesNoCopy( ffi.Pointer bytes, { - required int length, + required int length$1, required int encoding, objc.ObjCBlock, ffi.UnsignedLong)>? deallocator, @@ -13387,7 +13213,7 @@ extension NSMutableString$Methods on NSMutableString { this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_encoding_deallocator_, bytes, - length, + length$1, encoding, deallocator?.ref.pointer ?? ffi.nullptr, ); @@ -13399,7 +13225,7 @@ extension NSMutableString$Methods on NSMutableString { /// initWithBytesNoCopy:length:encoding:freeWhenDone: NSMutableString? initWithBytesNoCopy$1( ffi.Pointer bytes, { - required int length, + required int length$1, required int encoding, required bool freeWhenDone, }) { @@ -13407,7 +13233,7 @@ extension NSMutableString$Methods on NSMutableString { this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_, bytes, - length, + length$1, encoding, freeWhenDone, ); @@ -13435,13 +13261,13 @@ extension NSMutableString$Methods on NSMutableString { /// initWithCharacters:length: NSMutableString initWithCharacters( ffi.Pointer characters, { - required int length, + required int length$1, }) { final $ret = _objc_msgSend_9x4k8x( this.ref.retainAndReturnPointer(), _sel_initWithCharacters_length_, characters, - length, + length$1, ); return NSMutableString.castFromPointer($ret, retain: false, release: true); } @@ -13449,7 +13275,7 @@ extension NSMutableString$Methods on NSMutableString { /// initWithCharactersNoCopy:length:deallocator: NSMutableString initWithCharactersNoCopy( ffi.Pointer chars, { - required int length, + required int length$1, objc.ObjCBlock< ffi.Void Function(ffi.Pointer, ffi.UnsignedLong) >? @@ -13459,7 +13285,7 @@ extension NSMutableString$Methods on NSMutableString { this.ref.retainAndReturnPointer(), _sel_initWithCharactersNoCopy_length_deallocator_, chars, - length, + length$1, deallocator?.ref.pointer ?? ffi.nullptr, ); return NSMutableString.castFromPointer($ret, retain: false, release: true); @@ -13468,14 +13294,14 @@ extension NSMutableString$Methods on NSMutableString { /// initWithCharactersNoCopy:length:freeWhenDone: NSMutableString initWithCharactersNoCopy$1( ffi.Pointer characters, { - required int length, + required int length$1, required bool freeWhenDone, }) { final $ret = _objc_msgSend_lh0jh5( this.ref.retainAndReturnPointer(), _sel_initWithCharactersNoCopy_length_freeWhenDone_, characters, - length, + length$1, freeWhenDone, ); return NSMutableString.castFromPointer($ret, retain: false, release: true); @@ -13689,18 +13515,6 @@ extension NSMutableString$Methods on NSMutableString { withString.ref.pointer, ); } - - /// retain - NSMutableString retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSMutableString.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSMutableString self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSMutableString.castFromPointer($ret, retain: true, release: true); - } } /// NSNotification @@ -13738,11 +13552,11 @@ class NSNotification extends NSObject implements NSCopying, NSCoding { } /// allocWithZone: - static NSNotification allocWithZone(ffi.Pointer zone) { + static NSNotification allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSNotification, _sel_allocWithZone_, - zone, + zone$1, ); return NSNotification.castFromPointer($ret, retain: false, release: true); } @@ -13756,13 +13570,13 @@ class NSNotification extends NSObject implements NSCopying, NSCoding { /// notificationWithName:object: static NSNotification notificationWithName( NSString aName, { - objc.ObjCObjectBase? object, + objc.ObjCObjectBase? object$1, }) { final $ret = _objc_msgSend_15qeuct( _class_NSNotification, _sel_notificationWithName_object_, aName.ref.pointer, - object?.ref.pointer ?? ffi.nullptr, + object$1?.ref.pointer ?? ffi.nullptr, ); return NSNotification.castFromPointer($ret, retain: true, release: true); } @@ -13770,15 +13584,15 @@ class NSNotification extends NSObject implements NSCopying, NSCoding { /// notificationWithName:object:userInfo: static NSNotification notificationWithName$1( NSString aName, { - objc.ObjCObjectBase? object, - NSDictionary? userInfo, + objc.ObjCObjectBase? object$1, + NSDictionary? userInfo$1, }) { final $ret = _objc_msgSend_11spmsz( _class_NSNotification, _sel_notificationWithName_object_userInfo_, aName.ref.pointer, - object?.ref.pointer ?? ffi.nullptr, - userInfo?.ref.pointer ?? ffi.nullptr, + object$1?.ref.pointer ?? ffi.nullptr, + userInfo$1?.ref.pointer ?? ffi.nullptr, ); return NSNotification.castFromPointer($ret, retain: true, release: true); } @@ -13788,12 +13602,6 @@ class NSNotification extends NSObject implements NSCopying, NSCoding { } extension NSNotification$Methods on NSNotification { - /// autorelease - NSNotification autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSNotification.castFromPointer($ret, retain: true, release: true); - } - /// encodeWithCoder: void encodeWithCoder(NSCoder coder) { _objc_msgSend_xtuoz7( @@ -13826,9 +13634,9 @@ extension NSNotification$Methods on NSNotification { /// initWithName:object:userInfo: NSNotification initWithName( - NSString name, { - objc.ObjCObjectBase? object, - NSDictionary? userInfo, + NSString name$1, { + objc.ObjCObjectBase? object$1, + NSDictionary? userInfo$1, }) { objc.checkOsVersionInternal( 'NSNotification.initWithName:object:userInfo:', @@ -13838,9 +13646,9 @@ extension NSNotification$Methods on NSNotification { final $ret = _objc_msgSend_11spmsz( this.ref.retainAndReturnPointer(), _sel_initWithName_object_userInfo_, - name.ref.pointer, - object?.ref.pointer ?? ffi.nullptr, - userInfo?.ref.pointer ?? ffi.nullptr, + name$1.ref.pointer, + object$1?.ref.pointer ?? ffi.nullptr, + userInfo$1?.ref.pointer ?? ffi.nullptr, ); return NSNotification.castFromPointer($ret, retain: false, release: true); } @@ -13859,18 +13667,6 @@ extension NSNotification$Methods on NSNotification { : objc.ObjCObjectBase($ret, retain: true, release: true); } - /// retain - NSNotification retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSNotification.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSNotification self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSNotification.castFromPointer($ret, retain: true, release: true); - } - /// userInfo NSDictionary? get userInfo { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_userInfo); @@ -13915,11 +13711,11 @@ class NSNull extends NSObject implements NSCopying, NSSecureCoding { } /// allocWithZone: - static NSNull allocWithZone(ffi.Pointer zone) { + static NSNull allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSNull, _sel_allocWithZone_, - zone, + zone$1, ); return NSNull.castFromPointer($ret, retain: false, release: true); } @@ -13946,12 +13742,6 @@ class NSNull extends NSObject implements NSCopying, NSSecureCoding { } extension NSNull$Methods on NSNull { - /// autorelease - NSNull autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSNull.castFromPointer($ret, retain: true, release: true); - } - /// encodeWithCoder: void encodeWithCoder(NSCoder coder) { _objc_msgSend_xtuoz7( @@ -13986,18 +13776,6 @@ extension NSNull$Methods on NSNull { ? null : NSNull.castFromPointer($ret, retain: false, release: true); } - - /// retain - NSNull retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSNull.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSNull self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSNull.castFromPointer($ret, retain: true, release: true); - } } /// NSNumber @@ -14035,11 +13813,11 @@ class NSNumber extends NSValue { } /// allocWithZone: - static NSNumber allocWithZone(ffi.Pointer zone) { + static NSNumber allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSNumber, _sel_allocWithZone_, - zone, + zone$1, ); return NSNumber.castFromPointer($ret, retain: false, release: true); } @@ -14131,13 +13909,13 @@ extension NSNumber$Methods on NSNumber { /// initWithBytes:objCType: NSNumber initWithBytes( ffi.Pointer value, { - required ffi.Pointer objCType, + required ffi.Pointer objCType$1, }) { final $ret = _objc_msgSend_e9mncn( this.ref.retainAndReturnPointer(), _sel_initWithBytes_objCType_, value, - objCType, + objCType$1, ); return NSNumber.castFromPointer($ret, retain: false, release: true); } @@ -14597,23 +14375,23 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { } /// allocWithZone: - static NSObject allocWithZone(ffi.Pointer zone) { + static NSObject allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSObject, _sel_allocWithZone_, - zone, + zone$1, ); return NSObject.castFromPointer($ret, retain: false, release: true); } /// class - static objc.ObjCObjectBase class$1() { + static objc.ObjCObjectBase class$() { final $ret = _objc_msgSend_151sglz(_class_NSObject, _sel_class); return objc.ObjCObjectBase($ret, retain: true, release: true); } /// conformsToProtocol: - static bool conformsToProtocol$1(Protocol protocol) { + static bool conformsToProtocol(Protocol protocol) { objc.checkOsVersionInternal( 'NSObject.conformsToProtocol:', iOS: (false, (2, 0, 0)), @@ -14627,7 +14405,7 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { } /// copyWithZone: - static objc.ObjCObjectBase copyWithZone(ffi.Pointer zone) { + static objc.ObjCObjectBase copyWithZone(ffi.Pointer zone$1) { objc.checkOsVersionInternal( 'NSObject.copyWithZone:', iOS: (false, (2, 0, 0)), @@ -14636,13 +14414,13 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { final $ret = _objc_msgSend_1cwp428( _class_NSObject, _sel_copyWithZone_, - zone, + zone$1, ); return objc.ObjCObjectBase($ret, retain: false, release: true); } /// debugDescription - static NSString debugDescription$1() { + static NSString debugDescription() { objc.checkOsVersionInternal( 'NSObject.debugDescription', iOS: (false, (2, 0, 0)), @@ -14653,7 +14431,7 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { } /// description - static NSString description$1() { + static NSString description() { objc.checkOsVersionInternal( 'NSObject.description', iOS: (false, (2, 0, 0)), @@ -14664,7 +14442,7 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { } /// hash - static int hash$1() { + static int hash() { objc.checkOsVersionInternal( 'NSObject.hash', iOS: (false, (2, 0, 0)), @@ -14751,7 +14529,7 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { } /// mutableCopyWithZone: - static objc.ObjCObjectBase mutableCopyWithZone(ffi.Pointer zone) { + static objc.ObjCObjectBase mutableCopyWithZone(ffi.Pointer zone$1) { objc.checkOsVersionInternal( 'NSObject.mutableCopyWithZone:', iOS: (false, (2, 0, 0)), @@ -14760,7 +14538,7 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { final $ret = _objc_msgSend_1cwp428( _class_NSObject, _sel_mutableCopyWithZone_, - zone, + zone$1, ); return objc.ObjCObjectBase($ret, retain: false, release: true); } @@ -14800,7 +14578,7 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { } /// superclass - static objc.ObjCObjectBase superclass$1() { + static objc.ObjCObjectBase superclass() { objc.checkOsVersionInternal( 'NSObject.superclass', iOS: (false, (2, 0, 0)), @@ -14815,27 +14593,6 @@ class NSObject extends objc.ObjCObjectBase implements NSObjectProtocol { } extension NSObject$Methods on NSObject { - /// autorelease - NSObject autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSObject.castFromPointer($ret, retain: true, release: true); - } - - /// class - objc.ObjCObjectBase class$() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_class); - return objc.ObjCObjectBase($ret, retain: true, release: true); - } - - /// conformsToProtocol: - bool conformsToProtocol(Protocol aProtocol) { - return _objc_msgSend_19nvye5( - this.ref.pointer, - _sel_conformsToProtocol_, - aProtocol.ref.pointer, - ); - } - /// copy objc.ObjCObjectBase copy() { objc.checkOsVersionInternal( @@ -14852,24 +14609,6 @@ extension NSObject$Methods on NSObject { _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_dealloc); } - /// debugDescription - NSString get debugDescription { - if (!objc.respondsToSelector(this.ref.pointer, _sel_debugDescription)) { - throw objc.UnimplementedOptionalMethodException( - 'NSObject', - 'debugDescription', - ); - } - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_debugDescription); - return NSString.castFromPointer($ret, retain: true, release: true); - } - - /// description - NSString get description { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); - return NSString.castFromPointer($ret, retain: true, release: true); - } - /// doesNotRecognizeSelector: void doesNotRecognizeSelector(ffi.Pointer aSelector) { objc.checkOsVersionInternal( @@ -14910,11 +14649,6 @@ extension NSObject$Methods on NSObject { return objc.ObjCObjectBase($ret, retain: true, release: true); } - /// hash - int get hash { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_hash); - } - /// init NSObject init() { objc.checkOsVersionInternal( @@ -15042,43 +14776,6 @@ extension NSObject$Methods on NSObject { return objc.ObjCObjectBase($ret, retain: true, release: true); } - /// release - void release() { - _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_release); - } - - /// respondsToSelector: - bool respondsToSelector(ffi.Pointer aSelector) { - return _objc_msgSend_1srf6wk( - this.ref.pointer, - _sel_respondsToSelector_, - aSelector, - ); - } - - /// retain - NSObject retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSObject.castFromPointer($ret, retain: true, release: true); - } - - /// retainCount - int retainCount() { - return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_retainCount); - } - - /// self - NSObject self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSObject.castFromPointer($ret, retain: true, release: true); - } - - /// superclass - objc.ObjCObjectBase get superclass { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_superclass); - return objc.ObjCObjectBase($ret, retain: true, release: true); - } - /// zone ffi.Pointer zone() { return _objc_msgSend_sz90oi(this.ref.pointer, _sel_zone); @@ -16179,11 +15876,11 @@ class NSOrderedCollectionChange extends NSObject { } /// allocWithZone: - static NSOrderedCollectionChange allocWithZone(ffi.Pointer zone) { + static NSOrderedCollectionChange allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSOrderedCollectionChange, _sel_allocWithZone_, - zone, + zone$1, ); return NSOrderedCollectionChange.castFromPointer( $ret, @@ -16199,7 +15896,7 @@ class NSOrderedCollectionChange extends NSObject { static NSOrderedCollectionChange changeWithObject( objc.ObjCObjectBase? anObject, { required NSCollectionChangeType type, - required int index, + required int index$1, }) { objc.checkOsVersionInternal( 'NSOrderedCollectionChange.changeWithObject:type:index:', @@ -16211,7 +15908,7 @@ class NSOrderedCollectionChange extends NSObject { _sel_changeWithObject_type_index_, anObject?.ref.pointer ?? ffi.nullptr, type.value, - index, + index$1, ); return NSOrderedCollectionChange.castFromPointer( $ret, @@ -16227,8 +15924,8 @@ class NSOrderedCollectionChange extends NSObject { static NSOrderedCollectionChange changeWithObject$1( objc.ObjCObjectBase? anObject, { required NSCollectionChangeType type, - required int index, - required int associatedIndex, + required int index$1, + required int associatedIndex$1, }) { objc.checkOsVersionInternal( 'NSOrderedCollectionChange.changeWithObject:type:index:associatedIndex:', @@ -16240,8 +15937,8 @@ class NSOrderedCollectionChange extends NSObject { _sel_changeWithObject_type_index_associatedIndex_, anObject?.ref.pointer ?? ffi.nullptr, type.value, - index, - associatedIndex, + index$1, + associatedIndex$1, ); return NSOrderedCollectionChange.castFromPointer( $ret, @@ -16327,7 +16024,7 @@ extension NSOrderedCollectionChange$Methods on NSOrderedCollectionChange { NSOrderedCollectionChange initWithObject( objc.ObjCObjectBase? anObject, { required NSCollectionChangeType type, - required int index, + required int index$1, }) { objc.checkOsVersionInternal( 'NSOrderedCollectionChange.initWithObject:type:index:', @@ -16339,7 +16036,7 @@ extension NSOrderedCollectionChange$Methods on NSOrderedCollectionChange { _sel_initWithObject_type_index_, anObject?.ref.pointer ?? ffi.nullptr, type.value, - index, + index$1, ); return NSOrderedCollectionChange.castFromPointer( $ret, @@ -16355,8 +16052,8 @@ extension NSOrderedCollectionChange$Methods on NSOrderedCollectionChange { NSOrderedCollectionChange initWithObject$1( objc.ObjCObjectBase? anObject, { required NSCollectionChangeType type, - required int index, - required int associatedIndex, + required int index$1, + required int associatedIndex$1, }) { objc.checkOsVersionInternal( 'NSOrderedCollectionChange.initWithObject:type:index:associatedIndex:', @@ -16368,8 +16065,8 @@ extension NSOrderedCollectionChange$Methods on NSOrderedCollectionChange { _sel_initWithObject_type_index_associatedIndex_, anObject?.ref.pointer ?? ffi.nullptr, type.value, - index, - associatedIndex, + index$1, + associatedIndex$1, ); return NSOrderedCollectionChange.castFromPointer( $ret, @@ -16445,11 +16142,13 @@ class NSOrderedCollectionDifference extends NSObject } /// allocWithZone: - static NSOrderedCollectionDifference allocWithZone(ffi.Pointer zone) { + static NSOrderedCollectionDifference allocWithZone( + ffi.Pointer zone$1, + ) { final $ret = _objc_msgSend_1cwp428( _class_NSOrderedCollectionDifference, _sel_allocWithZone_, - zone, + zone$1, ); return NSOrderedCollectionDifference.castFromPointer( $ret, @@ -16728,11 +16427,11 @@ class NSOrderedSet extends NSObject } /// allocWithZone: - static NSOrderedSet allocWithZone(ffi.Pointer zone) { + static NSOrderedSet allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSOrderedSet, _sel_allocWithZone_, - zone, + zone$1, ); return NSOrderedSet.castFromPointer($ret, retain: false, release: true); } @@ -16823,7 +16522,7 @@ class NSOrderedSet extends NSObject /// orderedSetWithObjects:count: static NSOrderedSet orderedSetWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { objc.checkOsVersionInternal( 'NSOrderedSet.orderedSetWithObjects:count:', @@ -16834,7 +16533,7 @@ class NSOrderedSet extends NSObject _class_NSOrderedSet, _sel_orderedSetWithObjects_count_, objects, - count, + count$1, ); return NSOrderedSet.castFromPointer($ret, retain: true, release: true); } @@ -17078,7 +16777,7 @@ extension NSOrderedSet$Methods on NSOrderedSet { /// initWithObjects:count: NSOrderedSet initWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { objc.checkOsVersionInternal( 'NSOrderedSet.initWithObjects:count:', @@ -17089,7 +16788,7 @@ extension NSOrderedSet$Methods on NSOrderedSet { this.ref.retainAndReturnPointer(), _sel_initWithObjects_count_, objects, - count, + count$1, ); return NSOrderedSet.castFromPointer($ret, retain: false, release: true); } @@ -17224,6 +16923,28 @@ class NSOutputStream extends NSStream { ); } + /// alloc + static NSOutputStream alloc() { + final $ret = _objc_msgSend_151sglz(_class_NSOutputStream, _sel_alloc); + return NSOutputStream.castFromPointer($ret, retain: false, release: true); + } + + /// allocWithZone: + static NSOutputStream allocWithZone(ffi.Pointer zone$1) { + final $ret = _objc_msgSend_1cwp428( + _class_NSOutputStream, + _sel_allocWithZone_, + zone$1, + ); + return NSOutputStream.castFromPointer($ret, retain: false, release: true); + } + + /// new + static NSOutputStream new$() { + final $ret = _objc_msgSend_151sglz(_class_NSOutputStream, _sel_new); + return NSOutputStream.castFromPointer($ret, retain: false, release: true); + } + /// outputStreamToBuffer:capacity: static NSOutputStream outputStreamToBuffer( ffi.Pointer buffer, { @@ -17281,6 +17002,9 @@ class NSOutputStream extends NSStream { ? null : NSOutputStream.castFromPointer($ret, retain: true, release: true); } + + /// Returns a new instance of NSOutputStream constructed with the default `new` method. + factory NSOutputStream() => new$(); } extension NSOutputStream$Methods on NSOutputStream { @@ -17289,6 +17013,20 @@ extension NSOutputStream$Methods on NSOutputStream { return _objc_msgSend_91o635(this.ref.pointer, _sel_hasSpaceAvailable); } + /// init + NSOutputStream init() { + objc.checkOsVersionInternal( + 'NSOutputStream.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + this.ref.retainAndReturnPointer(), + _sel_init, + ); + return NSOutputStream.castFromPointer($ret, retain: false, release: true); + } + /// initToBuffer:capacity: NSOutputStream initToBuffer( ffi.Pointer buffer, { @@ -17389,11 +17127,11 @@ class NSPort extends NSObject implements NSCopying, NSCoding { } /// allocWithZone: - static NSPort allocWithZone(ffi.Pointer zone) { + static NSPort allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSPort, _sel_allocWithZone_, - zone, + zone$1, ); return NSPort.castFromPointer($ret, retain: false, release: true); } @@ -17415,12 +17153,6 @@ class NSPort extends NSObject implements NSCopying, NSCoding { } extension NSPort$Methods on NSPort { - /// autorelease - NSPort autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSPort.castFromPointer($ret, retain: true, release: true); - } - /// delegate NSPortDelegate? delegate() { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_delegate); @@ -17489,12 +17221,6 @@ extension NSPort$Methods on NSPort { return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_reservedSpaceLength); } - /// retain - NSPort retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSPort.castFromPointer($ret, retain: true, release: true); - } - /// scheduleInRunLoop:forMode: void scheduleInRunLoop(NSRunLoop runLoop, {required NSString forMode}) { _objc_msgSend_pfv6jd( @@ -17505,12 +17231,6 @@ extension NSPort$Methods on NSPort { ); } - /// self - NSPort self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSPort.castFromPointer($ret, retain: true, release: true); - } - /// sendBeforeDate:components:from:reserved: bool sendBeforeDate( NSDate limitDate, { @@ -17767,11 +17487,11 @@ class NSPortMessage extends NSObject { } /// allocWithZone: - static NSPortMessage allocWithZone(ffi.Pointer zone) { + static NSPortMessage allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSPortMessage, _sel_allocWithZone_, - zone, + zone$1, ); return NSPortMessage.castFromPointer($ret, retain: false, release: true); } @@ -17787,12 +17507,6 @@ class NSPortMessage extends NSObject { } extension NSPortMessage$Methods on NSPortMessage { - /// autorelease - NSPortMessage autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSPortMessage.castFromPointer($ret, retain: true, release: true); - } - /// components NSArray? get components { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_components); @@ -17817,16 +17531,16 @@ extension NSPortMessage$Methods on NSPortMessage { /// initWithSendPort:receivePort:components: NSPortMessage initWithSendPort( - NSPort? sendPort, { - NSPort? receivePort, - NSArray? components, + NSPort? sendPort$1, { + NSPort? receivePort$1, + NSArray? components$1, }) { final $ret = _objc_msgSend_11spmsz( this.ref.retainAndReturnPointer(), _sel_initWithSendPort_receivePort_components_, - sendPort?.ref.pointer ?? ffi.nullptr, - receivePort?.ref.pointer ?? ffi.nullptr, - components?.ref.pointer ?? ffi.nullptr, + sendPort$1?.ref.pointer ?? ffi.nullptr, + receivePort$1?.ref.pointer ?? ffi.nullptr, + components$1?.ref.pointer ?? ffi.nullptr, ); return NSPortMessage.castFromPointer($ret, retain: false, release: true); } @@ -17844,18 +17558,6 @@ extension NSPortMessage$Methods on NSPortMessage { : NSPort.castFromPointer($ret, retain: true, release: true); } - /// retain - NSPortMessage retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSPortMessage.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSPortMessage self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSPortMessage.castFromPointer($ret, retain: true, release: true); - } - /// sendBeforeDate: bool sendBeforeDate(NSDate date) { return _objc_msgSend_19nvye5( @@ -17939,11 +17641,11 @@ class NSProgress extends NSObject { } /// allocWithZone: - static NSProgress allocWithZone(ffi.Pointer zone) { + static NSProgress allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSProgress, _sel_allocWithZone_, - zone, + zone$1, ); return NSProgress.castFromPointer($ret, retain: false, release: true); } @@ -18208,7 +17910,7 @@ extension NSProgress$Methods on NSProgress { /// initWithParent:userInfo: NSProgress initWithParent( NSProgress? parentProgressOrNil, { - NSDictionary? userInfo, + NSDictionary? userInfo$1, }) { objc.checkOsVersionInternal( 'NSProgress.initWithParent:userInfo:', @@ -18219,7 +17921,7 @@ extension NSProgress$Methods on NSProgress { this.ref.retainAndReturnPointer(), _sel_initWithParent_userInfo_, parentProgressOrNil?.ref.pointer ?? ffi.nullptr, - userInfo?.ref.pointer ?? ffi.nullptr, + userInfo$1?.ref.pointer ?? ffi.nullptr, ); return NSProgress.castFromPointer($ret, retain: false, release: true); } @@ -18776,11 +18478,11 @@ class NSRunLoop extends NSObject { } /// allocWithZone: - static NSRunLoop allocWithZone(ffi.Pointer zone) { + static NSRunLoop allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSRunLoop, _sel_allocWithZone_, - zone, + zone$1, ); return NSRunLoop.castFromPointer($ret, retain: false, release: true); } @@ -18843,12 +18545,6 @@ extension NSRunLoop$Methods on NSRunLoop { ); } - /// autorelease - NSRunLoop autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSRunLoop.castFromPointer($ret, retain: true, release: true); - } - /// currentMode NSString? get currentMode { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_currentMode); @@ -18897,18 +18593,6 @@ extension NSRunLoop$Methods on NSRunLoop { forMode.ref.pointer, ); } - - /// retain - NSRunLoop retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSRunLoop.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSRunLoop self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSRunLoop.castFromPointer($ret, retain: true, release: true); - } } /// NSSecureCoding @@ -19193,8 +18877,12 @@ class NSSet extends NSObject } /// allocWithZone: - static NSSet allocWithZone(ffi.Pointer zone) { - final $ret = _objc_msgSend_1cwp428(_class_NSSet, _sel_allocWithZone_, zone); + static NSSet allocWithZone(ffi.Pointer zone$1) { + final $ret = _objc_msgSend_1cwp428( + _class_NSSet, + _sel_allocWithZone_, + zone$1, + ); return NSSet.castFromPointer($ret, retain: false, release: true); } @@ -19243,23 +18931,23 @@ class NSSet extends NSObject /// setWithObjects:count: static NSSet setWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { final $ret = _objc_msgSend_zmbtbd( _class_NSSet, _sel_setWithObjects_count_, objects, - count, + count$1, ); return NSSet.castFromPointer($ret, retain: true, release: true); } /// setWithSet: - static NSSet setWithSet(NSSet set$) { + static NSSet setWithSet(NSSet set$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSSet, _sel_setWithSet_, - set$.ref.pointer, + set$1.ref.pointer, ); return NSSet.castFromPointer($ret, retain: true, release: true); } @@ -19352,33 +19040,33 @@ extension NSSet$Methods on NSSet { /// initWithObjects:count: NSSet initWithObjects$1( ffi.Pointer> objects, { - required int count, + required int count$1, }) { final $ret = _objc_msgSend_zmbtbd( this.ref.retainAndReturnPointer(), _sel_initWithObjects_count_, objects, - count, + count$1, ); return NSSet.castFromPointer($ret, retain: false, release: true); } /// initWithSet: - NSSet initWithSet(NSSet set$) { + NSSet initWithSet(NSSet set$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initWithSet_, - set$.ref.pointer, + set$1.ref.pointer, ); return NSSet.castFromPointer($ret, retain: false, release: true); } /// initWithSet:copyItems: - NSSet initWithSet$1(NSSet set$, {required bool copyItems}) { + NSSet initWithSet$1(NSSet set$1, {required bool copyItems}) { final $ret = _objc_msgSend_17amj0z( this.ref.retainAndReturnPointer(), _sel_initWithSet_copyItems_, - set$.ref.pointer, + set$1.ref.pointer, copyItems, ); return NSSet.castFromPointer($ret, retain: false, release: true); @@ -19443,11 +19131,11 @@ class NSStream extends NSObject { } /// allocWithZone: - static NSStream allocWithZone(ffi.Pointer zone) { + static NSStream allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSStream, _sel_allocWithZone_, - zone, + zone$1, ); return NSStream.castFromPointer($ret, retain: false, release: true); } @@ -19463,12 +19151,6 @@ class NSStream extends NSObject { } extension NSStream$Methods on NSStream { - /// autorelease - NSStream autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSStream.castFromPointer($ret, retain: true, release: true); - } - /// close void close() { _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_close); @@ -19523,12 +19205,6 @@ extension NSStream$Methods on NSStream { ); } - /// retain - NSStream retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSStream.castFromPointer($ret, retain: true, release: true); - } - /// scheduleInRunLoop:forMode: void scheduleInRunLoop(NSRunLoop aRunLoop, {required NSString forMode}) { _objc_msgSend_pfv6jd( @@ -19539,12 +19215,6 @@ extension NSStream$Methods on NSStream { ); } - /// self - NSStream self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSStream.castFromPointer($ret, retain: true, release: true); - } - /// setDelegate: set delegate(NSStreamDelegate? value) { _objc_msgSend_xtuoz7( @@ -19804,7 +19474,7 @@ class NSString extends NSObject implements NSCopying, NSMutableCopying, NSSecureCoding { factory NSString(String str) { final cstr = str.toNativeUtf16(); - final nsstr = stringWithCharacters(cstr.cast(), length: str.length); + final nsstr = stringWithCharacters(cstr.cast(), length$1: str.length); pkg_ffi.calloc.free(cstr); return nsstr; } @@ -19842,11 +19512,11 @@ class NSString extends NSObject } /// allocWithZone: - static NSString allocWithZone(ffi.Pointer zone) { + static NSString allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSString, _sel_allocWithZone_, - zone, + zone$1, ); return NSString.castFromPointer($ret, retain: false, release: true); } @@ -19890,29 +19560,6 @@ class NSString extends NSObject return NSString.castFromPointer($ret, retain: false, release: true); } - /// objectWithItemProviderData:typeIdentifier:error: - static NSString? objectWithItemProviderData( - NSData data, { - required NSString typeIdentifier, - required ffi.Pointer> error, - }) { - objc.checkOsVersionInternal( - 'NSString.objectWithItemProviderData:typeIdentifier:error:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final $ret = _objc_msgSend_1pnyuds( - _class_NSString, - _sel_objectWithItemProviderData_typeIdentifier_error_, - data.ref.pointer, - typeIdentifier.ref.pointer, - error, - ); - return $ret.address == 0 - ? null - : NSString.castFromPointer($ret, retain: true, release: true); - } - /// string static NSString string() { final $ret = _objc_msgSend_151sglz(_class_NSString, _sel_string); @@ -19938,13 +19585,13 @@ class NSString extends NSObject /// stringWithCharacters:length: static NSString stringWithCharacters( ffi.Pointer characters, { - required int length, + required int length$1, }) { final $ret = _objc_msgSend_9x4k8x( _class_NSString, _sel_stringWithCharacters_length_, characters, - length, + length$1, ); return NSString.castFromPointer($ret, retain: true, release: true); } @@ -20032,11 +19679,11 @@ class NSString extends NSObject } /// stringWithString: - static NSString stringWithString(NSString string) { + static NSString stringWithString(NSString string$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSString, _sel_stringWithString_, - string.ref.pointer, + string$1.ref.pointer, ); return NSString.castFromPointer($ret, retain: true, release: true); } @@ -20085,12 +19732,6 @@ class NSString extends NSObject } extension NSString$Methods on NSString { - /// autorelease - NSString autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSString.castFromPointer($ret, retain: true, release: true); - } - /// characterAtIndex: int characterAtIndex(int index) { return _objc_msgSend_1deg8x( @@ -20126,14 +19767,14 @@ extension NSString$Methods on NSString { /// initWithBytes:length:encoding: NSString? initWithBytes( ffi.Pointer bytes, { - required int length, + required int length$1, required int encoding, }) { final $ret = _objc_msgSend_9b3h4v( this.ref.retainAndReturnPointer(), _sel_initWithBytes_length_encoding_, bytes, - length, + length$1, encoding, ); return $ret.address == 0 @@ -20144,7 +19785,7 @@ extension NSString$Methods on NSString { /// initWithBytesNoCopy:length:encoding:deallocator: NSString? initWithBytesNoCopy( ffi.Pointer bytes, { - required int length, + required int length$1, required int encoding, objc.ObjCBlock, ffi.UnsignedLong)>? deallocator, @@ -20153,7 +19794,7 @@ extension NSString$Methods on NSString { this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_encoding_deallocator_, bytes, - length, + length$1, encoding, deallocator?.ref.pointer ?? ffi.nullptr, ); @@ -20165,7 +19806,7 @@ extension NSString$Methods on NSString { /// initWithBytesNoCopy:length:encoding:freeWhenDone: NSString? initWithBytesNoCopy$1( ffi.Pointer bytes, { - required int length, + required int length$1, required int encoding, required bool freeWhenDone, }) { @@ -20173,7 +19814,7 @@ extension NSString$Methods on NSString { this.ref.retainAndReturnPointer(), _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_, bytes, - length, + length$1, encoding, freeWhenDone, ); @@ -20201,13 +19842,13 @@ extension NSString$Methods on NSString { /// initWithCharacters:length: NSString initWithCharacters( ffi.Pointer characters, { - required int length, + required int length$1, }) { final $ret = _objc_msgSend_9x4k8x( this.ref.retainAndReturnPointer(), _sel_initWithCharacters_length_, characters, - length, + length$1, ); return NSString.castFromPointer($ret, retain: false, release: true); } @@ -20215,7 +19856,7 @@ extension NSString$Methods on NSString { /// initWithCharactersNoCopy:length:deallocator: NSString initWithCharactersNoCopy( ffi.Pointer chars, { - required int length, + required int length$1, objc.ObjCBlock< ffi.Void Function(ffi.Pointer, ffi.UnsignedLong) >? @@ -20225,7 +19866,7 @@ extension NSString$Methods on NSString { this.ref.retainAndReturnPointer(), _sel_initWithCharactersNoCopy_length_deallocator_, chars, - length, + length$1, deallocator?.ref.pointer ?? ffi.nullptr, ); return NSString.castFromPointer($ret, retain: false, release: true); @@ -20234,14 +19875,14 @@ extension NSString$Methods on NSString { /// initWithCharactersNoCopy:length:freeWhenDone: NSString initWithCharactersNoCopy$1( ffi.Pointer characters, { - required int length, + required int length$1, required bool freeWhenDone, }) { final $ret = _objc_msgSend_lh0jh5( this.ref.retainAndReturnPointer(), _sel_initWithCharactersNoCopy_length_freeWhenDone_, characters, - length, + length$1, freeWhenDone, ); return NSString.castFromPointer($ret, retain: false, release: true); @@ -20445,18 +20086,6 @@ extension NSString$Methods on NSString { int get length { return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_length); } - - /// retain - NSString retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSString.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSString self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSString.castFromPointer($ret, retain: true, release: true); - } } sealed class NSStringCompareOptions { @@ -20549,11 +20178,11 @@ extension NSStringExtensionMethods on NSString { } /// caseInsensitiveCompare: - NSComparisonResult caseInsensitiveCompare(NSString string) { + NSComparisonResult caseInsensitiveCompare(NSString string$1) { final $ret = _objc_msgSend_1ym6zyw( this.ref.pointer, _sel_caseInsensitiveCompare_, - string.ref.pointer, + string$1.ref.pointer, ); return NSComparisonResult.fromValue($ret); } @@ -20570,21 +20199,21 @@ extension NSStringExtensionMethods on NSString { } /// compare: - NSComparisonResult compare(NSString string) { + NSComparisonResult compare(NSString string$1) { final $ret = _objc_msgSend_1ym6zyw( this.ref.pointer, _sel_compare_, - string.ref.pointer, + string$1.ref.pointer, ); return NSComparisonResult.fromValue($ret); } /// compare:options: - NSComparisonResult compare$1(NSString string, {required int options}) { + NSComparisonResult compare$1(NSString string$1, {required int options}) { final $ret = _objc_msgSend_pg1fnv( this.ref.pointer, _sel_compare_options_, - string.ref.pointer, + string$1.ref.pointer, options, ); return NSComparisonResult.fromValue($ret); @@ -20592,14 +20221,14 @@ extension NSStringExtensionMethods on NSString { /// compare:options:range: NSComparisonResult compare$2( - NSString string, { + NSString string$1, { required int options, required NSRange range, }) { final $ret = _objc_msgSend_xrqic1( this.ref.pointer, _sel_compare_options_range_, - string.ref.pointer, + string$1.ref.pointer, options, range, ); @@ -20608,7 +20237,7 @@ extension NSStringExtensionMethods on NSString { /// compare:options:range:locale: NSComparisonResult compare$3( - NSString string, { + NSString string$1, { required int options, required NSRange range, objc.ObjCObjectBase? locale, @@ -20616,7 +20245,7 @@ extension NSStringExtensionMethods on NSString { final $ret = _objc_msgSend_1895u4n( this.ref.pointer, _sel_compare_options_range_locale_, - string.ref.pointer, + string$1.ref.pointer, options, range, locale?.ref.pointer ?? ffi.nullptr, @@ -20710,7 +20339,7 @@ extension NSStringExtensionMethods on NSString { } /// description - NSString get description$2 { + NSString get description$1 { final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_description); return NSString.castFromPointer($ret, retain: true, release: true); } @@ -20877,7 +20506,7 @@ extension NSStringExtensionMethods on NSString { } /// hash - int get hash$2 { + int get hash$1 { return _objc_msgSend_xw2lbc(this.ref.pointer, _sel_hash); } @@ -20951,11 +20580,11 @@ extension NSStringExtensionMethods on NSString { } /// localizedCaseInsensitiveCompare: - NSComparisonResult localizedCaseInsensitiveCompare(NSString string) { + NSComparisonResult localizedCaseInsensitiveCompare(NSString string$1) { final $ret = _objc_msgSend_1ym6zyw( this.ref.pointer, _sel_localizedCaseInsensitiveCompare_, - string.ref.pointer, + string$1.ref.pointer, ); return NSComparisonResult.fromValue($ret); } @@ -20975,11 +20604,11 @@ extension NSStringExtensionMethods on NSString { } /// localizedCompare: - NSComparisonResult localizedCompare(NSString string) { + NSComparisonResult localizedCompare(NSString string$1) { final $ret = _objc_msgSend_1ym6zyw( this.ref.pointer, _sel_localizedCompare_, - string.ref.pointer, + string$1.ref.pointer, ); return NSComparisonResult.fromValue($ret); } @@ -20999,7 +20628,7 @@ extension NSStringExtensionMethods on NSString { } /// localizedStandardCompare: - NSComparisonResult localizedStandardCompare(NSString string) { + NSComparisonResult localizedStandardCompare(NSString string$1) { objc.checkOsVersionInternal( 'NSString.localizedStandardCompare:', iOS: (false, (4, 0, 0)), @@ -21008,7 +20637,7 @@ extension NSStringExtensionMethods on NSString { final $ret = _objc_msgSend_1ym6zyw( this.ref.pointer, _sel_localizedStandardCompare_, - string.ref.pointer, + string$1.ref.pointer, ); return NSComparisonResult.fromValue($ret); } @@ -21683,11 +21312,11 @@ class NSTimer extends NSObject { } /// allocWithZone: - static NSTimer allocWithZone(ffi.Pointer zone) { + static NSTimer allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSTimer, _sel_allocWithZone_, - zone, + zone$1, ); return NSTimer.castFromPointer($ret, retain: false, release: true); } @@ -21740,7 +21369,7 @@ class NSTimer extends NSObject { double ti, { required objc.ObjCObjectBase target, required ffi.Pointer selector, - objc.ObjCObjectBase? userInfo, + objc.ObjCObjectBase? userInfo$1, required bool repeats, }) { final $ret = _objc_msgSend_ot6jdx( @@ -21749,7 +21378,7 @@ class NSTimer extends NSObject { ti, target.ref.pointer, selector, - userInfo?.ref.pointer ?? ffi.nullptr, + userInfo$1?.ref.pointer ?? ffi.nullptr, repeats, ); return NSTimer.castFromPointer($ret, retain: true, release: true); @@ -21797,7 +21426,7 @@ class NSTimer extends NSObject { double ti, { required objc.ObjCObjectBase target, required ffi.Pointer selector, - objc.ObjCObjectBase? userInfo, + objc.ObjCObjectBase? userInfo$1, required bool repeats, }) { final $ret = _objc_msgSend_ot6jdx( @@ -21806,7 +21435,7 @@ class NSTimer extends NSObject { ti, target.ref.pointer, selector, - userInfo?.ref.pointer ?? ffi.nullptr, + userInfo$1?.ref.pointer ?? ffi.nullptr, repeats, ); return NSTimer.castFromPointer($ret, retain: true, release: true); @@ -21817,12 +21446,6 @@ class NSTimer extends NSObject { } extension NSTimer$Methods on NSTimer { - /// autorelease - NSTimer autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSTimer.castFromPointer($ret, retain: true, release: true); - } - /// fire void fire() { _objc_msgSend_1pl9qdv(this.ref.pointer, _sel_fire); @@ -21877,7 +21500,7 @@ extension NSTimer$Methods on NSTimer { required double interval, required objc.ObjCObjectBase target, required ffi.Pointer selector, - objc.ObjCObjectBase? userInfo, + objc.ObjCObjectBase? userInfo$1, required bool repeats, }) { final $ret = _objc_msgSend_14wwtbv( @@ -21887,7 +21510,7 @@ extension NSTimer$Methods on NSTimer { interval, target.ref.pointer, selector, - userInfo?.ref.pointer ?? ffi.nullptr, + userInfo$1?.ref.pointer ?? ffi.nullptr, repeats, ); return NSTimer.castFromPointer($ret, retain: false, release: true); @@ -21903,18 +21526,6 @@ extension NSTimer$Methods on NSTimer { return _objc_msgSend_91o635(this.ref.pointer, _sel_isValid); } - /// retain - NSTimer retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSTimer.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSTimer self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSTimer.castFromPointer($ret, retain: true, release: true); - } - /// setFireDate: set fireDate(NSDate value) { _objc_msgSend_xtuoz7( @@ -22131,8 +21742,12 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { } /// allocWithZone: - static NSURL allocWithZone(ffi.Pointer zone) { - final $ret = _objc_msgSend_1cwp428(_class_NSURL, _sel_allocWithZone_, zone); + static NSURL allocWithZone(ffi.Pointer zone$1) { + final $ret = _objc_msgSend_1cwp428( + _class_NSURL, + _sel_allocWithZone_, + zone$1, + ); return NSURL.castFromPointer($ret, retain: false, release: true); } @@ -22159,7 +21774,7 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { /// fileURLWithFileSystemRepresentation:isDirectory:relativeToURL: static NSURL fileURLWithFileSystemRepresentation( - ffi.Pointer path, { + ffi.Pointer path$1, { required bool isDirectory, NSURL? relativeToURL, }) { @@ -22171,7 +21786,7 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { final $ret = _objc_msgSend_1n40f6p( _class_NSURL, _sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_, - path, + path$1, isDirectory, relativeToURL?.ref.pointer ?? ffi.nullptr, ); @@ -22179,17 +21794,17 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { } /// fileURLWithPath: - static NSURL fileURLWithPath(NSString path) { + static NSURL fileURLWithPath(NSString path$1) { final $ret = _objc_msgSend_1sotr3r( _class_NSURL, _sel_fileURLWithPath_, - path.ref.pointer, + path$1.ref.pointer, ); return NSURL.castFromPointer($ret, retain: true, release: true); } /// fileURLWithPath:isDirectory: - static NSURL fileURLWithPath$1(NSString path, {required bool isDirectory}) { + static NSURL fileURLWithPath$1(NSString path$1, {required bool isDirectory}) { objc.checkOsVersionInternal( 'NSURL.fileURLWithPath:isDirectory:', iOS: (false, (2, 0, 0)), @@ -22198,7 +21813,7 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { final $ret = _objc_msgSend_17amj0z( _class_NSURL, _sel_fileURLWithPath_isDirectory_, - path.ref.pointer, + path$1.ref.pointer, isDirectory, ); return NSURL.castFromPointer($ret, retain: true, release: true); @@ -22206,7 +21821,7 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { /// fileURLWithPath:isDirectory:relativeToURL: static NSURL fileURLWithPath$2( - NSString path, { + NSString path$1, { required bool isDirectory, NSURL? relativeToURL, }) { @@ -22218,7 +21833,7 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { final $ret = _objc_msgSend_1ged0jd( _class_NSURL, _sel_fileURLWithPath_isDirectory_relativeToURL_, - path.ref.pointer, + path$1.ref.pointer, isDirectory, relativeToURL?.ref.pointer ?? ffi.nullptr, ); @@ -22226,7 +21841,7 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { } /// fileURLWithPath:relativeToURL: - static NSURL fileURLWithPath$3(NSString path, {NSURL? relativeToURL}) { + static NSURL fileURLWithPath$3(NSString path$1, {NSURL? relativeToURL}) { objc.checkOsVersionInternal( 'NSURL.fileURLWithPath:relativeToURL:', iOS: (false, (9, 0, 0)), @@ -22235,7 +21850,7 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { final $ret = _objc_msgSend_15qeuct( _class_NSURL, _sel_fileURLWithPath_relativeToURL_, - path.ref.pointer, + path$1.ref.pointer, relativeToURL?.ref.pointer ?? ffi.nullptr, ); return NSURL.castFromPointer($ret, retain: true, release: true); @@ -22247,29 +21862,6 @@ class NSURL extends NSObject implements NSSecureCoding, NSCopying { return NSURL.castFromPointer($ret, retain: false, release: true); } - /// objectWithItemProviderData:typeIdentifier:error: - static NSURL? objectWithItemProviderData( - NSData data, { - required NSString typeIdentifier, - required ffi.Pointer> error, - }) { - objc.checkOsVersionInternal( - 'NSURL.objectWithItemProviderData:typeIdentifier:error:', - iOS: (false, (11, 0, 0)), - macOS: (false, (10, 13, 0)), - ); - final $ret = _objc_msgSend_1pnyuds( - _class_NSURL, - _sel_objectWithItemProviderData_typeIdentifier_error_, - data.ref.pointer, - typeIdentifier.ref.pointer, - error, - ); - return $ret.address == 0 - ? null - : NSURL.castFromPointer($ret, retain: true, release: true); - } - /// resourceValuesForKeys:fromBookmarkData: static NSDictionary? resourceValuesForKeys$1( NSArray keys, { @@ -22560,7 +22152,7 @@ extension NSURL$Methods on NSURL { /// initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL: NSURL initFileURLWithFileSystemRepresentation( - ffi.Pointer path, { + ffi.Pointer path$1, { required bool isDirectory, NSURL? relativeToURL, }) { @@ -22572,7 +22164,7 @@ extension NSURL$Methods on NSURL { final $ret = _objc_msgSend_1n40f6p( this.ref.retainAndReturnPointer(), _sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_, - path, + path$1, isDirectory, relativeToURL?.ref.pointer ?? ffi.nullptr, ); @@ -22580,17 +22172,17 @@ extension NSURL$Methods on NSURL { } /// initFileURLWithPath: - NSURL initFileURLWithPath(NSString path) { + NSURL initFileURLWithPath(NSString path$1) { final $ret = _objc_msgSend_1sotr3r( this.ref.retainAndReturnPointer(), _sel_initFileURLWithPath_, - path.ref.pointer, + path$1.ref.pointer, ); return NSURL.castFromPointer($ret, retain: false, release: true); } /// initFileURLWithPath:isDirectory: - NSURL initFileURLWithPath$1(NSString path, {required bool isDirectory}) { + NSURL initFileURLWithPath$1(NSString path$1, {required bool isDirectory}) { objc.checkOsVersionInternal( 'NSURL.initFileURLWithPath:isDirectory:', iOS: (false, (2, 0, 0)), @@ -22599,7 +22191,7 @@ extension NSURL$Methods on NSURL { final $ret = _objc_msgSend_17amj0z( this.ref.retainAndReturnPointer(), _sel_initFileURLWithPath_isDirectory_, - path.ref.pointer, + path$1.ref.pointer, isDirectory, ); return NSURL.castFromPointer($ret, retain: false, release: true); @@ -22607,7 +22199,7 @@ extension NSURL$Methods on NSURL { /// initFileURLWithPath:isDirectory:relativeToURL: NSURL initFileURLWithPath$2( - NSString path, { + NSString path$1, { required bool isDirectory, NSURL? relativeToURL, }) { @@ -22619,7 +22211,7 @@ extension NSURL$Methods on NSURL { final $ret = _objc_msgSend_1ged0jd( this.ref.retainAndReturnPointer(), _sel_initFileURLWithPath_isDirectory_relativeToURL_, - path.ref.pointer, + path$1.ref.pointer, isDirectory, relativeToURL?.ref.pointer ?? ffi.nullptr, ); @@ -22627,7 +22219,7 @@ extension NSURL$Methods on NSURL { } /// initFileURLWithPath:relativeToURL: - NSURL initFileURLWithPath$3(NSString path, {NSURL? relativeToURL}) { + NSURL initFileURLWithPath$3(NSString path$1, {NSURL? relativeToURL}) { objc.checkOsVersionInternal( 'NSURL.initFileURLWithPath:relativeToURL:', iOS: (false, (9, 0, 0)), @@ -22636,7 +22228,7 @@ extension NSURL$Methods on NSURL { final $ret = _objc_msgSend_15qeuct( this.ref.retainAndReturnPointer(), _sel_initFileURLWithPath_relativeToURL_, - path.ref.pointer, + path$1.ref.pointer, relativeToURL?.ref.pointer ?? ffi.nullptr, ); return NSURL.castFromPointer($ret, retain: false, release: true); @@ -23008,11 +22600,11 @@ class NSURLHandle extends NSObject { } /// allocWithZone: - static NSURLHandle allocWithZone(ffi.Pointer zone) { + static NSURLHandle allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSURLHandle, _sel_allocWithZone_, - zone, + zone$1, ); return NSURLHandle.castFromPointer($ret, retain: false, release: true); } @@ -23028,12 +22620,6 @@ class NSURLHandle extends NSObject { } extension NSURLHandle$Methods on NSURLHandle { - /// autorelease - NSURLHandle autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return NSURLHandle.castFromPointer($ret, retain: true, release: true); - } - /// init NSURLHandle init() { objc.checkOsVersionInternal( @@ -23047,18 +22633,6 @@ extension NSURLHandle$Methods on NSURLHandle { ); return NSURLHandle.castFromPointer($ret, retain: false, release: true); } - - /// retain - NSURLHandle retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return NSURLHandle.castFromPointer($ret, retain: true, release: true); - } - - /// self - NSURLHandle self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return NSURLHandle.castFromPointer($ret, retain: true, release: true); - } } enum NSURLHandleStatus { @@ -23114,11 +22688,11 @@ class NSValue extends NSObject implements NSCopying, NSSecureCoding { } /// allocWithZone: - static NSValue allocWithZone(ffi.Pointer zone) { + static NSValue allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_NSValue, _sel_allocWithZone_, - zone, + zone$1, ); return NSValue.castFromPointer($ret, retain: false, release: true); } @@ -23175,13 +22749,13 @@ extension NSValue$Methods on NSValue { /// initWithBytes:objCType: NSValue initWithBytes( ffi.Pointer value, { - required ffi.Pointer objCType, + required ffi.Pointer objCType$1, }) { final $ret = _objc_msgSend_e9mncn( this.ref.retainAndReturnPointer(), _sel_initWithBytes_objCType_, value, - objCType, + objCType$1, ); return NSValue.castFromPointer($ret, retain: false, release: true); } @@ -34333,256 +33907,6 @@ extension ObjCBlock_instancetype_ffiVoid_NSCoder$CallExtension ); } -/// Construction methods for `objc.ObjCBlock? Function(ffi.Pointer, NSData, NSString, ffi.Pointer>)>`. -abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - NSData, - NSString, - ffi.Pointer>, - ) - > - castFromPointer( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) => - objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - NSData, - NSString, - ffi.Pointer>, - ) - >(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - NSData, - NSString, - ffi.Pointer>, - ) - > - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) - > - > - ptr, - ) => - objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - NSData, - NSString, - 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.Pointer? Function( - ffi.Pointer, - NSData, - NSString, - ffi.Pointer>, - ) - > - fromFunction( - Dartinstancetype? Function( - ffi.Pointer, - NSData, - NSString, - ffi.Pointer>, - ) - fn, { - bool keepIsolateAlive = true, - }) => - objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - NSData, - NSString, - ffi.Pointer>, - ) - >( - objc.newClosureBlock( - _closureCallable, - ( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) => - fn( - arg0, - NSData.castFromPointer(arg1, retain: true, release: true), - NSString.castFromPointer(arg2, retain: true, release: true), - arg3, - )?.ref.retainAndAutorelease() ?? - ffi.nullptr, - keepIsolateAlive, - ), - retain: false, - release: true, - ); - - static instancetype _fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) => block.ref.target - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) - > - >() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >()(arg0, arg1, arg2, arg3); - static ffi.Pointer _fnPtrCallable = - ffi.Pointer.fromFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >(_fnPtrTrampoline) - .cast(); - static instancetype _closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) => - (objc.getBlockClosure(block) - as instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ))(arg0, arg1, arg2, arg3); - static ffi.Pointer _closureCallable = - ffi.Pointer.fromFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >(_closureTrampoline) - .cast(); -} - -/// Call operator for `objc.ObjCBlock? Function(ffi.Pointer, NSData, NSString, ffi.Pointer>)>`. -extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError$CallExtension - on - objc.ObjCBlock< - ffi.Pointer? Function( - ffi.Pointer, - NSData, - NSString, - ffi.Pointer>, - ) - > { - Dartinstancetype? call( - ffi.Pointer arg0, - NSData arg1, - NSString arg2, - ffi.Pointer> arg3, - ) => - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) - > - >() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3) - .address == - 0 - ? null - : objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer> arg3, - ) - > - >() - .asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ) - >()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3), - retain: true, - release: true, - ); -} - /// Construction methods for `objc.ObjCBlock? Function(NSError, NSString)>`. abstract final class ObjCBlock_objcObjCObject_NSError_NSErrorUserInfoKey { /// Returns a block that wraps the given raw block pointer. @@ -41549,8 +40873,6 @@ late final _sel_objectForKey_ = objc.registerName("objectForKey:"); late final _sel_objectForKeyedSubscript_ = objc.registerName( "objectForKeyedSubscript:", ); -late final _sel_objectWithItemProviderData_typeIdentifier_error_ = objc - .registerName("objectWithItemProviderData:typeIdentifier:error:"); late final _sel_objectsAtIndexes_ = objc.registerName("objectsAtIndexes:"); late final _sel_objectsForKeys_notFoundMarker_ = objc.registerName( "objectsForKeys:notFoundMarker:", diff --git a/pkgs/objective_c/lib/src/selector.dart b/pkgs/objective_c/lib/src/selector.dart index 93c79be00..fcb4fabe1 100644 --- a/pkgs/objective_c/lib/src/selector.dart +++ b/pkgs/objective_c/lib/src/selector.dart @@ -7,14 +7,14 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'c_bindings_generated.dart' as c; -import 'internal.dart'; +import 'internal.dart' as objc; extension StringToSelector on String { /// Returns an Objective-C selector (aka `SEL`) for this [String]. /// /// This is equivalent to the Objective-C `@selector()` directive, or the /// `NSSelectorFromString` function. - Pointer toSelector() => registerName(this); + Pointer toSelector() => objc.registerName(this); } extension SelectorToString on Pointer { @@ -23,3 +23,8 @@ extension SelectorToString on Pointer { /// This is equivalent to the Objective-C `NSSelectorFromString` function. String toDartString() => c.getName(this).cast().toDartString(); } + +extension RespondsToSelector on objc.ObjCObjectBase { + bool respondsToSelector(Pointer sel) => + objc.respondsToSelector(ref.pointer, sel); +} diff --git a/pkgs/objective_c/src/objective_c_bindings_generated.m b/pkgs/objective_c/src/objective_c_bindings_generated.m index 315c24d66..b0fece41e 100644 --- a/pkgs/objective_c/src/objective_c_bindings_generated.m +++ b/pkgs/objective_c/src/objective_c_bindings_generated.m @@ -571,34 +571,28 @@ id _ObjectiveCBindings_protocolTrampoline_xr62hr(id target, void * sel, id arg1 return ((_ProtocolTrampoline_13)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); } -typedef id (^_ProtocolTrampoline_14)(void * sel, id arg1, id arg2, id * arg3); -__attribute__((visibility("default"))) __attribute__((used)) -id _ObjectiveCBindings_protocolTrampoline_10z9f5k(id target, void * sel, id arg1, id arg2, id * arg3) { - return ((_ProtocolTrampoline_14)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); -} - -typedef id (^_ProtocolTrampoline_15)(void * sel, struct _NSZone * arg1); +typedef id (^_ProtocolTrampoline_14)(void * sel, struct _NSZone * arg1); __attribute__((visibility("default"))) __attribute__((used)) id _ObjectiveCBindings_protocolTrampoline_18nsem0(id target, void * sel, struct _NSZone * arg1) { - return ((_ProtocolTrampoline_15)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); + return ((_ProtocolTrampoline_14)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); } -typedef id (^_ProtocolTrampoline_16)(void * sel, struct objc_selector * arg1); +typedef id (^_ProtocolTrampoline_15)(void * sel, struct objc_selector * arg1); __attribute__((visibility("default"))) __attribute__((used)) id _ObjectiveCBindings_protocolTrampoline_50as9u(id target, void * sel, struct objc_selector * arg1) { - return ((_ProtocolTrampoline_16)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); + return ((_ProtocolTrampoline_15)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1); } -typedef id (^_ProtocolTrampoline_17)(void * sel, struct objc_selector * arg1, id arg2); +typedef id (^_ProtocolTrampoline_16)(void * sel, struct objc_selector * arg1, id arg2); __attribute__((visibility("default"))) __attribute__((used)) id _ObjectiveCBindings_protocolTrampoline_1mllhpc(id target, void * sel, struct objc_selector * arg1, id arg2) { - return ((_ProtocolTrampoline_17)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2); + return ((_ProtocolTrampoline_16)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2); } -typedef id (^_ProtocolTrampoline_18)(void * sel, struct objc_selector * arg1, id arg2, id arg3); +typedef id (^_ProtocolTrampoline_17)(void * sel, struct objc_selector * arg1, id arg2, id arg3); __attribute__((visibility("default"))) __attribute__((used)) id _ObjectiveCBindings_protocolTrampoline_c7gk2u(id target, void * sel, struct objc_selector * arg1, id arg2, id arg3) { - return ((_ProtocolTrampoline_18)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); + return ((_ProtocolTrampoline_17)((id (*)(id, SEL, SEL))objc_msgSend)(target, @selector(getDOBJCDartProtocolMethodForSelector:), sel))(sel, arg1, arg2, arg3); } Protocol* _ObjectiveCBindings_Observer(void) { return @protocol(Observer); } diff --git a/pkgs/objective_c/test/ns_mutable_data_test.dart b/pkgs/objective_c/test/ns_mutable_data_test.dart index 57e144842..7716f618e 100644 --- a/pkgs/objective_c/test/ns_mutable_data_test.dart +++ b/pkgs/objective_c/test/ns_mutable_data_test.dart @@ -58,7 +58,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSMutableData.dataWithBytes(bytes.cast(), length: 3); + final data = NSMutableData.dataWithBytes(bytes.cast(), length$1: 3); expect(data.toList(), [1, 2, 3]); }); }); @@ -72,7 +72,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSMutableData.dataWithBytes(bytes.cast(), length: 3); + final data = NSMutableData.dataWithBytes(bytes.cast(), length$1: 3); data[0] = 4; data[1] = 5; data[2] = 6; @@ -89,7 +89,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSMutableData.dataWithBytes(bytes.cast(), length: 3); + final data = NSMutableData.dataWithBytes(bytes.cast(), length$1: 3); expect(() => data[3] = 2, throwsRangeError); expect(() => data[-1] = 1, throwsRangeError); expect(data[0], 1); @@ -105,7 +105,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSMutableData.dataWithBytes(bytes.cast(), length: 3); + final data = NSMutableData.dataWithBytes(bytes.cast(), length$1: 3); data[0] = 256; data[1] = 257; data[2] = -1; @@ -131,7 +131,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSMutableData.dataWithBytes(bytes.cast(), length: 3); + final data = NSMutableData.dataWithBytes(bytes.cast(), length$1: 3); data.addAll([]); expect(data.length, 3); @@ -148,7 +148,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSMutableData.dataWithBytes(bytes.cast(), length: 3); + final data = NSMutableData.dataWithBytes(bytes.cast(), length$1: 3); data.addAll([4, 5, 6]); expect(data.length, 6); @@ -168,7 +168,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSMutableData.dataWithBytes(bytes.cast(), length: 3); + final data = NSMutableData.dataWithBytes(bytes.cast(), length$1: 3); data.addAll([-1, 256, 257]); expect(data.length, 6); diff --git a/pkgs/objective_c/test/nsdata_test.dart b/pkgs/objective_c/test/nsdata_test.dart index 6c6250480..6d39b7736 100644 --- a/pkgs/objective_c/test/nsdata_test.dart +++ b/pkgs/objective_c/test/nsdata_test.dart @@ -58,7 +58,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSData.dataWithBytes(bytes.cast(), length: 3); + final data = NSData.dataWithBytes(bytes.cast(), length$1: 3); expect(data.toList(), [1, 2, 3]); }); }); @@ -72,7 +72,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSData.dataWithBytes(bytes.cast(), length: 3); + final data = NSData.dataWithBytes(bytes.cast(), length$1: 3); expect(data[0], 1); expect(data[1], 2); expect(data[2], 3); @@ -86,7 +86,7 @@ void main() { bytes[1] = 2; bytes[2] = 3; - final data = NSData.dataWithBytes(bytes.cast(), length: 3); + final data = NSData.dataWithBytes(bytes.cast(), length$1: 3); expect(() => data[3], throwsRangeError); expect(() => data[-1], throwsRangeError); }); diff --git a/pkgs/objective_c/test/nsdate_test.dart b/pkgs/objective_c/test/nsdate_test.dart index 5dcd5029e..61155cb87 100644 --- a/pkgs/objective_c/test/nsdate_test.dart +++ b/pkgs/objective_c/test/nsdate_test.dart @@ -23,7 +23,7 @@ void main() { test('from DateTime', () { final dartFirstAppeared = DateTime.utc(2011, 10, 10); final nsDate = dartFirstAppeared.toNSDate(); - expect(nsDate.description.toDartString(), '2011-10-10 00:00:00 +0000'); + expect(nsDate.description$1.toDartString(), '2011-10-10 00:00:00 +0000'); }); test('to DateTime', () { diff --git a/pkgs/objective_c/tool/data/extra_methods.dart.in b/pkgs/objective_c/tool/data/extra_methods.dart.in index 3a5a13409..406bab5d9 100644 --- a/pkgs/objective_c/tool/data/extra_methods.dart.in +++ b/pkgs/objective_c/tool/data/extra_methods.dart.in @@ -14,7 +14,7 @@ class NSString { factory NSString(String str) { final cstr = str.toNativeUtf16(); - final nsstr = stringWithCharacters(cstr.cast(), length: str.length); + final nsstr = stringWithCharacters(cstr.cast(), length$1: str.length); pkg_ffi.calloc.free(cstr); return nsstr; } diff --git a/pkgs/swiftgen/test/integration/classes_bindings.dart b/pkgs/swiftgen/test/integration/classes_bindings.dart index ba6784204..222897b53 100644 --- a/pkgs/swiftgen/test/integration/classes_bindings.dart +++ b/pkgs/swiftgen/test/integration/classes_bindings.dart @@ -19,17 +19,6 @@ import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; -@ffi.Native< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) ->() -external ffi.Pointer _classes_protocolTrampoline_1mbt9g9( - ffi.Pointer target, - ffi.Pointer arg0, -); - late final _class_TestClassWrapper = objc.getClass("classes.TestClassWrapper"); late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); final _objc_msgSend_19nvye5 = objc.msgSendPointer @@ -109,141 +98,6 @@ final _objc_msgSend_1cwp428 = objc.msgSendPointer ) >(); late final _sel_alloc = objc.registerName("alloc"); -late final _sel_self = objc.registerName("self"); - -/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. -abstract final class ObjCBlock_objcObjCObject_ffiVoid { - /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - castFromPointer( - ffi.Pointer pointer, { - bool retain = false, - bool release = false, - }) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >(pointer, retain: retain, release: release); - - /// Creates a block from a C function pointer. - /// - /// This block must be invoked by native code running on the same thread as - /// the isolate that registered it. Invoking the block on the wrong thread - /// will result in a crash. - static objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > - fromFunctionPointer( - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - > - ptr, - ) => - objc.ObjCBlock< - ffi.Pointer Function(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.Pointer Function(ffi.Pointer) - > - fromFunction( - objc.ObjCObjectBase Function(ffi.Pointer) fn, { - bool keepIsolateAlive = true, - }) => - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - >( - objc.newClosureBlock( - _closureCallable, - (ffi.Pointer arg0) => fn(arg0).ref.retainAndAutorelease(), - keepIsolateAlive, - ), - retain: false, - release: true, - ); - - static ffi.Pointer _fnPtrTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer arg0) - > - >() - .asFunction< - ffi.Pointer Function(ffi.Pointer) - >()(arg0); - static ffi.Pointer _fnPtrCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_fnPtrTrampoline) - .cast(); - static ffi.Pointer _closureTrampoline( - ffi.Pointer block, - ffi.Pointer arg0, - ) => - (objc.getBlockClosure(block) - as ffi.Pointer Function(ffi.Pointer))( - arg0, - ); - static ffi.Pointer _closureCallable = - ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >(_closureTrampoline) - .cast(); -} - -/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. -extension ObjCBlock_objcObjCObject_ffiVoid$CallExtension - on - objc.ObjCBlock< - ffi.Pointer Function(ffi.Pointer) - > { - objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( - ref.pointer.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer block, - ffi.Pointer arg0, - ) - > - >() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ) - >()(ref.pointer, arg0), - retain: true, - release: true, - ); -} - -late final _sel_retain = objc.registerName("retain"); -late final _sel_autorelease = objc.registerName("autorelease"); /// TestOtherClassWrapper class TestOtherClassWrapper extends objc.NSObject { @@ -287,11 +141,11 @@ class TestOtherClassWrapper extends objc.NSObject { } /// allocWithZone: - static TestOtherClassWrapper allocWithZone(ffi.Pointer zone) { + static TestOtherClassWrapper allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_TestOtherClassWrapper, _sel_allocWithZone_, - zone, + zone$1, ); return TestOtherClassWrapper.castFromPointer( $ret, @@ -315,16 +169,6 @@ class TestOtherClassWrapper extends objc.NSObject { } extension TestOtherClassWrapper$Methods on TestOtherClassWrapper { - /// autorelease - TestOtherClassWrapper autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return TestOtherClassWrapper.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - /// init TestOtherClassWrapper init() { objc.checkOsVersionInternal( @@ -343,26 +187,6 @@ extension TestOtherClassWrapper$Methods on TestOtherClassWrapper { ); } - /// retain - TestOtherClassWrapper retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return TestOtherClassWrapper.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - - /// self - TestOtherClassWrapper self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return TestOtherClassWrapper.castFromPointer( - $ret, - retain: true, - release: true, - ); - } - /// times10WithX: int times10WithX(int x) { return _objc_msgSend_12hwf9n(this.ref.pointer, _sel_times10WithX_, x); @@ -406,11 +230,11 @@ class TestClassWrapper extends objc.NSObject { } /// allocWithZone: - static TestClassWrapper allocWithZone(ffi.Pointer zone) { + static TestClassWrapper allocWithZone(ffi.Pointer zone$1) { final $ret = _objc_msgSend_1cwp428( _class_TestClassWrapper, _sel_allocWithZone_, - zone, + zone$1, ); return TestClassWrapper.castFromPointer($ret, retain: false, release: true); } @@ -432,12 +256,6 @@ class TestClassWrapper extends objc.NSObject { } extension TestClassWrapper$Methods on TestClassWrapper { - /// autorelease - TestClassWrapper autorelease() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_autorelease); - return TestClassWrapper.castFromPointer($ret, retain: true, release: true); - } - /// init TestClassWrapper init() { objc.checkOsVersionInternal( @@ -461,16 +279,4 @@ extension TestClassWrapper$Methods on TestClassWrapper { release: true, ); } - - /// retain - TestClassWrapper retain() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_retain); - return TestClassWrapper.castFromPointer($ret, retain: true, release: true); - } - - /// self - TestClassWrapper self() { - final $ret = _objc_msgSend_151sglz(this.ref.pointer, _sel_self); - return TestClassWrapper.castFromPointer($ret, retain: true, release: true); - } }