fmt
diff --git a/pkgs/ffigen/test/native_objc_test/deprecated_bindings.dart b/pkgs/ffigen/test/native_objc_test/deprecated_bindings.dart index cfab891..14ba9f6 100644 --- a/pkgs/ffigen/test/native_objc_test/deprecated_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/deprecated_bindings.dart
@@ -1,282 +1,341 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// +// // Generated by `package:ffigen`. // ignore_for_file: type=lint, unused_import import 'dart:ffi' as ffi; import 'package:objective_c/objective_c.dart' as objc; import 'package:ffi/ffi.dart' as pkg_ffi; + /// Tests API deprecation -class DeprecatedTestObjCLibrary{ -/// Holds the symbol lookup function. -final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName) _lookup; +class DeprecatedTestObjCLibrary { + /// Holds the symbol lookup function. + final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName) + _lookup; -/// The symbols are looked up in [dynamicLibrary]. -DeprecatedTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary): _lookup = dynamicLibrary.lookup; + /// The symbols are looked up in [dynamicLibrary]. + DeprecatedTestObjCLibrary(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; -/// The symbols are looked up with [lookup]. -DeprecatedTestObjCLibrary.fromLookup(ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName) lookup): _lookup = lookup; + /// The symbols are looked up with [lookup]. + DeprecatedTestObjCLibrary.fromLookup( + ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName) lookup, + ) : _lookup = lookup; -int normalFunction() { - return _normalFunction(); + int normalFunction() { + return _normalFunction(); + } + + late final _normalFunctionPtr = + _lookup<ffi.NativeFunction<ffi.Int Function()>>('normalFunction'); + late final _normalFunction = _normalFunctionPtr.asFunction<int Function()>(); } -late final _normalFunctionPtr = _lookup< - ffi.NativeFunction<ffi.Int Function()>>('normalFunction'); -late final _normalFunction = _normalFunctionPtr.asFunction<int Function()>(); - -} - -@ffi.Native<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>() -external int _1flqfr_protocolTrampoline_1l0nlq(ffi.Pointer<objc.ObjCObjectImpl> target, -ffi.Pointer<ffi.Void> arg0, +@ffi.Native< + ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl>, ffi.Pointer<ffi.Void>) +>() +external int _1flqfr_protocolTrampoline_1l0nlq( + ffi.Pointer<objc.ObjCObjectImpl> target, + ffi.Pointer<ffi.Void> arg0, ); -@ffi.Native<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> , ffi.Int )>() -external void _1flqfr_protocolTrampoline_1t7vjnw(ffi.Pointer<objc.ObjCObjectImpl> target, -ffi.Pointer<ffi.Void> arg0, -int arg1, +@ffi.Native< + ffi.Void Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) +>() +external void _1flqfr_protocolTrampoline_1t7vjnw( + ffi.Pointer<objc.ObjCObjectImpl> target, + ffi.Pointer<ffi.Void> arg0, + int arg1, ); -@ffi.Native<ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<objc.DOBJC_Context> )>(isLeaf: true) -external ffi.Pointer<objc.ObjCBlockImpl> _1flqfr_wrapBlockingBlock_1t7vjnw(ffi.Pointer<objc.ObjCBlockImpl> block, -ffi.Pointer<objc.ObjCBlockImpl> listnerBlock, -ffi.Pointer<objc.DOBJC_Context> context, +@ffi.Native< + ffi.Pointer<objc.ObjCBlockImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<objc.DOBJC_Context>, + ) +>(isLeaf: true) +external ffi.Pointer<objc.ObjCBlockImpl> _1flqfr_wrapBlockingBlock_1t7vjnw( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<objc.ObjCBlockImpl> listnerBlock, + ffi.Pointer<objc.DOBJC_Context> context, ); -@ffi.Native<ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> )>(isLeaf: true) -external ffi.Pointer<objc.ObjCBlockImpl> _1flqfr_wrapListenerBlock_1t7vjnw(ffi.Pointer<objc.ObjCBlockImpl> block, +@ffi.Native< + ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>) +>(isLeaf: true) +external ffi.Pointer<objc.ObjCBlockImpl> _1flqfr_wrapListenerBlock_1t7vjnw( + ffi.Pointer<objc.ObjCBlockImpl> block, ); - /// DeprecatedInterfaceMethods -extension type DeprecatedInterfaceMethods._(objc.ObjCObject object$) implements objc.ObjCObject,objc.NSObject { +extension type DeprecatedInterfaceMethods._(objc.ObjCObject object$) + implements objc.ObjCObject, objc.NSObject { /// Constructs a [DeprecatedInterfaceMethods] that points to the same underlying object as [other]. DeprecatedInterfaceMethods.as(objc.ObjCObject other) : object$ = other { assert(isA(object$)); } /// Constructs a [DeprecatedInterfaceMethods] that wraps the given raw object pointer. - DeprecatedInterfaceMethods.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { + DeprecatedInterfaceMethods.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { assert(isA(object$)); } /// Returns whether [obj] is an instance of [DeprecatedInterfaceMethods]. - static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(obj.ref.pointer, _sel_isKindOfClass_, _class_DeprecatedInterfaceMethods); + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_DeprecatedInterfaceMethods, + ); /// alloc static DeprecatedInterfaceMethods alloc() { - final $ret = _objc_msgSend_151sglz(_class_DeprecatedInterfaceMethods, _sel_alloc); - return DeprecatedInterfaceMethods.fromPointer($ret, retain: false, release: true); + final $ret = _objc_msgSend_151sglz( + _class_DeprecatedInterfaceMethods, + _sel_alloc, + ); + return DeprecatedInterfaceMethods.fromPointer( + $ret, + retain: false, + release: true, + ); } - /// allocWithZone: - static DeprecatedInterfaceMethods allocWithZone(ffi.Pointer<objc.NSZone> zone) { - final $ret = _objc_msgSend_1cwp428(_class_DeprecatedInterfaceMethods, _sel_allocWithZone_, zone); - return DeprecatedInterfaceMethods.fromPointer($ret, retain: false, release: true); + static DeprecatedInterfaceMethods allocWithZone( + ffi.Pointer<objc.NSZone> zone, + ) { + final $ret = _objc_msgSend_1cwp428( + _class_DeprecatedInterfaceMethods, + _sel_allocWithZone_, + zone, + ); + return DeprecatedInterfaceMethods.fromPointer( + $ret, + retain: false, + release: true, + ); } - /// new static DeprecatedInterfaceMethods new$() { - final $ret = _objc_msgSend_151sglz(_class_DeprecatedInterfaceMethods, _sel_new); - return DeprecatedInterfaceMethods.fromPointer($ret, retain: false, release: true); + final $ret = _objc_msgSend_151sglz( + _class_DeprecatedInterfaceMethods, + _sel_new, + ); + return DeprecatedInterfaceMethods.fromPointer( + $ret, + retain: false, + release: true, + ); } + /// Returns a new instance of DeprecatedInterfaceMethods constructed with the default `new` method. DeprecatedInterfaceMethods() : this.as(new$().object$); - } extension DeprecatedInterfaceMethods$Methods on DeprecatedInterfaceMethods { - /// depIos2 -/// -/// iOS: introduced 1.0.0, deprecated 2.0.0 + /// + /// iOS: introduced 1.0.0, deprecated 2.0.0 int depIos2() { - objc.checkOsVersionInternal('DeprecatedInterfaceMethods.depIos2', iOS: (false, (1, 0, 0))); + objc.checkOsVersionInternal( + 'DeprecatedInterfaceMethods.depIos2', + iOS: (false, (1, 0, 0)), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_depIos2); - } - /// depIos3 -/// -/// iOS: introduced 1.0.0, deprecated 3.0.0 + /// + /// iOS: introduced 1.0.0, deprecated 3.0.0 int depIos3() { - objc.checkOsVersionInternal('DeprecatedInterfaceMethods.depIos3', iOS: (false, (1, 0, 0))); + objc.checkOsVersionInternal( + 'DeprecatedInterfaceMethods.depIos3', + iOS: (false, (1, 0, 0)), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_depIos3); - } - /// depMac2 -/// -/// macOS: introduced 1.0.0, deprecated 2.0.0 + /// + /// macOS: introduced 1.0.0, deprecated 2.0.0 int depMac2() { - objc.checkOsVersionInternal('DeprecatedInterfaceMethods.depMac2', macOS: (false, (1, 0, 0))); + objc.checkOsVersionInternal( + 'DeprecatedInterfaceMethods.depMac2', + macOS: (false, (1, 0, 0)), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_depMac2); - } - /// depMac3 -/// -/// macOS: introduced 1.0.0, deprecated 3.0.0 + /// + /// macOS: introduced 1.0.0, deprecated 3.0.0 int depMac3() { - objc.checkOsVersionInternal('DeprecatedInterfaceMethods.depMac3', macOS: (false, (1, 0, 0))); + objc.checkOsVersionInternal( + 'DeprecatedInterfaceMethods.depMac3', + macOS: (false, (1, 0, 0)), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_depMac3); - } - /// normalMethod int normalMethod() { return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_normalMethod); - } - /// normalProperty int get normalProperty { return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_normalProperty); - } - /// setNormalProperty: set normalProperty(int value) { -_objc_msgSend_9o8504(object$.ref.pointer, _sel_setNormalProperty_, value); - + _objc_msgSend_9o8504(object$.ref.pointer, _sel_setNormalProperty_, value); } - /// unavailableIos -/// -/// iOS: unavailable + /// + /// iOS: unavailable int unavailableIos() { - objc.checkOsVersionInternal('DeprecatedInterfaceMethods.unavailableIos', iOS: (true, null)); + objc.checkOsVersionInternal( + 'DeprecatedInterfaceMethods.unavailableIos', + iOS: (true, null), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_unavailableIos); - } - /// unavailableMac -/// -/// macOS: unavailable + /// + /// macOS: unavailable int unavailableMac() { - objc.checkOsVersionInternal('DeprecatedInterfaceMethods.unavailableMac', macOS: (true, null)); + objc.checkOsVersionInternal( + 'DeprecatedInterfaceMethods.unavailableMac', + macOS: (true, null), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_unavailableMac); - } - } - /// DeprecatedProtocolMethods -extension type DeprecatedProtocolMethods._(objc.ObjCProtocol object$) implements objc.ObjCProtocol, objc.NSObjectProtocol { +extension type DeprecatedProtocolMethods._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, objc.NSObjectProtocol { /// Constructs a [DeprecatedProtocolMethods] that points to the same underlying object as [other]. DeprecatedProtocolMethods.as(objc.ObjCObject other) : object$ = other; /// Constructs a [DeprecatedProtocolMethods] that wraps the given raw object pointer. - DeprecatedProtocolMethods.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + DeprecatedProtocolMethods.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); /// Returns whether [obj] is an instance of [DeprecatedProtocolMethods]. static bool conformsTo(objc.ObjCObject obj) { - return _objc_msgSend_e3qsqz(obj.ref.pointer, _sel_conformsToProtocol_, _protocol_DeprecatedProtocolMethods); + return _objc_msgSend_e3qsqz( + obj.ref.pointer, + _sel_conformsToProtocol_, + _protocol_DeprecatedProtocolMethods, + ); } } extension DeprecatedProtocolMethods$Methods on DeprecatedProtocolMethods { - /// protDepIos2 -/// -/// iOS: introduced 1.0.0, deprecated 2.0.0 + /// + /// iOS: introduced 1.0.0, deprecated 2.0.0 int protDepIos2() { - objc.checkOsVersionInternal('DeprecatedProtocolMethods.protDepIos2', iOS: (false, (1, 0, 0))); + objc.checkOsVersionInternal( + 'DeprecatedProtocolMethods.protDepIos2', + iOS: (false, (1, 0, 0)), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_protDepIos2); - } - /// protDepIos3 -/// -/// iOS: introduced 1.0.0, deprecated 3.0.0 + /// + /// iOS: introduced 1.0.0, deprecated 3.0.0 int protDepIos3() { - objc.checkOsVersionInternal('DeprecatedProtocolMethods.protDepIos3', iOS: (false, (1, 0, 0))); + objc.checkOsVersionInternal( + 'DeprecatedProtocolMethods.protDepIos3', + iOS: (false, (1, 0, 0)), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_protDepIos3); - } - /// protDepMac2 -/// -/// macOS: introduced 1.0.0, deprecated 2.0.0 + /// + /// macOS: introduced 1.0.0, deprecated 2.0.0 int protDepMac2() { - objc.checkOsVersionInternal('DeprecatedProtocolMethods.protDepMac2', macOS: (false, (1, 0, 0))); + objc.checkOsVersionInternal( + 'DeprecatedProtocolMethods.protDepMac2', + macOS: (false, (1, 0, 0)), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_protDepMac2); - } - /// protDepMac3 -/// -/// macOS: introduced 1.0.0, deprecated 3.0.0 + /// + /// macOS: introduced 1.0.0, deprecated 3.0.0 int protDepMac3() { - objc.checkOsVersionInternal('DeprecatedProtocolMethods.protDepMac3', macOS: (false, (1, 0, 0))); + objc.checkOsVersionInternal( + 'DeprecatedProtocolMethods.protDepMac3', + macOS: (false, (1, 0, 0)), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_protDepMac3); - } - /// protNormalMethod int protNormalMethod() { return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_protNormalMethod); - } - /// protNormalProperty int get protNormalProperty { return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_protNormalProperty); - } - /// protUnavailableIos -/// -/// iOS: unavailable + /// + /// iOS: unavailable int protUnavailableIos() { - objc.checkOsVersionInternal('DeprecatedProtocolMethods.protUnavailableIos', iOS: (true, null)); + objc.checkOsVersionInternal( + 'DeprecatedProtocolMethods.protUnavailableIos', + iOS: (true, null), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_protUnavailableIos); - } - /// protUnavailableMac -/// -/// macOS: unavailable + /// + /// macOS: unavailable int protUnavailableMac() { - objc.checkOsVersionInternal('DeprecatedProtocolMethods.protUnavailableMac', macOS: (true, null)); + objc.checkOsVersionInternal( + 'DeprecatedProtocolMethods.protUnavailableMac', + macOS: (true, null), + ); return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_protUnavailableMac); - } - /// setProtNormalProperty: set protNormalProperty(int value) { -_objc_msgSend_9o8504(object$.ref.pointer, _sel_setProtNormalProperty_, value); - + _objc_msgSend_9o8504( + object$.ref.pointer, + _sel_setProtNormalProperty_, + value, + ); } - } - interface class DeprecatedProtocolMethods$Builder { - - /// Returns the [objc.Protocol] object for this protocol. +interface class DeprecatedProtocolMethods$Builder { + /// Returns the [objc.Protocol] object for this protocol. static objc.Protocol get $protocol => objc.Protocol.fromPointer(_protocol_DeprecatedProtocolMethods.cast()); @@ -285,33 +344,178 @@ /// /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. - static DeprecatedProtocolMethods implement({required int Function() protDepIos2, required int Function() protDepIos3, required int Function() protDepMac2, required int Function() protDepMac3, required int Function() protNormalMethod, required int Function() protNormalProperty, required int Function() protUnavailableIos, required int Function() protUnavailableMac, required void Function(int ) setProtNormalProperty_, bool $keepIsolateAlive = true}) { - final builder = objc.ObjCProtocolBuilder(debugName: 'DeprecatedProtocolMethods'); - DeprecatedProtocolMethods$Builder.protDepIos2.implement(builder, protDepIos2); DeprecatedProtocolMethods$Builder.protDepIos3.implement(builder, protDepIos3); DeprecatedProtocolMethods$Builder.protDepMac2.implement(builder, protDepMac2); DeprecatedProtocolMethods$Builder.protDepMac3.implement(builder, protDepMac3); DeprecatedProtocolMethods$Builder.protNormalMethod.implement(builder, protNormalMethod); DeprecatedProtocolMethods$Builder.protNormalProperty.implement(builder, protNormalProperty); DeprecatedProtocolMethods$Builder.protUnavailableIos.implement(builder, protUnavailableIos); DeprecatedProtocolMethods$Builder.protUnavailableMac.implement(builder, protUnavailableMac); DeprecatedProtocolMethods$Builder.setProtNormalProperty_.implement(builder, setProtNormalProperty_); + static DeprecatedProtocolMethods implement({ + required int Function() protDepIos2, + required int Function() protDepIos3, + required int Function() protDepMac2, + required int Function() protDepMac3, + required int Function() protNormalMethod, + required int Function() protNormalProperty, + required int Function() protUnavailableIos, + required int Function() protUnavailableMac, + required void Function(int) setProtNormalProperty_, + bool $keepIsolateAlive = true, + }) { + final builder = objc.ObjCProtocolBuilder( + debugName: 'DeprecatedProtocolMethods', + ); + DeprecatedProtocolMethods$Builder.protDepIos2.implement( + builder, + protDepIos2, + ); + DeprecatedProtocolMethods$Builder.protDepIos3.implement( + builder, + protDepIos3, + ); + DeprecatedProtocolMethods$Builder.protDepMac2.implement( + builder, + protDepMac2, + ); + DeprecatedProtocolMethods$Builder.protDepMac3.implement( + builder, + protDepMac3, + ); + DeprecatedProtocolMethods$Builder.protNormalMethod.implement( + builder, + protNormalMethod, + ); + DeprecatedProtocolMethods$Builder.protNormalProperty.implement( + builder, + protNormalProperty, + ); + DeprecatedProtocolMethods$Builder.protUnavailableIos.implement( + builder, + protUnavailableIos, + ); + DeprecatedProtocolMethods$Builder.protUnavailableMac.implement( + builder, + protUnavailableMac, + ); + DeprecatedProtocolMethods$Builder.setProtNormalProperty_.implement( + builder, + setProtNormalProperty_, + ); builder.addProtocol($protocol); - return DeprecatedProtocolMethods.as(builder.build(keepIsolateAlive: $keepIsolateAlive)); + return DeprecatedProtocolMethods.as( + builder.build(keepIsolateAlive: $keepIsolateAlive), + ); } /// Adds the implementation of the DeprecatedProtocolMethods protocol to an existing /// [objc.ObjCProtocolBuilder]. /// /// Note: You cannot call this method after you have called `builder.build`. - static void addToBuilder(objc.ObjCProtocolBuilder builder, {required int Function() protDepIos2, required int Function() protDepIos3, required int Function() protDepMac2, required int Function() protDepMac3, required int Function() protNormalMethod, required int Function() protNormalProperty, required int Function() protUnavailableIos, required int Function() protUnavailableMac, required void Function(int ) setProtNormalProperty_, bool $keepIsolateAlive = true}) { - DeprecatedProtocolMethods$Builder.protDepIos2.implement(builder, protDepIos2); DeprecatedProtocolMethods$Builder.protDepIos3.implement(builder, protDepIos3); DeprecatedProtocolMethods$Builder.protDepMac2.implement(builder, protDepMac2); DeprecatedProtocolMethods$Builder.protDepMac3.implement(builder, protDepMac3); DeprecatedProtocolMethods$Builder.protNormalMethod.implement(builder, protNormalMethod); DeprecatedProtocolMethods$Builder.protNormalProperty.implement(builder, protNormalProperty); DeprecatedProtocolMethods$Builder.protUnavailableIos.implement(builder, protUnavailableIos); DeprecatedProtocolMethods$Builder.protUnavailableMac.implement(builder, protUnavailableMac); DeprecatedProtocolMethods$Builder.setProtNormalProperty_.implement(builder, setProtNormalProperty_); + static void addToBuilder( + objc.ObjCProtocolBuilder builder, { + required int Function() protDepIos2, + required int Function() protDepIos3, + required int Function() protDepMac2, + required int Function() protDepMac3, + required int Function() protNormalMethod, + required int Function() protNormalProperty, + required int Function() protUnavailableIos, + required int Function() protUnavailableMac, + required void Function(int) setProtNormalProperty_, + bool $keepIsolateAlive = true, + }) { + DeprecatedProtocolMethods$Builder.protDepIos2.implement( + builder, + protDepIos2, + ); + DeprecatedProtocolMethods$Builder.protDepIos3.implement( + builder, + protDepIos3, + ); + DeprecatedProtocolMethods$Builder.protDepMac2.implement( + builder, + protDepMac2, + ); + DeprecatedProtocolMethods$Builder.protDepMac3.implement( + builder, + protDepMac3, + ); + DeprecatedProtocolMethods$Builder.protNormalMethod.implement( + builder, + protNormalMethod, + ); + DeprecatedProtocolMethods$Builder.protNormalProperty.implement( + builder, + protNormalProperty, + ); + DeprecatedProtocolMethods$Builder.protUnavailableIos.implement( + builder, + protUnavailableIos, + ); + DeprecatedProtocolMethods$Builder.protUnavailableMac.implement( + builder, + protUnavailableMac, + ); + DeprecatedProtocolMethods$Builder.setProtNormalProperty_.implement( + builder, + setProtNormalProperty_, + ); builder.addProtocol($protocol); } - /// Builds an object that implements the DeprecatedProtocolMethods protocol. To implement + /// Builds an object that implements the DeprecatedProtocolMethods protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All /// methods that can be implemented as listeners will be. /// /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. - static DeprecatedProtocolMethods implementAsListener({required int Function() protDepIos2, required int Function() protDepIos3, required int Function() protDepMac2, required int Function() protDepMac3, required int Function() protNormalMethod, required int Function() protNormalProperty, required int Function() protUnavailableIos, required int Function() protUnavailableMac, required void Function(int ) setProtNormalProperty_, bool $keepIsolateAlive = true}) { - final builder = objc.ObjCProtocolBuilder(debugName: 'DeprecatedProtocolMethods'); - DeprecatedProtocolMethods$Builder.protDepIos2.implement(builder, protDepIos2); DeprecatedProtocolMethods$Builder.protDepIos3.implement(builder, protDepIos3); DeprecatedProtocolMethods$Builder.protDepMac2.implement(builder, protDepMac2); DeprecatedProtocolMethods$Builder.protDepMac3.implement(builder, protDepMac3); DeprecatedProtocolMethods$Builder.protNormalMethod.implement(builder, protNormalMethod); DeprecatedProtocolMethods$Builder.protNormalProperty.implement(builder, protNormalProperty); DeprecatedProtocolMethods$Builder.protUnavailableIos.implement(builder, protUnavailableIos); DeprecatedProtocolMethods$Builder.protUnavailableMac.implement(builder, protUnavailableMac); DeprecatedProtocolMethods$Builder.setProtNormalProperty_.implementAsListener(builder, setProtNormalProperty_); + static DeprecatedProtocolMethods implementAsListener({ + required int Function() protDepIos2, + required int Function() protDepIos3, + required int Function() protDepMac2, + required int Function() protDepMac3, + required int Function() protNormalMethod, + required int Function() protNormalProperty, + required int Function() protUnavailableIos, + required int Function() protUnavailableMac, + required void Function(int) setProtNormalProperty_, + bool $keepIsolateAlive = true, + }) { + final builder = objc.ObjCProtocolBuilder( + debugName: 'DeprecatedProtocolMethods', + ); + DeprecatedProtocolMethods$Builder.protDepIos2.implement( + builder, + protDepIos2, + ); + DeprecatedProtocolMethods$Builder.protDepIos3.implement( + builder, + protDepIos3, + ); + DeprecatedProtocolMethods$Builder.protDepMac2.implement( + builder, + protDepMac2, + ); + DeprecatedProtocolMethods$Builder.protDepMac3.implement( + builder, + protDepMac3, + ); + DeprecatedProtocolMethods$Builder.protNormalMethod.implement( + builder, + protNormalMethod, + ); + DeprecatedProtocolMethods$Builder.protNormalProperty.implement( + builder, + protNormalProperty, + ); + DeprecatedProtocolMethods$Builder.protUnavailableIos.implement( + builder, + protUnavailableIos, + ); + DeprecatedProtocolMethods$Builder.protUnavailableMac.implement( + builder, + protUnavailableMac, + ); + DeprecatedProtocolMethods$Builder.setProtNormalProperty_ + .implementAsListener(builder, setProtNormalProperty_); builder.addProtocol($protocol); - return DeprecatedProtocolMethods.as(builder.build(keepIsolateAlive: $keepIsolateAlive)); + return DeprecatedProtocolMethods.as( + builder.build(keepIsolateAlive: $keepIsolateAlive), + ); } /// Adds the implementation of the DeprecatedProtocolMethods protocol to an existing @@ -319,8 +523,53 @@ /// be. /// /// Note: You cannot call this method after you have called `builder.build`. - static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, {required int Function() protDepIos2, required int Function() protDepIos3, required int Function() protDepMac2, required int Function() protDepMac3, required int Function() protNormalMethod, required int Function() protNormalProperty, required int Function() protUnavailableIos, required int Function() protUnavailableMac, required void Function(int ) setProtNormalProperty_, bool $keepIsolateAlive = true}) { - DeprecatedProtocolMethods$Builder.protDepIos2.implement(builder, protDepIos2); DeprecatedProtocolMethods$Builder.protDepIos3.implement(builder, protDepIos3); DeprecatedProtocolMethods$Builder.protDepMac2.implement(builder, protDepMac2); DeprecatedProtocolMethods$Builder.protDepMac3.implement(builder, protDepMac3); DeprecatedProtocolMethods$Builder.protNormalMethod.implement(builder, protNormalMethod); DeprecatedProtocolMethods$Builder.protNormalProperty.implement(builder, protNormalProperty); DeprecatedProtocolMethods$Builder.protUnavailableIos.implement(builder, protUnavailableIos); DeprecatedProtocolMethods$Builder.protUnavailableMac.implement(builder, protUnavailableMac); DeprecatedProtocolMethods$Builder.setProtNormalProperty_.implementAsListener(builder, setProtNormalProperty_); + static void addToBuilderAsListener( + objc.ObjCProtocolBuilder builder, { + required int Function() protDepIos2, + required int Function() protDepIos3, + required int Function() protDepMac2, + required int Function() protDepMac3, + required int Function() protNormalMethod, + required int Function() protNormalProperty, + required int Function() protUnavailableIos, + required int Function() protUnavailableMac, + required void Function(int) setProtNormalProperty_, + bool $keepIsolateAlive = true, + }) { + DeprecatedProtocolMethods$Builder.protDepIos2.implement( + builder, + protDepIos2, + ); + DeprecatedProtocolMethods$Builder.protDepIos3.implement( + builder, + protDepIos3, + ); + DeprecatedProtocolMethods$Builder.protDepMac2.implement( + builder, + protDepMac2, + ); + DeprecatedProtocolMethods$Builder.protDepMac3.implement( + builder, + protDepMac3, + ); + DeprecatedProtocolMethods$Builder.protNormalMethod.implement( + builder, + protNormalMethod, + ); + DeprecatedProtocolMethods$Builder.protNormalProperty.implement( + builder, + protNormalProperty, + ); + DeprecatedProtocolMethods$Builder.protUnavailableIos.implement( + builder, + protUnavailableIos, + ); + DeprecatedProtocolMethods$Builder.protUnavailableMac.implement( + builder, + protUnavailableMac, + ); + DeprecatedProtocolMethods$Builder.setProtNormalProperty_ + .implementAsListener(builder, setProtNormalProperty_); builder.addProtocol($protocol); } @@ -330,11 +579,59 @@ /// /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. - static DeprecatedProtocolMethods implementAsBlocking({required int Function() protDepIos2, required int Function() protDepIos3, required int Function() protDepMac2, required int Function() protDepMac3, required int Function() protNormalMethod, required int Function() protNormalProperty, required int Function() protUnavailableIos, required int Function() protUnavailableMac, required void Function(int ) setProtNormalProperty_, bool $keepIsolateAlive = true}) { - final builder = objc.ObjCProtocolBuilder(debugName: 'DeprecatedProtocolMethods'); - DeprecatedProtocolMethods$Builder.protDepIos2.implement(builder, protDepIos2); DeprecatedProtocolMethods$Builder.protDepIos3.implement(builder, protDepIos3); DeprecatedProtocolMethods$Builder.protDepMac2.implement(builder, protDepMac2); DeprecatedProtocolMethods$Builder.protDepMac3.implement(builder, protDepMac3); DeprecatedProtocolMethods$Builder.protNormalMethod.implement(builder, protNormalMethod); DeprecatedProtocolMethods$Builder.protNormalProperty.implement(builder, protNormalProperty); DeprecatedProtocolMethods$Builder.protUnavailableIos.implement(builder, protUnavailableIos); DeprecatedProtocolMethods$Builder.protUnavailableMac.implement(builder, protUnavailableMac); DeprecatedProtocolMethods$Builder.setProtNormalProperty_.implementAsBlocking(builder, setProtNormalProperty_); + static DeprecatedProtocolMethods implementAsBlocking({ + required int Function() protDepIos2, + required int Function() protDepIos3, + required int Function() protDepMac2, + required int Function() protDepMac3, + required int Function() protNormalMethod, + required int Function() protNormalProperty, + required int Function() protUnavailableIos, + required int Function() protUnavailableMac, + required void Function(int) setProtNormalProperty_, + bool $keepIsolateAlive = true, + }) { + final builder = objc.ObjCProtocolBuilder( + debugName: 'DeprecatedProtocolMethods', + ); + DeprecatedProtocolMethods$Builder.protDepIos2.implement( + builder, + protDepIos2, + ); + DeprecatedProtocolMethods$Builder.protDepIos3.implement( + builder, + protDepIos3, + ); + DeprecatedProtocolMethods$Builder.protDepMac2.implement( + builder, + protDepMac2, + ); + DeprecatedProtocolMethods$Builder.protDepMac3.implement( + builder, + protDepMac3, + ); + DeprecatedProtocolMethods$Builder.protNormalMethod.implement( + builder, + protNormalMethod, + ); + DeprecatedProtocolMethods$Builder.protNormalProperty.implement( + builder, + protNormalProperty, + ); + DeprecatedProtocolMethods$Builder.protUnavailableIos.implement( + builder, + protUnavailableIos, + ); + DeprecatedProtocolMethods$Builder.protUnavailableMac.implement( + builder, + protUnavailableMac, + ); + DeprecatedProtocolMethods$Builder.setProtNormalProperty_ + .implementAsBlocking(builder, setProtNormalProperty_); builder.addProtocol($protocol); - return DeprecatedProtocolMethods.as(builder.build(keepIsolateAlive: $keepIsolateAlive)); + return DeprecatedProtocolMethods.as( + builder.build(keepIsolateAlive: $keepIsolateAlive), + ); } /// Adds the implementation of the DeprecatedProtocolMethods protocol to an existing @@ -342,157 +639,297 @@ /// listeners will be. /// /// Note: You cannot call this method after you have called `builder.build`. - static void addToBuilderAsBlocking(objc.ObjCProtocolBuilder builder, {required int Function() protDepIos2, required int Function() protDepIos3, required int Function() protDepMac2, required int Function() protDepMac3, required int Function() protNormalMethod, required int Function() protNormalProperty, required int Function() protUnavailableIos, required int Function() protUnavailableMac, required void Function(int ) setProtNormalProperty_, bool $keepIsolateAlive = true}) { - DeprecatedProtocolMethods$Builder.protDepIos2.implement(builder, protDepIos2); DeprecatedProtocolMethods$Builder.protDepIos3.implement(builder, protDepIos3); DeprecatedProtocolMethods$Builder.protDepMac2.implement(builder, protDepMac2); DeprecatedProtocolMethods$Builder.protDepMac3.implement(builder, protDepMac3); DeprecatedProtocolMethods$Builder.protNormalMethod.implement(builder, protNormalMethod); DeprecatedProtocolMethods$Builder.protNormalProperty.implement(builder, protNormalProperty); DeprecatedProtocolMethods$Builder.protUnavailableIos.implement(builder, protUnavailableIos); DeprecatedProtocolMethods$Builder.protUnavailableMac.implement(builder, protUnavailableMac); DeprecatedProtocolMethods$Builder.setProtNormalProperty_.implementAsBlocking(builder, setProtNormalProperty_); + static void addToBuilderAsBlocking( + objc.ObjCProtocolBuilder builder, { + required int Function() protDepIos2, + required int Function() protDepIos3, + required int Function() protDepMac2, + required int Function() protDepMac3, + required int Function() protNormalMethod, + required int Function() protNormalProperty, + required int Function() protUnavailableIos, + required int Function() protUnavailableMac, + required void Function(int) setProtNormalProperty_, + bool $keepIsolateAlive = true, + }) { + DeprecatedProtocolMethods$Builder.protDepIos2.implement( + builder, + protDepIos2, + ); + DeprecatedProtocolMethods$Builder.protDepIos3.implement( + builder, + protDepIos3, + ); + DeprecatedProtocolMethods$Builder.protDepMac2.implement( + builder, + protDepMac2, + ); + DeprecatedProtocolMethods$Builder.protDepMac3.implement( + builder, + protDepMac3, + ); + DeprecatedProtocolMethods$Builder.protNormalMethod.implement( + builder, + protNormalMethod, + ); + DeprecatedProtocolMethods$Builder.protNormalProperty.implement( + builder, + protNormalProperty, + ); + DeprecatedProtocolMethods$Builder.protUnavailableIos.implement( + builder, + protUnavailableIos, + ); + DeprecatedProtocolMethods$Builder.protUnavailableMac.implement( + builder, + protUnavailableMac, + ); + DeprecatedProtocolMethods$Builder.setProtNormalProperty_ + .implementAsBlocking(builder, setProtNormalProperty_); builder.addProtocol($protocol); } /// protDepIos2 -/// -/// iOS: introduced 1.0.0, deprecated 2.0.0 -static final protDepIos2 = objc.ObjCProtocolMethod<int Function()>( + /// + /// iOS: introduced 1.0.0, deprecated 2.0.0 + static final protDepIos2 = objc.ObjCProtocolMethod<int Function()>( + _protocol_DeprecatedProtocolMethods, + _sel_protDepIos2, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1flqfr_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_protDepIos2, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1flqfr_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DeprecatedProtocolMethods, - _sel_protDepIos2, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// protDepIos3 -/// -/// iOS: introduced 1.0.0, deprecated 3.0.0 -static final protDepIos3 = objc.ObjCProtocolMethod<int Function()>( + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// protDepIos3 + /// + /// iOS: introduced 1.0.0, deprecated 3.0.0 + static final protDepIos3 = objc.ObjCProtocolMethod<int Function()>( + _protocol_DeprecatedProtocolMethods, + _sel_protDepIos3, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1flqfr_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_protDepIos3, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1flqfr_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DeprecatedProtocolMethods, - _sel_protDepIos3, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// protDepMac2 -/// -/// macOS: introduced 1.0.0, deprecated 2.0.0 -static final protDepMac2 = objc.ObjCProtocolMethod<int Function()>( + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// protDepMac2 + /// + /// macOS: introduced 1.0.0, deprecated 2.0.0 + static final protDepMac2 = objc.ObjCProtocolMethod<int Function()>( + _protocol_DeprecatedProtocolMethods, + _sel_protDepMac2, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1flqfr_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_protDepMac2, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1flqfr_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DeprecatedProtocolMethods, - _sel_protDepMac2, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// protDepMac3 -/// -/// macOS: introduced 1.0.0, deprecated 3.0.0 -static final protDepMac3 = objc.ObjCProtocolMethod<int Function()>( + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// protDepMac3 + /// + /// macOS: introduced 1.0.0, deprecated 3.0.0 + static final protDepMac3 = objc.ObjCProtocolMethod<int Function()>( + _protocol_DeprecatedProtocolMethods, + _sel_protDepMac3, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1flqfr_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_protDepMac3, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1flqfr_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DeprecatedProtocolMethods, - _sel_protDepMac3, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// protNormalMethod -static final protNormalMethod = objc.ObjCProtocolMethod<int Function()>( + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// protNormalMethod + static final protNormalMethod = objc.ObjCProtocolMethod<int Function()>( + _protocol_DeprecatedProtocolMethods, + _sel_protNormalMethod, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1flqfr_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_protNormalMethod, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1flqfr_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DeprecatedProtocolMethods, - _sel_protNormalMethod, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// protNormalProperty -static final protNormalProperty = objc.ObjCProtocolMethod<int Function()>( + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// protNormalProperty + static final protNormalProperty = objc.ObjCProtocolMethod<int Function()>( + _protocol_DeprecatedProtocolMethods, + _sel_protNormalProperty, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1flqfr_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_protNormalProperty, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1flqfr_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DeprecatedProtocolMethods, - _sel_protNormalProperty, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// protUnavailableIos -/// -/// iOS: unavailable -static final protUnavailableIos = objc.ObjCProtocolMethod<int Function()>( + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// protUnavailableIos + /// + /// iOS: unavailable + static final protUnavailableIos = objc.ObjCProtocolMethod<int Function()>( + _protocol_DeprecatedProtocolMethods, + _sel_protUnavailableIos, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1flqfr_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_protUnavailableIos, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1flqfr_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DeprecatedProtocolMethods, - _sel_protUnavailableIos, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// protUnavailableMac -/// -/// macOS: unavailable -static final protUnavailableMac = objc.ObjCProtocolMethod<int Function()>( + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// protUnavailableMac + /// + /// macOS: unavailable + static final protUnavailableMac = objc.ObjCProtocolMethod<int Function()>( + _protocol_DeprecatedProtocolMethods, + _sel_protUnavailableMac, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1flqfr_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_protUnavailableMac, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1flqfr_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DeprecatedProtocolMethods, - _sel_protUnavailableMac, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// setProtNormalProperty: -static final setProtNormalProperty_ = objc.ObjCProtocolListenableMethod<void Function(int )>( - _protocol_DeprecatedProtocolMethods, - _sel_setProtNormalProperty_, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> , ffi.Int )>>(_1flqfr_protocolTrampoline_1t7vjnw).cast(), - objc.getProtocolMethodSignature( + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// setProtNormalProperty: + static final setProtNormalProperty_ = + objc.ObjCProtocolListenableMethod<void Function(int)>( + _protocol_DeprecatedProtocolMethods, + _sel_setProtNormalProperty_, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + > + >(_1flqfr_protocolTrampoline_1t7vjnw) + .cast(), + objc.getProtocolMethodSignature( _protocol_DeprecatedProtocolMethods, _sel_setProtNormalProperty_, isRequired: true, isInstanceMethod: true, - ), - (void Function(int ) func) => ObjCBlock_ffiVoid_ffiVoid_ffiInt.fromFunction((ffi.Pointer<ffi.Void> _, int arg1) => func(arg1)), - (void Function(int ) func) => ObjCBlock_ffiVoid_ffiVoid_ffiInt.listener((ffi.Pointer<ffi.Void> _, int arg1) => func(arg1)), - (void Function(int ) func) => ObjCBlock_ffiVoid_ffiVoid_ffiInt.blocking((ffi.Pointer<ffi.Void> _, int arg1) => func(arg1)), - - ); - + ), + (void Function(int) func) => + ObjCBlock_ffiVoid_ffiVoid_ffiInt.fromFunction( + (ffi.Pointer<ffi.Void> _, int arg1) => func(arg1), + ), + (void Function(int) func) => ObjCBlock_ffiVoid_ffiVoid_ffiInt.listener( + (ffi.Pointer<ffi.Void> _, int arg1) => func(arg1), + ), + (void Function(int) func) => ObjCBlock_ffiVoid_ffiVoid_ffiInt.blocking( + (ffi.Pointer<ffi.Void> _, int arg1) => func(arg1), + ), + ); } + enum NormalEnum { x(0); - final int value; const NormalEnum(this.value); @@ -500,37 +937,47 @@ 0 => x, _ => throw ArgumentError('Unknown value for NormalEnum: $value'), }; - } -final class NormalStruct extends ffi.Struct{ +final class NormalStruct extends ffi.Struct { @ffi.Int() external int x; - } -final class NormalUnion extends ffi.Union{ +final class NormalUnion extends ffi.Union { @ffi.Int() external int x; - } - /// Construction methods for `objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>`. abstract final class ObjCBlock_ffiInt_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> fromPointer(ffi.Pointer<objc.ObjCBlockImpl> pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>(pointer, retain: retain, release: release); + static objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> fromPointer( + ffi.Pointer<objc.ObjCBlockImpl> pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>( + 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.Int Function(ffi.Pointer<ffi.Void>)> fromFunctionPointer(ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ffi.Void> arg0)>> ptr) => - objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>(objc.newPointerBlock(_fnPtrCallable, ptr.cast()), - retain: false, release: true); + static objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ffi.Void> arg0)> + > + ptr, + ) => objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -540,47 +987,98 @@ /// /// 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.Int Function(ffi.Pointer<ffi.Void>)> fromFunction(int Function(ffi.Pointer<ffi.Void> ) fn, - {bool keepIsolateAlive = true}) => - objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>(objc.newClosureBlock(_closureCallable, (ffi.Pointer<ffi.Void> arg0) => fn(arg0), keepIsolateAlive), - retain: false, release: true); + static objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> fromFunction( + int Function(ffi.Pointer<ffi.Void>) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer<ffi.Void> arg0) => fn(arg0), + keepIsolateAlive, + ), + retain: false, + release: true, + ); static int _fnPtrTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - block.ref.target.cast<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<int Function(ffi.Pointer<ffi.Void> )>()(arg0); - static ffi.Pointer<ffi.Void> _fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Int Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_fnPtrTrampoline , 0).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => block.ref.target + .cast<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ffi.Void> arg0)>>() + .asFunction<int Function(ffi.Pointer<ffi.Void>)>()(arg0); + static ffi.Pointer<ffi.Void> _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_fnPtrTrampoline, 0) + .cast(); static int _closureTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - (objc.getBlockClosure(block) as int Function(ffi.Pointer<ffi.Void> ))(arg0); - static ffi.Pointer<ffi.Void> _closureCallable = ffi.Pointer.fromFunction< - ffi.Int Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_closureTrampoline , 0).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => (objc.getBlockClosure(block) as int Function(ffi.Pointer<ffi.Void>))( + arg0, + ); + static ffi.Pointer<ffi.Void> _closureCallable = + ffi.Pointer.fromFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_closureTrampoline, 0) + .cast(); } /// Call operator for `objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>`. -extension ObjCBlock_ffiInt_ffiVoid$CallExtension on objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> { - int call(ffi.Pointer<ffi.Void> arg0) =>ref.pointer.ref.invoke.cast<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<int Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>()( - ref.pointer, arg0); +extension ObjCBlock_ffiInt_ffiVoid$CallExtension + on objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> { + int call(ffi.Pointer<ffi.Void> arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) + > + >() + .asFunction< + int Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Pointer<ffi.Void>) + >()(ref.pointer, arg0); } - /// Construction methods for `objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_ffiInt { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> fromPointer(ffi.Pointer<objc.ObjCBlockImpl> pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>(pointer, retain: retain, release: release); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> + fromPointer( + ffi.Pointer<objc.ObjCBlockImpl> pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>( + pointer, + retain: retain, + release: release, + ); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> fromFunctionPointer(ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void> arg0, ffi.Int arg1)>> ptr) => - objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>(objc.newPointerBlock(_fnPtrCallable, ptr.cast()), - retain: false, release: true); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<ffi.Void> arg0, ffi.Int arg1) + > + > + ptr, + ) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -590,10 +1088,19 @@ /// /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> fromFunction(void Function(ffi.Pointer<ffi.Void> , int ) fn, - {bool keepIsolateAlive = true}) => - objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>(objc.newClosureBlock(_closureCallable, (ffi.Pointer<ffi.Void> arg0, int arg1) => fn(arg0, arg1), keepIsolateAlive), - retain: false, release: true); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> + fromFunction( + void Function(ffi.Pointer<ffi.Void>, int) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer<ffi.Void> arg0, int arg1) => fn(arg0, arg1), + keepIsolateAlive, + ), + retain: false, + release: true, + ); /// Creates a listener block from a Dart function. /// @@ -604,13 +1111,23 @@ /// /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> listener(void Function(ffi.Pointer<ffi.Void> , int ) fn, - {bool keepIsolateAlive = true}) { - final raw = objc.newClosureBlock(_listenerCallable.nativeFunction.cast(), - (ffi.Pointer<ffi.Void> arg0, int arg1) => fn(arg0, arg1), keepIsolateAlive); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> + listener( + void Function(ffi.Pointer<ffi.Void>, int) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer<ffi.Void> arg0, int arg1) => fn(arg0, arg1), + keepIsolateAlive, + ); final wrapper = _1flqfr_wrapListenerBlock_1t7vjnw(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>(wrapper, retain: false, release: true); + return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>( + wrapper, + retain: false, + release: true, + ); } /// Creates a blocking block from a Dart function. @@ -623,71 +1140,279 @@ /// until it is garbage collected by both Dart and ObjC. If the owner isolate /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> blocking(void Function(ffi.Pointer<ffi.Void> , int ) fn, - {bool keepIsolateAlive = true}) { - final raw = objc.newClosureBlock(_blockingCallable.nativeFunction.cast(), - (ffi.Pointer<ffi.Void> arg0, int arg1) => fn(arg0, arg1), keepIsolateAlive); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> + blocking( + void Function(ffi.Pointer<ffi.Void>, int) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer<ffi.Void> arg0, int arg1) => fn(arg0, arg1), + keepIsolateAlive, + ); final rawListener = objc.newClosureBlock( - _blockingListenerCallable.nativeFunction.cast(), - (ffi.Pointer<ffi.Void> arg0, int arg1) => fn(arg0, arg1), keepIsolateAlive); - final wrapper = _1flqfr_wrapBlockingBlock_1t7vjnw(raw, rawListener, objc.objCContext); + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer<ffi.Void> arg0, int arg1) => fn(arg0, arg1), + keepIsolateAlive, + ); + final wrapper = _1flqfr_wrapBlockingBlock_1t7vjnw( + raw, + rawListener, + objc.objCContext, + ); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>(wrapper, retain: false, release: true); + return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>( + wrapper, + retain: false, + release: true, + ); } static void _listenerTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, int arg1) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Void> , int ))(arg0, arg1); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + int arg1, + ) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Void>, int))( + arg0, + arg1, + ); objc.objectRelease(block.cast()); } - static ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Int )> _listenerCallable = - ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Int )>.listener(_listenerTrampoline ) - ..keepIsolateAlive = false; + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; static void _blockingTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> waiter, ffi.Pointer<ffi.Void> arg0, int arg1) { + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> waiter, + ffi.Pointer<ffi.Void> arg0, + int arg1, + ) { try { - (objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Void> , int ))(arg0, arg1); + (objc.getBlockClosure(block) + as void Function(ffi.Pointer<ffi.Void>, int))(arg0, arg1); } catch (e) { } finally { objc.signalWaiter(waiter); objc.objectRelease(block.cast()); } } - static ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<ffi.Void> , ffi.Int )> _blockingCallable = - ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<ffi.Void> , ffi.Int )>.isolateLocal( - _blockingTrampoline )..keepIsolateAlive = false; - static ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<ffi.Void> , ffi.Int )> _blockingListenerCallable = - ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<ffi.Void> , ffi.Int )>.listener( - _blockingTrampoline )..keepIsolateAlive = false; + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; static void _fnPtrTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, int arg1) => - block.ref.target.cast<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void> arg0, ffi.Int arg1)>>() - .asFunction<void Function(ffi.Pointer<ffi.Void> , int )>()(arg0, arg1); - static ffi.Pointer<ffi.Void> _fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Int )>(_fnPtrTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + int arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer<ffi.Void> arg0, ffi.Int arg1) + > + >() + .asFunction<void Function(ffi.Pointer<ffi.Void>, int)>()(arg0, arg1); + static ffi.Pointer<ffi.Void> _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + >(_fnPtrTrampoline) + .cast(); static void _closureTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, int arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Void> , int ))(arg0, arg1); - static ffi.Pointer<ffi.Void> _closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Int )>(_closureTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + int arg1, + ) => + (objc.getBlockClosure(block) + as void Function(ffi.Pointer<ffi.Void>, int))(arg0, arg1); + static ffi.Pointer<ffi.Void> _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Int, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)>`. -extension ObjCBlock_ffiVoid_ffiVoid_ffiInt$CallExtension on objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> { - void call(ffi.Pointer<ffi.Void> arg0, int arg1) =>ref.pointer.ref.invoke.cast<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Int arg1)>>() - .asFunction<void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , int )>()( - ref.pointer, arg0, arg1); +extension ObjCBlock_ffiVoid_ffiVoid_ffiInt$CallExtension + on objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.Int)> { + void call(ffi.Pointer<ffi.Void> arg0, int arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Int arg1, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + int, + ) + >()(ref.pointer, arg0, arg1); } -late final _class_DeprecatedInterfaceMethods = objc.getClass("DeprecatedInterfaceMethods"); -final _objc_msgSend_13yqbb6 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_151sglz = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_19nvye5 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>>().asFunction<bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>(); -final _objc_msgSend_1cwp428 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.NSZone> )>>().asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.NSZone> )>(); -final _objc_msgSend_9o8504 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Int )>>().asFunction<void Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , int )>(); -final _objc_msgSend_e3qsqz = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCProtocolImpl> )>>().asFunction<bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCProtocolImpl> )>(); -late final _protocol_DeprecatedProtocolMethods = objc.getProtocol("DeprecatedProtocolMethods"); +late final _class_DeprecatedInterfaceMethods = objc.getClass( + "DeprecatedInterfaceMethods", +); +final _objc_msgSend_13yqbb6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_151sglz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_19nvye5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + > + >() + .asFunction< + bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(); +final _objc_msgSend_1cwp428 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.NSZone>, + ) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.NSZone>, + ) + >(); +final _objc_msgSend_9o8504 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Int, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + int, + ) + >(); +final _objc_msgSend_e3qsqz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCProtocolImpl>, + ) + > + >() + .asFunction< + bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCProtocolImpl>, + ) + >(); +late final _protocol_DeprecatedProtocolMethods = objc.getProtocol( + "DeprecatedProtocolMethods", +); late final _sel_alloc = objc.registerName("alloc"); late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); late final _sel_conformsToProtocol_ = objc.registerName("conformsToProtocol:"); @@ -708,11 +1433,12 @@ late final _sel_protUnavailableIos = objc.registerName("protUnavailableIos"); late final _sel_protUnavailableMac = objc.registerName("protUnavailableMac"); late final _sel_setNormalProperty_ = objc.registerName("setNormalProperty:"); -late final _sel_setProtNormalProperty_ = objc.registerName("setProtNormalProperty:"); +late final _sel_setProtNormalProperty_ = objc.registerName( + "setProtNormalProperty:", +); late final _sel_unavailableIos = objc.registerName("unavailableIos"); late final _sel_unavailableMac = objc.registerName("unavailableMac"); typedef instancetype = ffi.Pointer<objc.ObjCObjectImpl>; typedef Dartinstancetype = objc.ObjCObject; const int normalUnnamedEnum = 0; -
diff --git a/pkgs/ffigen/test/native_objc_test/ns_range_bindings.dart b/pkgs/ffigen/test/native_objc_test/ns_range_bindings.dart index 807ddf2..a7424eb 100644 --- a/pkgs/ffigen/test/native_objc_test/ns_range_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/ns_range_bindings.dart
@@ -1,53 +1,94 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// +// // Generated by `package:ffigen`. // ignore_for_file: type=lint, unused_import 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.Void Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>() -external void _vy9kn_protocolTrampoline_18v1jvf(ffi.Pointer<objc.ObjCObjectImpl> target, -ffi.Pointer<ffi.Void> arg0, -ffi.Pointer<objc.ObjCObjectImpl> arg1, + +@ffi.Native< + ffi.Void Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) +>() +external void _vy9kn_protocolTrampoline_18v1jvf( + ffi.Pointer<objc.ObjCObjectImpl> target, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, ); -@ffi.Native<ffi.Bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>() -external bool _vy9kn_protocolTrampoline_e3qsqz(ffi.Pointer<objc.ObjCObjectImpl> target, -ffi.Pointer<ffi.Void> arg0, +@ffi.Native< + ffi.Bool Function(ffi.Pointer<objc.ObjCObjectImpl>, ffi.Pointer<ffi.Void>) +>() +external bool _vy9kn_protocolTrampoline_e3qsqz( + ffi.Pointer<objc.ObjCObjectImpl> target, + ffi.Pointer<ffi.Void> arg0, ); -@ffi.Native<instancetype Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>() -external instancetype _vy9kn_protocolTrampoline_xr62hr(ffi.Pointer<objc.ObjCObjectImpl> target, -ffi.Pointer<ffi.Void> arg0, -ffi.Pointer<objc.ObjCObjectImpl> arg1, +@ffi.Native< + instancetype Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) +>() +external instancetype _vy9kn_protocolTrampoline_xr62hr( + ffi.Pointer<objc.ObjCObjectImpl> target, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, ); -@ffi.Native<ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<objc.DOBJC_Context> )>(isLeaf: true) -external ffi.Pointer<objc.ObjCBlockImpl> _vy9kn_wrapBlockingBlock_18v1jvf(ffi.Pointer<objc.ObjCBlockImpl> block, -ffi.Pointer<objc.ObjCBlockImpl> listnerBlock, -ffi.Pointer<objc.DOBJC_Context> context, +@ffi.Native< + ffi.Pointer<objc.ObjCBlockImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<objc.DOBJC_Context>, + ) +>(isLeaf: true) +external ffi.Pointer<objc.ObjCBlockImpl> _vy9kn_wrapBlockingBlock_18v1jvf( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<objc.ObjCBlockImpl> listnerBlock, + ffi.Pointer<objc.DOBJC_Context> context, ); -@ffi.Native<ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> )>(isLeaf: true) -external ffi.Pointer<objc.ObjCBlockImpl> _vy9kn_wrapListenerBlock_18v1jvf(ffi.Pointer<objc.ObjCBlockImpl> block, +@ffi.Native< + ffi.Pointer<objc.ObjCBlockImpl> Function(ffi.Pointer<objc.ObjCBlockImpl>) +>(isLeaf: true) +external ffi.Pointer<objc.ObjCBlockImpl> _vy9kn_wrapListenerBlock_18v1jvf( + ffi.Pointer<objc.ObjCBlockImpl> block, ); - /// Construction methods for `objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)>`. abstract final class ObjCBlock_bool_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)> fromPointer(ffi.Pointer<objc.ObjCBlockImpl> pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)>(pointer, retain: retain, release: release); + static objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)> fromPointer( + ffi.Pointer<objc.ObjCBlockImpl> pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)>( + 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.Bool Function(ffi.Pointer<ffi.Void>)> fromFunctionPointer(ffi.Pointer<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<ffi.Void> arg0)>> ptr) => - objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)>(objc.newPointerBlock(_fnPtrCallable, ptr.cast()), - retain: false, release: true); + static objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<ffi.Void> arg0)> + > + ptr, + ) => objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)>( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -57,47 +98,101 @@ /// /// 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.Bool Function(ffi.Pointer<ffi.Void>)> fromFunction(bool Function(ffi.Pointer<ffi.Void> ) fn, - {bool keepIsolateAlive = true}) => - objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)>(objc.newClosureBlock(_closureCallable, (ffi.Pointer<ffi.Void> arg0) => fn(arg0), keepIsolateAlive), - retain: false, release: true); + static objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)> fromFunction( + bool Function(ffi.Pointer<ffi.Void>) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)>( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer<ffi.Void> arg0) => fn(arg0), + keepIsolateAlive, + ), + retain: false, + release: true, + ); static bool _fnPtrTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - block.ref.target.cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<bool Function(ffi.Pointer<ffi.Void> )>()(arg0); - static ffi.Pointer<ffi.Void> _fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_fnPtrTrampoline , false).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => block.ref.target + .cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<ffi.Void> arg0)>>() + .asFunction<bool Function(ffi.Pointer<ffi.Void>)>()(arg0); + static ffi.Pointer<ffi.Void> _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_fnPtrTrampoline, false) + .cast(); static bool _closureTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - (objc.getBlockClosure(block) as bool Function(ffi.Pointer<ffi.Void> ))(arg0); - static ffi.Pointer<ffi.Void> _closureCallable = ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_closureTrampoline , false).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => (objc.getBlockClosure(block) as bool Function(ffi.Pointer<ffi.Void>))( + arg0, + ); + static ffi.Pointer<ffi.Void> _closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_closureTrampoline, false) + .cast(); } /// Call operator for `objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)>`. -extension ObjCBlock_bool_ffiVoid$CallExtension on objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)> { - bool call(ffi.Pointer<ffi.Void> arg0) =>ref.pointer.ref.invoke.cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<bool Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>()( - ref.pointer, arg0); +extension ObjCBlock_bool_ffiVoid$CallExtension + on objc.ObjCBlock<ffi.Bool Function(ffi.Pointer<ffi.Void>)> { + bool call(ffi.Pointer<ffi.Void> arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) + > + >() + .asFunction< + bool Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Pointer<ffi.Void>) + >()(ref.pointer, arg0); } - /// Construction methods for `objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>`. abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> fromPointer(ffi.Pointer<objc.ObjCBlockImpl> pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>(pointer, retain: retain, release: release); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> + fromPointer( + ffi.Pointer<objc.ObjCBlockImpl> pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>( + pointer, + retain: retain, + release: release, + ); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> fromFunctionPointer(ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1)>> ptr) => - objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>(objc.newPointerBlock(_fnPtrCallable, ptr.cast()), - retain: false, release: true); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) + > + > + ptr, + ) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -107,10 +202,20 @@ /// /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> fromFunction(void Function(ffi.Pointer<ffi.Void> , objc.NSCoder ) fn, - {bool keepIsolateAlive = true}) => - objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>(objc.newClosureBlock(_closureCallable, (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => fn(arg0, objc.NSCoder.fromPointer(arg1, retain: true, release: true)), keepIsolateAlive), - retain: false, release: true); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> + fromFunction( + void Function(ffi.Pointer<ffi.Void>, objc.NSCoder) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => + fn(arg0, objc.NSCoder.fromPointer(arg1, retain: true, release: true)), + keepIsolateAlive, + ), + retain: false, + release: true, + ); /// Creates a listener block from a Dart function. /// @@ -121,13 +226,24 @@ /// /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> listener(void Function(ffi.Pointer<ffi.Void> , objc.NSCoder ) fn, - {bool keepIsolateAlive = true}) { - final raw = objc.newClosureBlock(_listenerCallable.nativeFunction.cast(), - (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => fn(arg0, objc.NSCoder.fromPointer(arg1, retain: false, release: true)), keepIsolateAlive); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> + listener( + void Function(ffi.Pointer<ffi.Void>, objc.NSCoder) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _listenerCallable.nativeFunction.cast(), + (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => fn( + arg0, + objc.NSCoder.fromPointer(arg1, retain: false, release: true), + ), + keepIsolateAlive, + ); final wrapper = _vy9kn_wrapListenerBlock_18v1jvf(raw); objc.objectRelease(raw.cast()); - return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>(wrapper, retain: false, release: true); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder) + >(wrapper, retain: false, release: true); } /// Creates a blocking block from a Dart function. @@ -140,79 +256,247 @@ /// until it is garbage collected by both Dart and ObjC. If the owner isolate /// has shut down, and the block is invoked by native code, it may block /// indefinitely, or have other undefined behavior. - static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> blocking(void Function(ffi.Pointer<ffi.Void> , objc.NSCoder ) fn, - {bool keepIsolateAlive = true}) { - final raw = objc.newClosureBlock(_blockingCallable.nativeFunction.cast(), - (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => fn(arg0, objc.NSCoder.fromPointer(arg1, retain: false, release: true)), keepIsolateAlive); + static objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> + blocking( + void Function(ffi.Pointer<ffi.Void>, objc.NSCoder) fn, { + bool keepIsolateAlive = true, + }) { + final raw = objc.newClosureBlock( + _blockingCallable.nativeFunction.cast(), + (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => fn( + arg0, + objc.NSCoder.fromPointer(arg1, retain: false, release: true), + ), + keepIsolateAlive, + ); final rawListener = objc.newClosureBlock( - _blockingListenerCallable.nativeFunction.cast(), - (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => fn(arg0, objc.NSCoder.fromPointer(arg1, retain: false, release: true)), keepIsolateAlive); - final wrapper = _vy9kn_wrapBlockingBlock_18v1jvf(raw, rawListener, objc.objCContext); + _blockingListenerCallable.nativeFunction.cast(), + (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => fn( + arg0, + objc.NSCoder.fromPointer(arg1, retain: false, release: true), + ), + keepIsolateAlive, + ); + final wrapper = _vy9kn_wrapBlockingBlock_18v1jvf( + raw, + rawListener, + objc.objCContext, + ); objc.objectRelease(raw.cast()); objc.objectRelease(rawListener.cast()); - return objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>(wrapper, retain: false, release: true); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder) + >(wrapper, retain: false, release: true); } static void _listenerTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) { - (objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> ))(arg0, arg1); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) { + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ))(arg0, arg1); objc.objectRelease(block.cast()); } - static ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )> _listenerCallable = - ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>.listener(_listenerTrampoline ) - ..keepIsolateAlive = false; + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + > + _listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >.listener(_listenerTrampoline) + ..keepIsolateAlive = false; static void _blockingTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> waiter, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) { + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> waiter, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) { try { - (objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> ))(arg0, arg1); + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ))(arg0, arg1); } catch (e) { } finally { objc.signalWaiter(waiter); objc.objectRelease(block.cast()); } } - static ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )> _blockingCallable = - ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>.isolateLocal( - _blockingTrampoline )..keepIsolateAlive = false; - static ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )> _blockingListenerCallable = - ffi.NativeCallable<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>.listener( - _blockingTrampoline )..keepIsolateAlive = false; + + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + > + _blockingCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >.isolateLocal(_blockingTrampoline) + ..keepIsolateAlive = false; + static ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + > + _blockingListenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >.listener(_blockingTrampoline) + ..keepIsolateAlive = false; static void _fnPtrTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => - block.ref.target.cast<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1)>>() - .asFunction<void Function(ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>()(arg0, arg1); - static ffi.Pointer<ffi.Void> _fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>(_fnPtrTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) + > + >() + .asFunction< + void Function(ffi.Pointer<ffi.Void>, ffi.Pointer<objc.ObjCObjectImpl>) + >()(arg0, arg1); + static ffi.Pointer<ffi.Void> _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(_fnPtrTrampoline) + .cast(); static void _closureTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => - (objc.getBlockClosure(block) as void Function(ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> ))(arg0, arg1); - static ffi.Pointer<ffi.Void> _closureCallable = ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>(_closureTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) => + (objc.getBlockClosure(block) + as void Function( + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ))(arg0, arg1); + static ffi.Pointer<ffi.Void> _closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>`. -extension ObjCBlock_ffiVoid_ffiVoid_NSCoder$CallExtension on objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> { - void call(ffi.Pointer<ffi.Void> arg0, objc.NSCoder arg1) =>ref.pointer.ref.invoke.cast<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1)>>() - .asFunction<void Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>()( - ref.pointer, arg0, arg1.ref.pointer); +extension ObjCBlock_ffiVoid_ffiVoid_NSCoder$CallExtension + on objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> { + void call(ffi.Pointer<ffi.Void> arg0, objc.NSCoder arg1) => ref + .pointer + .ref + .invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >()(ref.pointer, arg0, arg1.ref.pointer); } - /// Construction methods for `objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>`. abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> fromPointer(ffi.Pointer<objc.ObjCBlockImpl> pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>(pointer, retain: retain, release: release); + static objc.ObjCBlock< + objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function( + ffi.Pointer<ffi.Void>, + objc.NSCoder, + ) + > + fromPointer( + ffi.Pointer<objc.ObjCBlockImpl> pointer, { + bool retain = false, + bool release = false, + }) => + objc.ObjCBlock< + objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function( + ffi.Pointer<ffi.Void>, + objc.NSCoder, + ) + >(pointer, retain: retain, release: release); /// Creates a block from a C function pointer. /// /// This block must be invoked by native code running on the same thread as /// the isolate that registered it. Invoking the block on the wrong thread /// will result in a crash. - static objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> fromFunctionPointer(ffi.Pointer<ffi.NativeFunction<instancetype Function(ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1)>> ptr) => - objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>(objc.newPointerBlock(_fnPtrCallable, ptr.cast()), - retain: false, release: true); + static objc.ObjCBlock< + objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function( + ffi.Pointer<ffi.Void>, + objc.NSCoder, + ) + > + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) + > + > + ptr, + ) => + objc.ObjCBlock< + objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function( + ffi.Pointer<ffi.Void>, + objc.NSCoder, + ) + >( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -222,207 +506,602 @@ /// /// If `keepIsolateAlive` is true, this block will keep this isolate alive /// until it is garbage collected by both Dart and ObjC. - static objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> fromFunction(Dartinstancetype? Function(ffi.Pointer<ffi.Void> , objc.NSCoder ) fn, - {bool keepIsolateAlive = true}) => - objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>(objc.newClosureBlock(_closureCallable, (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => fn(arg0, objc.NSCoder.fromPointer(arg1, retain: true, release: true))?.ref.retainAndReturnPointer() ?? ffi.nullptr, keepIsolateAlive), - retain: false, release: true); + static objc.ObjCBlock< + objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function( + ffi.Pointer<ffi.Void>, + objc.NSCoder, + ) + > + fromFunction( + Dartinstancetype? Function(ffi.Pointer<ffi.Void>, objc.NSCoder) fn, { + bool keepIsolateAlive = true, + }) => + objc.ObjCBlock< + objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function( + ffi.Pointer<ffi.Void>, + objc.NSCoder, + ) + >( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => + fn( + arg0, + objc.NSCoder.fromPointer(arg1, retain: true, release: true), + )?.ref.retainAndReturnPointer() ?? + ffi.nullptr, + keepIsolateAlive, + ), + retain: false, + release: true, + ); static instancetype _fnPtrTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => - block.ref.target.cast<ffi.NativeFunction<instancetype Function(ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1)>>() - .asFunction<instancetype Function(ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>()(arg0, arg1); - static ffi.Pointer<ffi.Void> _fnPtrCallable = ffi.Pointer.fromFunction< - instancetype Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>(_fnPtrTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) => block.ref.target + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) + > + >() + .asFunction< + instancetype Function( + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >()(arg0, arg1); + static ffi.Pointer<ffi.Void> _fnPtrCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(_fnPtrTrampoline) + .cast(); static instancetype _closureTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1) => - (objc.getBlockClosure(block) as instancetype Function(ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> ))(arg0, arg1); - static ffi.Pointer<ffi.Void> _closureCallable = ffi.Pointer.fromFunction< - instancetype Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>(_closureTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) => + (objc.getBlockClosure(block) + as instancetype Function( + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ))(arg0, arg1); + static ffi.Pointer<ffi.Void> _closureCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)>`. -extension ObjCBlock_instancetype_ffiVoid_NSCoder$CallExtension on objc.ObjCBlock<objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function(ffi.Pointer<ffi.Void>, objc.NSCoder)> { - Dartinstancetype? call(ffi.Pointer<ffi.Void> arg0, objc.NSCoder arg1) =>ref.pointer.ref.invoke.cast<ffi.NativeFunction<instancetype Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1)>>() - .asFunction<instancetype Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>()( - ref.pointer, arg0, arg1.ref.pointer).address == 0 ? null : objc.ObjCObject(ref.pointer.ref.invoke.cast<ffi.NativeFunction<instancetype Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0, ffi.Pointer<objc.ObjCObjectImpl> arg1)>>() - .asFunction<instancetype Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> , ffi.Pointer<objc.ObjCObjectImpl> )>()( - ref.pointer, arg0, arg1.ref.pointer), retain: false, release: true); +extension ObjCBlock_instancetype_ffiVoid_NSCoder$CallExtension + on + objc.ObjCBlock< + objc.Retained<ffi.Pointer<objc.ObjCObjectImpl>?> Function( + ffi.Pointer<ffi.Void>, + objc.NSCoder, + ) + > { + Dartinstancetype? call(ffi.Pointer<ffi.Void> arg0, objc.NSCoder arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) + > + >() + .asFunction< + instancetype Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >()(ref.pointer, arg0, arg1.ref.pointer) + .address == + 0 + ? null + : objc.ObjCObject( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ffi.Pointer<objc.ObjCObjectImpl> arg1, + ) + > + >() + .asFunction< + instancetype Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >()(ref.pointer, arg0, arg1.ref.pointer), + retain: false, + release: true, + ); } - /// SFTranscriptionSegment -extension type SFTranscriptionSegment._(objc.ObjCObject object$) implements objc.ObjCObject,objc.NSObject,objc.NSCopying,objc.NSSecureCoding { +extension type SFTranscriptionSegment._(objc.ObjCObject object$) + implements + objc.ObjCObject, + objc.NSObject, + objc.NSCopying, + objc.NSSecureCoding { /// Constructs a [SFTranscriptionSegment] that points to the same underlying object as [other]. SFTranscriptionSegment.as(objc.ObjCObject other) : object$ = other { - objc.checkOsVersionInternal('SFTranscriptionSegment', iOS: (false, (10, 0, 0)), macOS: (false, (10, 15, 0))); + objc.checkOsVersionInternal( + 'SFTranscriptionSegment', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 15, 0)), + ); assert(isA(object$)); } /// Constructs a [SFTranscriptionSegment] that wraps the given raw object pointer. - SFTranscriptionSegment.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { - objc.checkOsVersionInternal('SFTranscriptionSegment', iOS: (false, (10, 0, 0)), macOS: (false, (10, 15, 0))); + SFTranscriptionSegment.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'SFTranscriptionSegment', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 15, 0)), + ); assert(isA(object$)); } /// Returns whether [obj] is an instance of [SFTranscriptionSegment]. - static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(obj.ref.pointer, _sel_isKindOfClass_, _class_SFTranscriptionSegment); + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_SFTranscriptionSegment, + ); /// alloc static SFTranscriptionSegment alloc() { - final $ret = _objc_msgSend_151sglz(_class_SFTranscriptionSegment, _sel_alloc); - return SFTranscriptionSegment.fromPointer($ret, retain: false, release: true); + final $ret = _objc_msgSend_151sglz( + _class_SFTranscriptionSegment, + _sel_alloc, + ); + return SFTranscriptionSegment.fromPointer( + $ret, + retain: false, + release: true, + ); } - /// allocWithZone: static SFTranscriptionSegment allocWithZone(ffi.Pointer<objc.NSZone> zone) { - final $ret = _objc_msgSend_1cwp428(_class_SFTranscriptionSegment, _sel_allocWithZone_, zone); - return SFTranscriptionSegment.fromPointer($ret, retain: false, release: true); + final $ret = _objc_msgSend_1cwp428( + _class_SFTranscriptionSegment, + _sel_allocWithZone_, + zone, + ); + return SFTranscriptionSegment.fromPointer( + $ret, + retain: false, + release: true, + ); } - /// new static SFTranscriptionSegment new$() { final $ret = _objc_msgSend_151sglz(_class_SFTranscriptionSegment, _sel_new); - return SFTranscriptionSegment.fromPointer($ret, retain: false, release: true); + return SFTranscriptionSegment.fromPointer( + $ret, + retain: false, + release: true, + ); } - /// supportsSecureCoding static bool getSupportsSecureCoding() { - return _objc_msgSend_91o635(_class_SFTranscriptionSegment, _sel_supportsSecureCoding); - + return _objc_msgSend_91o635( + _class_SFTranscriptionSegment, + _sel_supportsSecureCoding, + ); } + /// Returns a new instance of SFTranscriptionSegment constructed with the default `new` method. SFTranscriptionSegment() : this.as(new$().object$); - } extension SFTranscriptionSegment$Methods on SFTranscriptionSegment { - /// alternativeSubstrings objc.NSArray get alternativeSubstrings { - objc.checkOsVersionInternal('SFTranscriptionSegment.alternativeSubstrings', iOS: (false, (10, 0, 0)), macOS: (false, (10, 15, 0))); - final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_alternativeSubstrings); + objc.checkOsVersionInternal( + 'SFTranscriptionSegment.alternativeSubstrings', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_alternativeSubstrings, + ); return objc.NSArray.fromPointer($ret, retain: true, release: true); } - /// confidence double get confidence { - objc.checkOsVersionInternal('SFTranscriptionSegment.confidence', iOS: (false, (10, 0, 0)), macOS: (false, (10, 15, 0))); - return objc.useMsgSendVariants ? _objc_msgSend_2cgrxlFpret(object$.ref.pointer, _sel_confidence) : _objc_msgSend_2cgrxl(object$.ref.pointer, _sel_confidence); - + objc.checkOsVersionInternal( + 'SFTranscriptionSegment.confidence', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + return objc.useMsgSendVariants + ? _objc_msgSend_2cgrxlFpret(object$.ref.pointer, _sel_confidence) + : _objc_msgSend_2cgrxl(object$.ref.pointer, _sel_confidence); } - /// duration double get duration { - objc.checkOsVersionInternal('SFTranscriptionSegment.duration', iOS: (false, (10, 0, 0)), macOS: (false, (10, 15, 0))); - return objc.useMsgSendVariants ? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_duration) : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_duration); - + objc.checkOsVersionInternal( + 'SFTranscriptionSegment.duration', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_duration) + : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_duration); } - /// encodeWithCoder: void encodeWithCoder(objc.NSCoder coder) { -_objc_msgSend_xtuoz7(object$.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); - + _objc_msgSend_xtuoz7( + object$.ref.pointer, + _sel_encodeWithCoder_, + coder.ref.pointer, + ); } - /// init SFTranscriptionSegment init() { - objc.checkOsVersionInternal('SFTranscriptionSegment.init', iOS: (false, (2, 0, 0)), macOS: (false, (10, 0, 0))); - final $ret = _objc_msgSend_151sglz(object$.ref.retainAndReturnPointer(), _sel_init); - return SFTranscriptionSegment.fromPointer($ret, retain: false, release: true); + objc.checkOsVersionInternal( + 'SFTranscriptionSegment.init', + iOS: (false, (2, 0, 0)), + macOS: (false, (10, 0, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.retainAndReturnPointer(), + _sel_init, + ); + return SFTranscriptionSegment.fromPointer( + $ret, + retain: false, + release: true, + ); } - /// initWithCoder: SFTranscriptionSegment? initWithCoder(objc.NSCoder coder) { - final $ret = _objc_msgSend_1sotr3r(object$.ref.retainAndReturnPointer(), _sel_initWithCoder_, coder.ref.pointer); - return $ret.address == 0 ? null : SFTranscriptionSegment.fromPointer($ret, retain: false, release: true); + final $ret = _objc_msgSend_1sotr3r( + object$.ref.retainAndReturnPointer(), + _sel_initWithCoder_, + coder.ref.pointer, + ); + return $ret.address == 0 + ? null + : SFTranscriptionSegment.fromPointer( + $ret, + retain: false, + release: true, + ); } - /// substring objc.NSString get substring { - objc.checkOsVersionInternal('SFTranscriptionSegment.substring', iOS: (false, (10, 0, 0)), macOS: (false, (10, 15, 0))); + objc.checkOsVersionInternal( + 'SFTranscriptionSegment.substring', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 15, 0)), + ); final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_substring); return objc.NSString.fromPointer($ret, retain: true, release: true); } - /// substringRange objc.NSRange get substringRange { - objc.checkOsVersionInternal('SFTranscriptionSegment.substringRange', iOS: (false, (10, 0, 0)), macOS: (false, (10, 15, 0))); + objc.checkOsVersionInternal( + 'SFTranscriptionSegment.substringRange', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 15, 0)), + ); final $ptr = pkg_ffi.calloc<objc.NSRange>(); - objc.useMsgSendVariants ? _objc_msgSend_1u11dbbStret($ptr, object$.ref.pointer, _sel_substringRange) : $ptr.ref = _objc_msgSend_1u11dbb(object$.ref.pointer, _sel_substringRange); + objc.useMsgSendVariants + ? _objc_msgSend_1u11dbbStret( + $ptr, + object$.ref.pointer, + _sel_substringRange, + ) + : $ptr.ref = _objc_msgSend_1u11dbb( + object$.ref.pointer, + _sel_substringRange, + ); final $finalizable = $ptr.cast<ffi.Uint8>().asTypedList( - ffi.sizeOf<objc.NSRange>(), finalizer: pkg_ffi.calloc.nativeFree); - return ffi.Struct.create<objc.NSRange>( - $finalizable); - + ffi.sizeOf<objc.NSRange>(), + finalizer: pkg_ffi.calloc.nativeFree, + ); + return ffi.Struct.create<objc.NSRange>($finalizable); } - /// timestamp double get timestamp { - objc.checkOsVersionInternal('SFTranscriptionSegment.timestamp', iOS: (false, (10, 0, 0)), macOS: (false, (10, 15, 0))); - return objc.useMsgSendVariants ? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_timestamp) : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_timestamp); - + objc.checkOsVersionInternal( + 'SFTranscriptionSegment.timestamp', + iOS: (false, (10, 0, 0)), + macOS: (false, (10, 15, 0)), + ); + return objc.useMsgSendVariants + ? _objc_msgSend_1ukqyt8Fpret(object$.ref.pointer, _sel_timestamp) + : _objc_msgSend_1ukqyt8(object$.ref.pointer, _sel_timestamp); } - /// voiceAnalytics SFVoiceAnalytics? get voiceAnalytics { - objc.checkOsVersionInternal('SFTranscriptionSegment.voiceAnalytics', macOS: (false, (10, 15, 0))); - final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_voiceAnalytics); - return $ret.address == 0 ? null : SFVoiceAnalytics.fromPointer($ret, retain: true, release: true); + objc.checkOsVersionInternal( + 'SFTranscriptionSegment.voiceAnalytics', + macOS: (false, (10, 15, 0)), + ); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_voiceAnalytics, + ); + return $ret.address == 0 + ? null + : SFVoiceAnalytics.fromPointer($ret, retain: true, release: true); } - } - /// WARNING: SFVoiceAnalytics is a stub. To generate bindings for this class, include /// SFVoiceAnalytics in your config's objc-interfaces list. /// /// SFVoiceAnalytics -extension type SFVoiceAnalytics._(objc.ObjCObject object$) implements objc.ObjCObject,objc.NSObject,objc.NSCopying,objc.NSSecureCoding { +extension type SFVoiceAnalytics._(objc.ObjCObject object$) + implements + objc.ObjCObject, + objc.NSObject, + objc.NSCopying, + objc.NSSecureCoding { /// Constructs a [SFVoiceAnalytics] that points to the same underlying object as [other]. SFVoiceAnalytics.as(objc.ObjCObject other) : object$ = other { - objc.checkOsVersionInternal('SFVoiceAnalytics', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); + objc.checkOsVersionInternal( + 'SFVoiceAnalytics', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); } /// Constructs a [SFVoiceAnalytics] that wraps the given raw object pointer. - SFVoiceAnalytics.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { - objc.checkOsVersionInternal('SFVoiceAnalytics', iOS: (false, (13, 0, 0)), macOS: (false, (10, 15, 0))); + SFVoiceAnalytics.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { + objc.checkOsVersionInternal( + 'SFVoiceAnalytics', + iOS: (false, (13, 0, 0)), + macOS: (false, (10, 15, 0)), + ); } - - } -late final _class_SFTranscriptionSegment = objc.getClass("SFTranscriptionSegment"); -final _objc_msgSend_151sglz = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_19nvye5 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>>().asFunction<bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>(); -final _objc_msgSend_1cwp428 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.NSZone> )>>().asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.NSZone> )>(); -final _objc_msgSend_1sotr3r = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>>().asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>(); -final _objc_msgSend_1u11dbb = objc.msgSendPointer.cast<ffi.NativeFunction<objc.NSRange Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<objc.NSRange Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_1u11dbbStret = objc.msgSendStretPointer.cast<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<objc.NSRange> , ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<void Function(ffi.Pointer<objc.NSRange> , ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_1ukqyt8 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Double Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<double Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer.cast<ffi.NativeFunction<ffi.Double Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<double Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_2cgrxl = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Float Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<double Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_2cgrxlFpret = objc.msgSendFpretPointer.cast<ffi.NativeFunction<ffi.Float Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<double Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_91o635 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_xtuoz7 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>>().asFunction<void Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>(); +late final _class_SFTranscriptionSegment = objc.getClass( + "SFTranscriptionSegment", +); +final _objc_msgSend_151sglz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_19nvye5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + > + >() + .asFunction< + bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(); +final _objc_msgSend_1cwp428 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.NSZone>, + ) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.NSZone>, + ) + >(); +final _objc_msgSend_1sotr3r = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(); +final _objc_msgSend_1u11dbb = objc.msgSendPointer + .cast< + ffi.NativeFunction< + objc.NSRange Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + objc.NSRange Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_1u11dbbStret = objc.msgSendStretPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<objc.NSRange>, + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer<objc.NSRange>, + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_1ukqyt8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + double Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_1ukqyt8Fpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Double Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + double Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_2cgrxl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Float Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + double Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_2cgrxlFpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Float Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + double Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_91o635 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_xtuoz7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + > + >() + .asFunction< + void Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(); late final _sel_alloc = objc.registerName("alloc"); late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); -late final _sel_alternativeSubstrings = objc.registerName("alternativeSubstrings"); +late final _sel_alternativeSubstrings = objc.registerName( + "alternativeSubstrings", +); late final _sel_confidence = objc.registerName("confidence"); late final _sel_duration = objc.registerName("duration"); late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); @@ -432,7 +1111,9 @@ late final _sel_new = objc.registerName("new"); late final _sel_substring = objc.registerName("substring"); late final _sel_substringRange = objc.registerName("substringRange"); -late final _sel_supportsSecureCoding = objc.registerName("supportsSecureCoding"); +late final _sel_supportsSecureCoding = objc.registerName( + "supportsSecureCoding", +); late final _sel_timestamp = objc.registerName("timestamp"); late final _sel_voiceAnalytics = objc.registerName("voiceAnalytics"); typedef instancetype = ffi.Pointer<objc.ObjCObjectImpl>;
diff --git a/pkgs/ffigen/test/native_objc_test/transitive_bindings.dart b/pkgs/ffigen/test/native_objc_test/transitive_bindings.dart index 4a18348..07c7de9 100644 --- a/pkgs/ffigen/test/native_objc_test/transitive_bindings.dart +++ b/pkgs/ffigen/test/native_objc_test/transitive_bindings.dart
@@ -1,231 +1,278 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// +// // Generated by `package:ffigen`. // ignore_for_file: type=lint, unused_import 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.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>() -external int _1tiufry_protocolTrampoline_1l0nlq(ffi.Pointer<objc.ObjCObjectImpl> target, -ffi.Pointer<ffi.Void> arg0, + +@ffi.Native< + ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl>, ffi.Pointer<ffi.Void>) +>() +external int _1tiufry_protocolTrampoline_1l0nlq( + ffi.Pointer<objc.ObjCObjectImpl> target, + ffi.Pointer<ffi.Void> arg0, ); -@ffi.Native<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>() -external ffi.Pointer<objc.ObjCObjectImpl> _1tiufry_protocolTrampoline_1mbt9g9(ffi.Pointer<objc.ObjCObjectImpl> target, -ffi.Pointer<ffi.Void> arg0, +@ffi.Native< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) +>() +external ffi.Pointer<objc.ObjCObjectImpl> _1tiufry_protocolTrampoline_1mbt9g9( + ffi.Pointer<objc.ObjCObjectImpl> target, + ffi.Pointer<ffi.Void> arg0, ); - /// WARNING: AnotherSuperProtocol is a stub. To generate bindings for this class, include /// AnotherSuperProtocol in your config's objc-protocols list. /// /// AnotherSuperProtocol -extension type AnotherSuperProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { +extension type AnotherSuperProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [AnotherSuperProtocol] that points to the same underlying object as [other]. AnotherSuperProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [AnotherSuperProtocol] that wraps the given raw object pointer. - AnotherSuperProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + AnotherSuperProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// Bug2935DirectInterface -extension type Bug2935DirectInterface._(objc.ObjCObject object$) implements objc.ObjCObject { +extension type Bug2935DirectInterface._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [Bug2935DirectInterface] that points to the same underlying object as [other]. Bug2935DirectInterface.as(objc.ObjCObject other) : object$ = other { assert(isA(object$)); } /// Constructs a [Bug2935DirectInterface] that wraps the given raw object pointer. - Bug2935DirectInterface.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { + Bug2935DirectInterface.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { assert(isA(object$)); } /// Returns whether [obj] is an instance of [Bug2935DirectInterface]. - static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(obj.ref.pointer, _sel_isKindOfClass_, _class_Bug2935DirectInterface); - + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_Bug2935DirectInterface, + ); } extension Bug2935DirectInterface$Methods on Bug2935DirectInterface { - /// bug2935DirectInterfaceMethod Bug2935TransitiveInterface bug2935DirectInterfaceMethod() { - final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_bug2935DirectInterfaceMethod); - return Bug2935TransitiveInterface.fromPointer($ret, retain: true, release: true); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_bug2935DirectInterfaceMethod, + ); + return Bug2935TransitiveInterface.fromPointer( + $ret, + retain: true, + release: true, + ); } - } - /// WARNING: Bug2935TransitiveInterface is a stub. To generate bindings for this class, include /// Bug2935TransitiveInterface in your config's objc-interfaces list. /// /// Bug2935TransitiveInterface -extension type Bug2935TransitiveInterface._(objc.ObjCObject object$) implements objc.ObjCObject,Bug2935TransitiveProtocol { +extension type Bug2935TransitiveInterface._(objc.ObjCObject object$) + implements objc.ObjCObject, Bug2935TransitiveProtocol { /// Constructs a [Bug2935TransitiveInterface] that points to the same underlying object as [other]. - Bug2935TransitiveInterface.as(objc.ObjCObject other) : object$ = other { - - } + Bug2935TransitiveInterface.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [Bug2935TransitiveInterface] that wraps the given raw object pointer. - Bug2935TransitiveInterface.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { - - } - - + Bug2935TransitiveInterface.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } - /// WARNING: Bug2935TransitiveProtocol is a stub. To generate bindings for this class, include /// Bug2935TransitiveProtocol in your config's objc-protocols list. /// /// Bug2935TransitiveProtocol -extension type Bug2935TransitiveProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { +extension type Bug2935TransitiveProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [Bug2935TransitiveProtocol] that points to the same underlying object as [other]. Bug2935TransitiveProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [Bug2935TransitiveProtocol] that wraps the given raw object pointer. - Bug2935TransitiveProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + Bug2935TransitiveProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// DirectlyIncluded -extension type DirectlyIncluded._(objc.ObjCObject object$) implements objc.ObjCObject,SuperType { +extension type DirectlyIncluded._(objc.ObjCObject object$) + implements objc.ObjCObject, SuperType { /// Constructs a [DirectlyIncluded] that points to the same underlying object as [other]. DirectlyIncluded.as(objc.ObjCObject other) : object$ = other { assert(isA(object$)); } /// Constructs a [DirectlyIncluded] that wraps the given raw object pointer. - DirectlyIncluded.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { + DirectlyIncluded.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { assert(isA(object$)); } /// Returns whether [obj] is an instance of [DirectlyIncluded]. - static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(obj.ref.pointer, _sel_isKindOfClass_, _class_DirectlyIncluded); - + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_DirectlyIncluded, + ); } extension DirectlyIncluded$Methods on DirectlyIncluded { - /// directMethod Transitive directMethod() { final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_directMethod); return Transitive.fromPointer($ret, retain: true, release: true); } - } - /// DirectlyIncludedCategory extension DirectlyIncludedCategory on IntOfDirectCat { - /// directlyIncludedCategoryMethod TransitiveIntOfDirectCat directlyIncludedCategoryMethod() { - final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_directlyIncludedCategoryMethod); - return TransitiveIntOfDirectCat.fromPointer($ret, retain: true, release: true); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_directlyIncludedCategoryMethod, + ); + return TransitiveIntOfDirectCat.fromPointer( + $ret, + retain: true, + release: true, + ); } - /// transitiveProtOfDirectCatMethod int transitiveProtOfDirectCatMethod() { - return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_transitiveProtOfDirectCatMethod); - + return _objc_msgSend_13yqbb6( + object$.ref.pointer, + _sel_transitiveProtOfDirectCatMethod, + ); } - } - /// DirectlyIncludedIntForCat -extension type DirectlyIncludedIntForCat._(objc.ObjCObject object$) implements objc.ObjCObject { +extension type DirectlyIncludedIntForCat._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [DirectlyIncludedIntForCat] that points to the same underlying object as [other]. DirectlyIncludedIntForCat.as(objc.ObjCObject other) : object$ = other { assert(isA(object$)); } /// Constructs a [DirectlyIncludedIntForCat] that wraps the given raw object pointer. - DirectlyIncludedIntForCat.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { + DirectlyIncludedIntForCat.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { assert(isA(object$)); } /// Returns whether [obj] is an instance of [DirectlyIncludedIntForCat]. - static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(obj.ref.pointer, _sel_isKindOfClass_, _class_DirectlyIncludedIntForCat); - + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_DirectlyIncludedIntForCat, + ); } extension DirectlyIncludedIntForCat$Methods on DirectlyIncludedIntForCat { - /// directlyIncludedIntForCatMethod int directlyIncludedIntForCatMethod() { - return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_directlyIncludedIntForCatMethod); - + return _objc_msgSend_13yqbb6( + object$.ref.pointer, + _sel_directlyIncludedIntForCatMethod, + ); } - } - /// DirectlyIncludedProtocol -extension type DirectlyIncludedProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol, SuperProtocol, AnotherSuperProtocol { +extension type DirectlyIncludedProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, SuperProtocol, AnotherSuperProtocol { /// Constructs a [DirectlyIncludedProtocol] that points to the same underlying object as [other]. DirectlyIncludedProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [DirectlyIncludedProtocol] that wraps the given raw object pointer. - DirectlyIncludedProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + DirectlyIncludedProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); /// Returns whether [obj] is an instance of [DirectlyIncludedProtocol]. static bool conformsTo(objc.ObjCObject obj) { - return _objc_msgSend_e3qsqz(obj.ref.pointer, _sel_conformsToProtocol_, _protocol_DirectlyIncludedProtocol); + return _objc_msgSend_e3qsqz( + obj.ref.pointer, + _sel_conformsToProtocol_, + _protocol_DirectlyIncludedProtocol, + ); } } extension DirectlyIncludedProtocol$Methods on DirectlyIncludedProtocol { - /// anotherSuperProtoMethod int anotherSuperProtoMethod() { - return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_anotherSuperProtoMethod); - + return _objc_msgSend_13yqbb6( + object$.ref.pointer, + _sel_anotherSuperProtoMethod, + ); } - /// directProtoMethod TransitiveProtocol directProtoMethod() { - final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_directProtoMethod); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_directProtoMethod, + ); return TransitiveProtocol.fromPointer($ret, retain: true, release: true); } - /// superProtoMethod SuperTransitiveProtocol superProtoMethod() { - final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_superProtoMethod); - return SuperTransitiveProtocol.fromPointer($ret, retain: true, release: true); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_superProtoMethod, + ); + return SuperTransitiveProtocol.fromPointer( + $ret, + retain: true, + release: true, + ); } - /// superSuperProtoMethod int superSuperProtoMethod() { - return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_superSuperProtoMethod); - + return _objc_msgSend_13yqbb6( + object$.ref.pointer, + _sel_superSuperProtoMethod, + ); } - } - interface class DirectlyIncludedProtocol$Builder { - - /// Returns the [objc.Protocol] object for this protocol. +interface class DirectlyIncludedProtocol$Builder { + /// Returns the [objc.Protocol] object for this protocol. static objc.Protocol get $protocol => objc.Protocol.fromPointer(_protocol_DirectlyIncludedProtocol.cast()); @@ -234,155 +281,265 @@ /// /// If `$keepIsolateAlive` is true, this protocol will keep this isolate /// alive until it is garbage collected by both Dart and ObjC. - static DirectlyIncludedProtocol implement({required int Function() anotherSuperProtoMethod, required TransitiveProtocol Function() directProtoMethod, required SuperTransitiveProtocol Function() superProtoMethod, required int Function() superSuperProtoMethod, bool $keepIsolateAlive = true}) { - final builder = objc.ObjCProtocolBuilder(debugName: 'DirectlyIncludedProtocol'); - DirectlyIncludedProtocol$Builder.anotherSuperProtoMethod.implement(builder, anotherSuperProtoMethod); DirectlyIncludedProtocol$Builder.directProtoMethod.implement(builder, directProtoMethod); DirectlyIncludedProtocol$Builder.superProtoMethod.implement(builder, superProtoMethod); DirectlyIncludedProtocol$Builder.superSuperProtoMethod.implement(builder, superSuperProtoMethod); + static DirectlyIncludedProtocol implement({ + required int Function() anotherSuperProtoMethod, + required TransitiveProtocol Function() directProtoMethod, + required SuperTransitiveProtocol Function() superProtoMethod, + required int Function() superSuperProtoMethod, + bool $keepIsolateAlive = true, + }) { + final builder = objc.ObjCProtocolBuilder( + debugName: 'DirectlyIncludedProtocol', + ); + DirectlyIncludedProtocol$Builder.anotherSuperProtoMethod.implement( + builder, + anotherSuperProtoMethod, + ); + DirectlyIncludedProtocol$Builder.directProtoMethod.implement( + builder, + directProtoMethod, + ); + DirectlyIncludedProtocol$Builder.superProtoMethod.implement( + builder, + superProtoMethod, + ); + DirectlyIncludedProtocol$Builder.superSuperProtoMethod.implement( + builder, + superSuperProtoMethod, + ); builder.addProtocol($protocol); - return DirectlyIncludedProtocol.as(builder.build(keepIsolateAlive: $keepIsolateAlive)); + return DirectlyIncludedProtocol.as( + builder.build(keepIsolateAlive: $keepIsolateAlive), + ); } /// Adds the implementation of the DirectlyIncludedProtocol protocol to an existing /// [objc.ObjCProtocolBuilder]. /// /// Note: You cannot call this method after you have called `builder.build`. - static void addToBuilder(objc.ObjCProtocolBuilder builder, {required int Function() anotherSuperProtoMethod, required TransitiveProtocol Function() directProtoMethod, required SuperTransitiveProtocol Function() superProtoMethod, required int Function() superSuperProtoMethod, bool $keepIsolateAlive = true}) { - DirectlyIncludedProtocol$Builder.anotherSuperProtoMethod.implement(builder, anotherSuperProtoMethod); DirectlyIncludedProtocol$Builder.directProtoMethod.implement(builder, directProtoMethod); DirectlyIncludedProtocol$Builder.superProtoMethod.implement(builder, superProtoMethod); DirectlyIncludedProtocol$Builder.superSuperProtoMethod.implement(builder, superSuperProtoMethod); + static void addToBuilder( + objc.ObjCProtocolBuilder builder, { + required int Function() anotherSuperProtoMethod, + required TransitiveProtocol Function() directProtoMethod, + required SuperTransitiveProtocol Function() superProtoMethod, + required int Function() superSuperProtoMethod, + bool $keepIsolateAlive = true, + }) { + DirectlyIncludedProtocol$Builder.anotherSuperProtoMethod.implement( + builder, + anotherSuperProtoMethod, + ); + DirectlyIncludedProtocol$Builder.directProtoMethod.implement( + builder, + directProtoMethod, + ); + DirectlyIncludedProtocol$Builder.superProtoMethod.implement( + builder, + superProtoMethod, + ); + DirectlyIncludedProtocol$Builder.superSuperProtoMethod.implement( + builder, + superSuperProtoMethod, + ); builder.addProtocol($protocol); } - /// anotherSuperProtoMethod -static final anotherSuperProtoMethod = objc.ObjCProtocolMethod<int Function()>( - _protocol_DirectlyIncludedProtocol, - _sel_anotherSuperProtoMethod, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1tiufry_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( + static final anotherSuperProtoMethod = + objc.ObjCProtocolMethod<int Function()>( + _protocol_DirectlyIncludedProtocol, + _sel_anotherSuperProtoMethod, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1tiufry_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DirectlyIncludedProtocol, _sel_anotherSuperProtoMethod, isRequired: true, isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// directProtoMethod -static final directProtoMethod = objc.ObjCProtocolMethod<TransitiveProtocol Function()>( - _protocol_DirectlyIncludedProtocol, - _sel_directProtoMethod, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1tiufry_protocolTrampoline_1mbt9g9).cast(), - objc.getProtocolMethodSignature( + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// directProtoMethod + static final directProtoMethod = + objc.ObjCProtocolMethod<TransitiveProtocol Function()>( + _protocol_DirectlyIncludedProtocol, + _sel_directProtoMethod, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1tiufry_protocolTrampoline_1mbt9g9) + .cast(), + objc.getProtocolMethodSignature( _protocol_DirectlyIncludedProtocol, _sel_directProtoMethod, isRequired: true, isInstanceMethod: true, - ), - (TransitiveProtocol Function() func) => ObjCBlock_idTransitiveProtocol_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// superProtoMethod -static final superProtoMethod = objc.ObjCProtocolMethod<SuperTransitiveProtocol Function()>( - _protocol_DirectlyIncludedProtocol, - _sel_superProtoMethod, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1tiufry_protocolTrampoline_1mbt9g9).cast(), - objc.getProtocolMethodSignature( + ), + (TransitiveProtocol Function() func) => + ObjCBlock_idTransitiveProtocol_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// superProtoMethod + static final superProtoMethod = + objc.ObjCProtocolMethod<SuperTransitiveProtocol Function()>( + _protocol_DirectlyIncludedProtocol, + _sel_superProtoMethod, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1tiufry_protocolTrampoline_1mbt9g9) + .cast(), + objc.getProtocolMethodSignature( _protocol_DirectlyIncludedProtocol, _sel_superProtoMethod, isRequired: true, isInstanceMethod: true, - ), - (SuperTransitiveProtocol Function() func) => ObjCBlock_idSuperTransitiveProtocol_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); -/// superSuperProtoMethod -static final superSuperProtoMethod = objc.ObjCProtocolMethod<int Function()>( + ), + (SuperTransitiveProtocol Function() func) => + ObjCBlock_idSuperTransitiveProtocol_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); + + /// superSuperProtoMethod + static final superSuperProtoMethod = objc.ObjCProtocolMethod<int Function()>( + _protocol_DirectlyIncludedProtocol, + _sel_superSuperProtoMethod, + ffi.Native.addressOf< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<ffi.Void>, + ) + > + >(_1tiufry_protocolTrampoline_1l0nlq) + .cast(), + objc.getProtocolMethodSignature( _protocol_DirectlyIncludedProtocol, _sel_superSuperProtoMethod, - ffi.Native.addressOf<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<ffi.Void> )>>(_1tiufry_protocolTrampoline_1l0nlq).cast(), - objc.getProtocolMethodSignature( - _protocol_DirectlyIncludedProtocol, - _sel_superSuperProtoMethod, - isRequired: true, - isInstanceMethod: true, - ), - (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction((ffi.Pointer<ffi.Void> _, ) => func()), - - ); - + isRequired: true, + isInstanceMethod: true, + ), + (int Function() func) => ObjCBlock_ffiInt_ffiVoid.fromFunction( + (ffi.Pointer<ffi.Void> _) => func(), + ), + ); } /// DirectlyIncludedWithProtocol -extension type DirectlyIncludedWithProtocol._(objc.ObjCObject object$) implements objc.ObjCObject,SuperFromInterfaceProtocol { +extension type DirectlyIncludedWithProtocol._(objc.ObjCObject object$) + implements objc.ObjCObject, SuperFromInterfaceProtocol { /// Constructs a [DirectlyIncludedWithProtocol] that points to the same underlying object as [other]. DirectlyIncludedWithProtocol.as(objc.ObjCObject other) : object$ = other { assert(isA(object$)); } /// Constructs a [DirectlyIncludedWithProtocol] that wraps the given raw object pointer. - DirectlyIncludedWithProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { + DirectlyIncludedWithProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { assert(isA(object$)); } /// Returns whether [obj] is an instance of [DirectlyIncludedWithProtocol]. - static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(obj.ref.pointer, _sel_isKindOfClass_, _class_DirectlyIncludedWithProtocol); - + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_DirectlyIncludedWithProtocol, + ); } extension DirectlyIncludedWithProtocol$Methods on DirectlyIncludedWithProtocol { - /// directlyIncludedWithProtoMethod TransitiveFromInterfaceProtocol directlyIncludedWithProtoMethod() { - final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_directlyIncludedWithProtoMethod); - return TransitiveFromInterfaceProtocol.fromPointer($ret, retain: true, release: true); + final $ret = _objc_msgSend_151sglz( + object$.ref.pointer, + _sel_directlyIncludedWithProtoMethod, + ); + return TransitiveFromInterfaceProtocol.fromPointer( + $ret, + retain: true, + release: true, + ); } - /// superFromInterfaceProtoMethod int superFromInterfaceProtoMethod() { - return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_superFromInterfaceProtoMethod); - + return _objc_msgSend_13yqbb6( + object$.ref.pointer, + _sel_superFromInterfaceProtoMethod, + ); } - } - /// WARNING: IntOfDirectCat is a stub. To generate bindings for this class, include /// IntOfDirectCat in your config's objc-interfaces list. /// /// IntOfDirectCat -extension type IntOfDirectCat._(objc.ObjCObject object$) implements objc.ObjCObject { +extension type IntOfDirectCat._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [IntOfDirectCat] that points to the same underlying object as [other]. - IntOfDirectCat.as(objc.ObjCObject other) : object$ = other { - - } + IntOfDirectCat.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [IntOfDirectCat] that wraps the given raw object pointer. - IntOfDirectCat.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { - - } - - + IntOfDirectCat.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } - /// Construction methods for `objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>`. abstract final class ObjCBlock_ffiInt_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> fromPointer(ffi.Pointer<objc.ObjCBlockImpl> pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>(pointer, retain: retain, release: release); + static objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> fromPointer( + ffi.Pointer<objc.ObjCBlockImpl> pointer, { + bool retain = false, + bool release = false, + }) => objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>( + 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.Int Function(ffi.Pointer<ffi.Void>)> fromFunctionPointer(ffi.Pointer<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ffi.Void> arg0)>> ptr) => - objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>(objc.newPointerBlock(_fnPtrCallable, ptr.cast()), - retain: false, release: true); + static objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ffi.Void> arg0)> + > + ptr, + ) => objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -392,47 +549,104 @@ /// /// 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.Int Function(ffi.Pointer<ffi.Void>)> fromFunction(int Function(ffi.Pointer<ffi.Void> ) fn, - {bool keepIsolateAlive = true}) => - objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>(objc.newClosureBlock(_closureCallable, (ffi.Pointer<ffi.Void> arg0) => fn(arg0), keepIsolateAlive), - retain: false, release: true); + static objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> fromFunction( + int Function(ffi.Pointer<ffi.Void>) fn, { + bool keepIsolateAlive = true, + }) => objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer<ffi.Void> arg0) => fn(arg0), + keepIsolateAlive, + ), + retain: false, + release: true, + ); static int _fnPtrTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - block.ref.target.cast<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<int Function(ffi.Pointer<ffi.Void> )>()(arg0); - static ffi.Pointer<ffi.Void> _fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Int Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_fnPtrTrampoline , 0).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => block.ref.target + .cast<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<ffi.Void> arg0)>>() + .asFunction<int Function(ffi.Pointer<ffi.Void>)>()(arg0); + static ffi.Pointer<ffi.Void> _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_fnPtrTrampoline, 0) + .cast(); static int _closureTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - (objc.getBlockClosure(block) as int Function(ffi.Pointer<ffi.Void> ))(arg0); - static ffi.Pointer<ffi.Void> _closureCallable = ffi.Pointer.fromFunction< - ffi.Int Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_closureTrampoline , 0).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => (objc.getBlockClosure(block) as int Function(ffi.Pointer<ffi.Void>))( + arg0, + ); + static ffi.Pointer<ffi.Void> _closureCallable = + ffi.Pointer.fromFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_closureTrampoline, 0) + .cast(); } /// Call operator for `objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)>`. -extension ObjCBlock_ffiInt_ffiVoid$CallExtension on objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> { - int call(ffi.Pointer<ffi.Void> arg0) =>ref.pointer.ref.invoke.cast<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<int Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>()( - ref.pointer, arg0); +extension ObjCBlock_ffiInt_ffiVoid$CallExtension + on objc.ObjCBlock<ffi.Int Function(ffi.Pointer<ffi.Void>)> { + int call(ffi.Pointer<ffi.Void> arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) + > + >() + .asFunction< + int Function(ffi.Pointer<objc.ObjCBlockImpl>, ffi.Pointer<ffi.Void>) + >()(ref.pointer, arg0); } - /// Construction methods for `objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>`. abstract final class ObjCBlock_idSuperTransitiveProtocol_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)> fromPointer(ffi.Pointer<objc.ObjCBlockImpl> pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>(pointer, retain: retain, release: release); + static objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + > + fromPointer( + ffi.Pointer<objc.ObjCBlockImpl> pointer, { + bool retain = false, + bool release = false, + }) => + objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + >(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<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)> fromFunctionPointer(ffi.Pointer<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> arg0)>> ptr) => - objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>(objc.newPointerBlock(_fnPtrCallable, ptr.cast()), - retain: false, release: true); + static objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + > + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> arg0) + > + > + ptr, + ) => + objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + >( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -442,47 +656,129 @@ /// /// 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<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)> fromFunction(SuperTransitiveProtocol Function(ffi.Pointer<ffi.Void> ) fn, - {bool keepIsolateAlive = true}) => - objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>(objc.newClosureBlock(_closureCallable, (ffi.Pointer<ffi.Void> arg0) => fn(arg0).ref.retainAndAutorelease(), keepIsolateAlive), - retain: false, release: true); + static objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + > + fromFunction( + SuperTransitiveProtocol Function(ffi.Pointer<ffi.Void>) fn, { + bool keepIsolateAlive = true, + }) => + objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + >( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer<ffi.Void> arg0) => fn(arg0).ref.retainAndAutorelease(), + keepIsolateAlive, + ), + retain: false, + release: true, + ); static ffi.Pointer<objc.ObjCObjectImpl> _fnPtrTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - block.ref.target.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> )>()(arg0); - static ffi.Pointer<ffi.Void> _fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_fnPtrTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> arg0) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + >()(arg0); + static ffi.Pointer<ffi.Void> _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_fnPtrTrampoline) + .cast(); static ffi.Pointer<objc.ObjCObjectImpl> _closureTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - (objc.getBlockClosure(block) as ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> ))(arg0); - static ffi.Pointer<ffi.Void> _closureCallable = ffi.Pointer.fromFunction< - ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_closureTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => + (objc.getBlockClosure(block) + as ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>))( + arg0, + ); + static ffi.Pointer<ffi.Void> _closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>`. -extension ObjCBlock_idSuperTransitiveProtocol_ffiVoid$CallExtension on objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)> { - SuperTransitiveProtocol call(ffi.Pointer<ffi.Void> arg0) =>SuperTransitiveProtocol.fromPointer(ref.pointer.ref.invoke.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>()( - ref.pointer, arg0), retain: true, release: true); +extension ObjCBlock_idSuperTransitiveProtocol_ffiVoid$CallExtension + on + objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + > { + SuperTransitiveProtocol call(ffi.Pointer<ffi.Void> arg0) => + SuperTransitiveProtocol.fromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >()(ref.pointer, arg0), + retain: true, + release: true, + ); } - /// Construction methods for `objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>`. abstract final class ObjCBlock_idTransitiveProtocol_ffiVoid { /// Returns a block that wraps the given raw block pointer. - static objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)> fromPointer(ffi.Pointer<objc.ObjCBlockImpl> pointer, - {bool retain = false, bool release = false}) => - objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>(pointer, retain: retain, release: release); + static objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + > + fromPointer( + ffi.Pointer<objc.ObjCBlockImpl> pointer, { + bool retain = false, + bool release = false, + }) => + objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + >(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<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)> fromFunctionPointer(ffi.Pointer<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> arg0)>> ptr) => - objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>(objc.newPointerBlock(_fnPtrCallable, ptr.cast()), - retain: false, release: true); + static objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + > + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> arg0) + > + > + ptr, + ) => + objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + >( + objc.newPointerBlock(_fnPtrCallable, ptr.cast()), + retain: false, + release: true, + ); /// Creates a block from a Dart function. /// @@ -492,319 +788,468 @@ /// /// 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<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)> fromFunction(TransitiveProtocol Function(ffi.Pointer<ffi.Void> ) fn, - {bool keepIsolateAlive = true}) => - objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>(objc.newClosureBlock(_closureCallable, (ffi.Pointer<ffi.Void> arg0) => fn(arg0).ref.retainAndAutorelease(), keepIsolateAlive), - retain: false, release: true); + static objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + > + fromFunction( + TransitiveProtocol Function(ffi.Pointer<ffi.Void>) fn, { + bool keepIsolateAlive = true, + }) => + objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + >( + objc.newClosureBlock( + _closureCallable, + (ffi.Pointer<ffi.Void> arg0) => fn(arg0).ref.retainAndAutorelease(), + keepIsolateAlive, + ), + retain: false, + release: true, + ); static ffi.Pointer<objc.ObjCObjectImpl> _fnPtrTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - block.ref.target.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> )>()(arg0); - static ffi.Pointer<ffi.Void> _fnPtrCallable = ffi.Pointer.fromFunction< - ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_fnPtrTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> arg0) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + >()(arg0); + static ffi.Pointer<ffi.Void> _fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_fnPtrTrampoline) + .cast(); static ffi.Pointer<objc.ObjCObjectImpl> _closureTrampoline( - ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0) => - (objc.getBlockClosure(block) as ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void> ))(arg0); - static ffi.Pointer<ffi.Void> _closureCallable = ffi.Pointer.fromFunction< - ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>(_closureTrampoline ).cast(); + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) => + (objc.getBlockClosure(block) + as ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>))( + arg0, + ); + static ffi.Pointer<ffi.Void> _closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >(_closureTrampoline) + .cast(); } /// Call operator for `objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)>`. -extension ObjCBlock_idTransitiveProtocol_ffiVoid$CallExtension on objc.ObjCBlock<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>)> { - TransitiveProtocol call(ffi.Pointer<ffi.Void> arg0) =>TransitiveProtocol.fromPointer(ref.pointer.ref.invoke.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> block, ffi.Pointer<ffi.Void> arg0)>>() - .asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCBlockImpl> , ffi.Pointer<ffi.Void> )>()( - ref.pointer, arg0), retain: true, release: true); +extension ObjCBlock_idTransitiveProtocol_ffiVoid$CallExtension + on + objc.ObjCBlock< + ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<ffi.Void>) + > { + TransitiveProtocol call(ffi.Pointer<ffi.Void> arg0) => + TransitiveProtocol.fromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl> block, + ffi.Pointer<ffi.Void> arg0, + ) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCBlockImpl>, + ffi.Pointer<ffi.Void>, + ) + >()(ref.pointer, arg0), + retain: true, + release: true, + ); } - /// WARNING: SuperFromInterfaceProtocol is a stub. To generate bindings for this class, include /// SuperFromInterfaceProtocol in your config's objc-protocols list. /// /// SuperFromInterfaceProtocol -extension type SuperFromInterfaceProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { +extension type SuperFromInterfaceProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [SuperFromInterfaceProtocol] that points to the same underlying object as [other]. SuperFromInterfaceProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [SuperFromInterfaceProtocol] that wraps the given raw object pointer. - SuperFromInterfaceProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + SuperFromInterfaceProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// WARNING: SuperProtocol is a stub. To generate bindings for this class, include /// SuperProtocol in your config's objc-protocols list. /// /// SuperProtocol -extension type SuperProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol, SuperSuperProtocol { +extension type SuperProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, SuperSuperProtocol { /// Constructs a [SuperProtocol] that points to the same underlying object as [other]. SuperProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [SuperProtocol] that wraps the given raw object pointer. - SuperProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + SuperProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// WARNING: SuperSuperProtocol is a stub. To generate bindings for this class, include /// SuperSuperProtocol in your config's objc-protocols list. /// /// SuperSuperProtocol -extension type SuperSuperProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { +extension type SuperSuperProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [SuperSuperProtocol] that points to the same underlying object as [other]. SuperSuperProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [SuperSuperProtocol] that wraps the given raw object pointer. - SuperSuperProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + SuperSuperProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// SuperSuperType -extension type SuperSuperType._(objc.ObjCObject object$) implements objc.ObjCObject { +extension type SuperSuperType._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [SuperSuperType] that points to the same underlying object as [other]. SuperSuperType.as(objc.ObjCObject other) : object$ = other { assert(isA(object$)); } /// Constructs a [SuperSuperType] that wraps the given raw object pointer. - SuperSuperType.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { + SuperSuperType.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { assert(isA(object$)); } /// Returns whether [obj] is an instance of [SuperSuperType]. - static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(obj.ref.pointer, _sel_isKindOfClass_, _class_SuperSuperType); - + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_SuperSuperType, + ); } extension SuperSuperType$Methods on SuperSuperType { - /// superSuperMethod int superSuperMethod() { return _objc_msgSend_13yqbb6(object$.ref.pointer, _sel_superSuperMethod); - } - } - /// WARNING: SuperTransitive is a stub. To generate bindings for this class, include /// SuperTransitive in your config's objc-interfaces list. /// /// SuperTransitive -extension type SuperTransitive._(objc.ObjCObject object$) implements objc.ObjCObject { +extension type SuperTransitive._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [SuperTransitive] that points to the same underlying object as [other]. - SuperTransitive.as(objc.ObjCObject other) : object$ = other { - - } + SuperTransitive.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [SuperTransitive] that wraps the given raw object pointer. - SuperTransitive.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { - - } - - + SuperTransitive.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } - /// WARNING: SuperTransitiveProtocol is a stub. To generate bindings for this class, include /// SuperTransitiveProtocol in your config's objc-protocols list. /// /// SuperTransitiveProtocol -extension type SuperTransitiveProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { +extension type SuperTransitiveProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [SuperTransitiveProtocol] that points to the same underlying object as [other]. SuperTransitiveProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [SuperTransitiveProtocol] that wraps the given raw object pointer. - SuperTransitiveProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + SuperTransitiveProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// SuperType -extension type SuperType._(objc.ObjCObject object$) implements objc.ObjCObject,SuperSuperType { +extension type SuperType._(objc.ObjCObject object$) + implements objc.ObjCObject, SuperSuperType { /// Constructs a [SuperType] that points to the same underlying object as [other]. SuperType.as(objc.ObjCObject other) : object$ = other { assert(isA(object$)); } /// Constructs a [SuperType] that wraps the given raw object pointer. - SuperType.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { + SuperType.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) { assert(isA(object$)); } /// Returns whether [obj] is an instance of [SuperType]. - static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5(obj.ref.pointer, _sel_isKindOfClass_, _class_SuperType); - + static bool isA(objc.ObjCObject obj) => _objc_msgSend_19nvye5( + obj.ref.pointer, + _sel_isKindOfClass_, + _class_SuperType, + ); } extension SuperType$Methods on SuperType { - /// superMethod SuperTransitive superMethod() { final $ret = _objc_msgSend_151sglz(object$.ref.pointer, _sel_superMethod); return SuperTransitive.fromPointer($ret, retain: true, release: true); } - } - /// WARNING: Transitive is a stub. To generate bindings for this class, include /// Transitive in your config's objc-interfaces list. /// /// Transitive -extension type Transitive._(objc.ObjCObject object$) implements objc.ObjCObject,TransitiveSuper { +extension type Transitive._(objc.ObjCObject object$) + implements objc.ObjCObject, TransitiveSuper { /// Constructs a [Transitive] that points to the same underlying object as [other]. - Transitive.as(objc.ObjCObject other) : object$ = other { - - } + Transitive.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [Transitive] that wraps the given raw object pointer. - Transitive.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { - - } - - + Transitive.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } - /// WARNING: TransitiveFromInterfaceProtocol is a stub. To generate bindings for this class, include /// TransitiveFromInterfaceProtocol in your config's objc-protocols list. /// /// TransitiveFromInterfaceProtocol -extension type TransitiveFromInterfaceProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { +extension type TransitiveFromInterfaceProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [TransitiveFromInterfaceProtocol] that points to the same underlying object as [other]. TransitiveFromInterfaceProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [TransitiveFromInterfaceProtocol] that wraps the given raw object pointer. - TransitiveFromInterfaceProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + TransitiveFromInterfaceProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// WARNING: TransitiveIntOfDirectCat is a stub. To generate bindings for this class, include /// TransitiveIntOfDirectCat in your config's objc-interfaces list. /// /// TransitiveIntOfDirectCat -extension type TransitiveIntOfDirectCat._(objc.ObjCObject object$) implements objc.ObjCObject { +extension type TransitiveIntOfDirectCat._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [TransitiveIntOfDirectCat] that points to the same underlying object as [other]. - TransitiveIntOfDirectCat.as(objc.ObjCObject other) : object$ = other { - - } + TransitiveIntOfDirectCat.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [TransitiveIntOfDirectCat] that wraps the given raw object pointer. - TransitiveIntOfDirectCat.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { - - } - - + TransitiveIntOfDirectCat.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } - /// WARNING: TransitiveProtOfDirectCat is a stub. To generate bindings for this class, include /// TransitiveProtOfDirectCat in your config's objc-protocols list. /// /// TransitiveProtOfDirectCat -extension type TransitiveProtOfDirectCat._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { +extension type TransitiveProtOfDirectCat._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [TransitiveProtOfDirectCat] that points to the same underlying object as [other]. TransitiveProtOfDirectCat.as(objc.ObjCObject other) : object$ = other; /// Constructs a [TransitiveProtOfDirectCat] that wraps the given raw object pointer. - TransitiveProtOfDirectCat.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + TransitiveProtOfDirectCat.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// WARNING: TransitiveProtocol is a stub. To generate bindings for this class, include /// TransitiveProtocol in your config's objc-protocols list. /// /// TransitiveProtocol -extension type TransitiveProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol, TransitiveSuperProtocol { +extension type TransitiveProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol, TransitiveSuperProtocol { /// Constructs a [TransitiveProtocol] that points to the same underlying object as [other]. TransitiveProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [TransitiveProtocol] that wraps the given raw object pointer. - TransitiveProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + TransitiveProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } - /// WARNING: TransitiveSuper is a stub. To generate bindings for this class, include /// TransitiveSuper in your config's objc-interfaces list. /// /// TransitiveSuper -extension type TransitiveSuper._(objc.ObjCObject object$) implements objc.ObjCObject { +extension type TransitiveSuper._(objc.ObjCObject object$) + implements objc.ObjCObject { /// Constructs a [TransitiveSuper] that points to the same underlying object as [other]. - TransitiveSuper.as(objc.ObjCObject other) : object$ = other { - - } + TransitiveSuper.as(objc.ObjCObject other) : object$ = other {} /// Constructs a [TransitiveSuper] that wraps the given raw object pointer. - TransitiveSuper.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCObject(other, retain: retain, release: release) { - - } - - + TransitiveSuper.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCObject(other, retain: retain, release: release) {} } - /// WARNING: TransitiveSuperProtocol is a stub. To generate bindings for this class, include /// TransitiveSuperProtocol in your config's objc-protocols list. /// /// TransitiveSuperProtocol -extension type TransitiveSuperProtocol._(objc.ObjCProtocol object$) implements objc.ObjCProtocol { +extension type TransitiveSuperProtocol._(objc.ObjCProtocol object$) + implements objc.ObjCProtocol { /// Constructs a [TransitiveSuperProtocol] that points to the same underlying object as [other]. TransitiveSuperProtocol.as(objc.ObjCObject other) : object$ = other; /// Constructs a [TransitiveSuperProtocol] that wraps the given raw object pointer. - TransitiveSuperProtocol.fromPointer(ffi.Pointer<objc.ObjCObjectImpl> other, - {bool retain = false, bool release = false}) : - object$ = objc.ObjCProtocol(other, retain: retain, release: release); + TransitiveSuperProtocol.fromPointer( + ffi.Pointer<objc.ObjCObjectImpl> other, { + bool retain = false, + bool release = false, + }) : object$ = objc.ObjCProtocol(other, retain: retain, release: release); } -late final _class_Bug2935DirectInterface = objc.getClass("Bug2935DirectInterface"); +late final _class_Bug2935DirectInterface = objc.getClass( + "Bug2935DirectInterface", +); late final _class_DirectlyIncluded = objc.getClass("DirectlyIncluded"); -late final _class_DirectlyIncludedIntForCat = objc.getClass("DirectlyIncludedIntForCat"); -late final _class_DirectlyIncludedWithProtocol = objc.getClass("DirectlyIncludedWithProtocol"); +late final _class_DirectlyIncludedIntForCat = objc.getClass( + "DirectlyIncludedIntForCat", +); +late final _class_DirectlyIncludedWithProtocol = objc.getClass( + "DirectlyIncludedWithProtocol", +); late final _class_IntOfDirectCat = objc.getClass("IntOfDirectCat"); late final _class_SuperSuperType = objc.getClass("SuperSuperType"); late final _class_SuperType = objc.getClass("SuperType"); -final _objc_msgSend_13yqbb6 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<int Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_151sglz = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>>().asFunction<ffi.Pointer<objc.ObjCObjectImpl> Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> )>(); -final _objc_msgSend_19nvye5 = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>>().asFunction<bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCObjectImpl> )>(); -final _objc_msgSend_e3qsqz = objc.msgSendPointer.cast<ffi.NativeFunction<ffi.Bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCProtocolImpl> )>>().asFunction<bool Function(ffi.Pointer<objc.ObjCObjectImpl> , ffi.Pointer<objc.ObjCSelector> , ffi.Pointer<objc.ObjCProtocolImpl> )>(); -late final _protocol_DirectlyIncludedProtocol = objc.getProtocol("DirectlyIncludedProtocol"); -late final _sel_anotherSuperProtoMethod = objc.registerName("anotherSuperProtoMethod"); -late final _sel_bug2935DirectInterfaceMethod = objc.registerName("bug2935DirectInterfaceMethod"); +final _objc_msgSend_13yqbb6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + int Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_151sglz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + > + >() + .asFunction< + ffi.Pointer<objc.ObjCObjectImpl> Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ) + >(); +final _objc_msgSend_19nvye5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + > + >() + .asFunction< + bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCObjectImpl>, + ) + >(); +final _objc_msgSend_e3qsqz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCProtocolImpl>, + ) + > + >() + .asFunction< + bool Function( + ffi.Pointer<objc.ObjCObjectImpl>, + ffi.Pointer<objc.ObjCSelector>, + ffi.Pointer<objc.ObjCProtocolImpl>, + ) + >(); +late final _protocol_DirectlyIncludedProtocol = objc.getProtocol( + "DirectlyIncludedProtocol", +); +late final _sel_anotherSuperProtoMethod = objc.registerName( + "anotherSuperProtoMethod", +); +late final _sel_bug2935DirectInterfaceMethod = objc.registerName( + "bug2935DirectInterfaceMethod", +); late final _sel_conformsToProtocol_ = objc.registerName("conformsToProtocol:"); late final _sel_directMethod = objc.registerName("directMethod"); late final _sel_directProtoMethod = objc.registerName("directProtoMethod"); -late final _sel_directlyIncludedCategoryMethod = objc.registerName("directlyIncludedCategoryMethod"); -late final _sel_directlyIncludedIntForCatMethod = objc.registerName("directlyIncludedIntForCatMethod"); -late final _sel_directlyIncludedWithProtoMethod = objc.registerName("directlyIncludedWithProtoMethod"); +late final _sel_directlyIncludedCategoryMethod = objc.registerName( + "directlyIncludedCategoryMethod", +); +late final _sel_directlyIncludedIntForCatMethod = objc.registerName( + "directlyIncludedIntForCatMethod", +); +late final _sel_directlyIncludedWithProtoMethod = objc.registerName( + "directlyIncludedWithProtoMethod", +); late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); -late final _sel_superFromInterfaceProtoMethod = objc.registerName("superFromInterfaceProtoMethod"); +late final _sel_superFromInterfaceProtoMethod = objc.registerName( + "superFromInterfaceProtoMethod", +); late final _sel_superMethod = objc.registerName("superMethod"); late final _sel_superProtoMethod = objc.registerName("superProtoMethod"); late final _sel_superSuperMethod = objc.registerName("superSuperMethod"); -late final _sel_superSuperProtoMethod = objc.registerName("superSuperProtoMethod"); -late final _sel_transitiveProtOfDirectCatMethod = objc.registerName("transitiveProtOfDirectCatMethod"); +late final _sel_superSuperProtoMethod = objc.registerName( + "superSuperProtoMethod", +); +late final _sel_transitiveProtOfDirectCatMethod = objc.registerName( + "transitiveProtOfDirectCatMethod", +);