From 1ece664dacbe253758cbcbe37a67758d219aa3c1 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 30 Oct 2024 09:39:55 +1100 Subject: [PATCH] [ffigen] Migrate method filtering to the visitor (#1684) --- pkgs/ffigen/CHANGELOG.md | 4 + .../lib/src/code_generator/imports.dart | 2 +- .../src/code_generator/objc_interface.dart | 18 +- .../lib/src/code_generator/objc_methods.dart | 18 +- .../sub_parsers/objcinterfacedecl_parser.dart | 8 - .../lib/src/visitor/apply_config_filters.dart | 21 +- .../test/native_objc_test/block_config.yaml | 1 + .../test/native_objc_test/block_test.dart | 14 + .../ffigen/test/native_objc_test/block_test.h | 2 + .../ffigen/test/native_objc_test/block_test.m | 4 + .../method_filtering_test.dart | 5 + .../native_objc_test/method_filtering_test.m | 7 +- .../test/native_objc_test/protocol_test.dart | 7 + .../test/native_objc_test/protocol_test.h | 11 + .../test/native_objc_test/protocol_test.m | 8 + .../src/objective_c_bindings_generated.dart | 314 +++++++++--------- 16 files changed, 262 insertions(+), 182 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 41bcbd412..eca8315d6 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -2,6 +2,10 @@ - Ensure all protocols referenced in bindings are available at runtime. - Use package:objective_c 4.0.0 +- Fix various small bugs todo with config filters: + - https://github.com/dart-lang/native/issues/1582 + - https://github.com/dart-lang/native/issues/1594 + - https://github.com/dart-lang/native/issues/1595 ## 15.0.0 diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index 81107e38b..a71bbf38a 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -135,6 +135,6 @@ final wCharType = ImportedType(ffiImport, 'WChar', 'int', 'wchar_t', '0'); final objCObjectType = ImportedType(objcPkgImport, 'ObjCObject', 'ObjCObject', 'void'); final objCSelType = ImportedType( - objcPkgImport, 'ObjCSelector', 'ObjCSelector', 'objc_selector'); + objcPkgImport, 'ObjCSelector', 'ObjCSelector', 'struct objc_selector'); final objCBlockType = ImportedType(objcPkgImport, 'ObjCBlockImpl', 'ObjCBlockImpl', 'id'); diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index c60c1241d..8881bc31b 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart @@ -154,10 +154,18 @@ class ObjCInterface extends BindingType with ObjCMethods { s.write(' {\n'); // Implementation. + final target = isStatic + ? _classObject.name + : convertDartTypeToFfiDartType( + w, + 'this', + objCRetain: m.consumesSelf, + objCAutorelease: false, + ); final sel = m.selObject.name; if (m.isOptional) { s.write(''' - if (!${ObjCBuiltInFunctions.respondsToSelector.gen(w)}(ref.pointer, $sel)) { + if (!${ObjCBuiltInFunctions.respondsToSelector.gen(w)}($target, $sel)) { throw ${ObjCBuiltInFunctions.unimplementedOptionalMethodException.gen(w)}( '$originalName', '${m.originalName}'); } @@ -166,14 +174,6 @@ class ObjCInterface extends BindingType with ObjCMethods { final convertReturn = m.kind != ObjCMethodKind.propertySetter && !returnType.sameDartAndFfiDartType; - final target = isStatic - ? _classObject.name - : convertDartTypeToFfiDartType( - w, - 'this', - objCRetain: m.consumesSelf, - objCAutorelease: false, - ); final msgSendParams = m.params.map((p) => p.type.convertDartTypeToFfiDartType( w, diff --git a/pkgs/ffigen/lib/src/code_generator/objc_methods.dart b/pkgs/ffigen/lib/src/code_generator/objc_methods.dart index d8a9317d5..4f6f4be94 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_methods.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_methods.dart @@ -15,8 +15,8 @@ import 'writer.dart'; final _logger = Logger('ffigen.code_generator.objc_methods'); mixin ObjCMethods { - final _methods = {}; - final _order = []; + Map _methods = {}; + List _order = []; Iterable get methods => _order.map((name) => _methods[name]).nonNulls; @@ -97,6 +97,20 @@ mixin ObjCMethods { parent: w.topLevelUniqueNamer); void sortMethods() => _order.sort(); + + void filterMethods(bool Function(ObjCMethod method) predicate) { + final newOrder = []; + final newMethods = {}; + for (final name in _order) { + final method = _methods[name]; + if (method != null && predicate(method)) { + newMethods[name] = method; + newOrder.add(name); + } + } + _order = newOrder; + _methods = newMethods; + } } enum ObjCMethodKind { diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 80ff64c1a..14f1f35ec 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -131,10 +131,6 @@ void _parseProperty( return; } - if (!config.objcInterfaces.shouldIncludeMember(itfDecl, fieldName)) { - return; - } - final dartDoc = getCursorDocComment(cursor); final propertyAttributes = @@ -221,10 +217,6 @@ ObjCMethod? parseObjCMethod(clang_types.CXCursor cursor, Declaration itfDecl, return null; } - if (!filters.shouldIncludeMember(itfDecl, methodName)) { - return null; - } - final method = ObjCMethod( builtInFunctions: objCBuiltInFunctions, originalName: methodName, diff --git a/pkgs/ffigen/lib/src/visitor/apply_config_filters.dart b/pkgs/ffigen/lib/src/visitor/apply_config_filters.dart index b0b5c4aa9..9bbfff46d 100644 --- a/pkgs/ffigen/lib/src/visitor/apply_config_filters.dart +++ b/pkgs/ffigen/lib/src/visitor/apply_config_filters.dart @@ -36,12 +36,25 @@ class ApplyConfigFiltersVisitation extends Visitation { _visitImpl(node, config.macroDecl); @override - void visitObjCInterface(ObjCInterface node) => - _visitImpl(node, config.objcInterfaces); + void visitObjCInterface(ObjCInterface node) { + node.filterMethods( + (m) => config.objcInterfaces.shouldIncludeMember(node, m.originalName)); + _visitImpl(node, config.objcInterfaces); + } @override - void visitObjCProtocol(ObjCProtocol node) => - _visitImpl(node, config.objcProtocols); + void visitObjCProtocol(ObjCProtocol node) { + node.filterMethods((m) { + // TODO(https://github.com/dart-lang/native/issues/1149): Support class + // methods on protocols if there's a use case. For now filter them. We + // filter here instead of during parsing so that these methods are still + // copied to any interfaces that implement the protocol. + if (m.isClassMethod) return false; + + return config.objcProtocols.shouldIncludeMember(node, m.originalName); + }); + _visitImpl(node, config.objcProtocols); + } @override void visitUnnamedEnumConstant(UnnamedEnumConstant node) => diff --git a/pkgs/ffigen/test/native_objc_test/block_config.yaml b/pkgs/ffigen/test/native_objc_test/block_config.yaml index fb4b130d4..d92e4c400 100644 --- a/pkgs/ffigen/test/native_objc_test/block_config.yaml +++ b/pkgs/ffigen/test/native_objc_test/block_config.yaml @@ -14,6 +14,7 @@ typedefs: - FloatBlock - DoubleBlock - Vec4Block + - SelectorBlock - VoidBlock - ObjectBlock - NullableObjectBlock diff --git a/pkgs/ffigen/test/native_objc_test/block_test.dart b/pkgs/ffigen/test/native_objc_test/block_test.dart index 8cd6cb74c..63e60f2ba 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.dart +++ b/pkgs/ffigen/test/native_objc_test/block_test.dart @@ -27,6 +27,7 @@ typedef ListenerBlock = ObjCBlock_ffiVoid_IntBlock; typedef FloatBlock = ObjCBlock_ffiFloat_ffiFloat; typedef DoubleBlock = ObjCBlock_ffiDouble_ffiDouble; typedef Vec4Block = ObjCBlock_Vec4_Vec4; +typedef SelectorBlock = ObjCBlock_ffiVoid_objcObjCSelector; typedef ObjectBlock = ObjCBlock_DummyObject_DummyObject; typedef NullableObjectBlock = ObjCBlock_DummyObject_DummyObject1; typedef NullableStringBlock = ObjCBlock_NSString_NSString; @@ -162,6 +163,19 @@ void main() { }); }); + test('Selector block', () { + late String sel; + final block = SelectorBlock.fromFunction((Pointer x) { + sel = x.toDartString(); + }); + + block('Hello'.toSelector()); + expect(sel, 'Hello'); + + BlockTester.callSelectorBlock_(block); + expect(sel, 'Select'); + }); + test('Object block', () { bool isCalled = false; final block = ObjectBlock.fromFunction((DummyObject x) { diff --git a/pkgs/ffigen/test/native_objc_test/block_test.h b/pkgs/ffigen/test/native_objc_test/block_test.h index d13e2ac80..6172e8a08 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.h +++ b/pkgs/ffigen/test/native_objc_test/block_test.h @@ -35,6 +35,7 @@ typedef float (^FloatBlock)(float); typedef double (^DoubleBlock)(double); typedef Vec4 (^Vec4Block)(Vec4); typedef void (^VoidBlock)(); +typedef void (^SelectorBlock)(SEL); typedef DummyObject* (^ObjectBlock)(DummyObject*); typedef DummyObject* _Nullable (^NullableObjectBlock)(DummyObject* _Nullable); typedef NSString* _Nullable (^NullableStringBlock)(NSString* _Nullable); @@ -64,6 +65,7 @@ typedef void (^NoTrampolineListenerBlock)(int32_t, Vec4, const char*); + (float)callFloatBlock:(FloatBlock)block; + (double)callDoubleBlock:(DoubleBlock)block; + (Vec4)callVec4Block:(Vec4Block)block; ++ (void)callSelectorBlock:(SelectorBlock)block; + (DummyObject*)callObjectBlock:(ObjectBlock)block NS_RETURNS_RETAINED; + (nullable DummyObject*)callNullableObjectBlock:(NullableObjectBlock)block NS_RETURNS_RETAINED; diff --git a/pkgs/ffigen/test/native_objc_test/block_test.m b/pkgs/ffigen/test/native_objc_test/block_test.m index ee65f31ab..9d3c7d327 100644 --- a/pkgs/ffigen/test/native_objc_test/block_test.m +++ b/pkgs/ffigen/test/native_objc_test/block_test.m @@ -153,6 +153,10 @@ + (Vec4)callVec4Block:(Vec4Block)block { return block(vec4); } ++ (void)callSelectorBlock:(SelectorBlock)block { + block(sel_registerName("Select")); +} + + (DummyObject*)callObjectBlock:(ObjectBlock)block NS_RETURNS_RETAINED { return block([DummyObject new]); } diff --git a/pkgs/ffigen/test/native_objc_test/method_filtering_test.dart b/pkgs/ffigen/test/native_objc_test/method_filtering_test.dart index 8e887bba7..509d81221 100644 --- a/pkgs/ffigen/test/native_objc_test/method_filtering_test.dart +++ b/pkgs/ffigen/test/native_objc_test/method_filtering_test.dart @@ -45,6 +45,11 @@ void main() { expect(bindings, contains('includedProtocolMethod')); expect(bindings, isNot(contains('excludedProtocolMethod'))); }); + + test('transitive deps', () { + expect(bindings, isNot(contains('TransitiveInterface'))); + expect(bindings, isNot(contains('someTransitiveMethod'))); + }); }); }); } diff --git a/pkgs/ffigen/test/native_objc_test/method_filtering_test.m b/pkgs/ffigen/test/native_objc_test/method_filtering_test.m index d76fd3526..92c5075db 100644 --- a/pkgs/ffigen/test/native_objc_test/method_filtering_test.m +++ b/pkgs/ffigen/test/native_objc_test/method_filtering_test.m @@ -4,11 +4,16 @@ #import +@interface TransitiveInterface : NSObject {} ++ (instancetype)someTransitiveMethod: (double)arg; +@end + @interface MethodFilteringTestInterface : NSObject {} + (instancetype)includedStaticMethod; + (instancetype)excludedStaticMethod; - (instancetype)includedInstanceMethod: (int32_t)arg with: (int32_t)otherArg; -- (instancetype)excludedInstanceMethod: (int32_t)arg with: (int32_t)otherArg; +- (instancetype)excludedInstanceMethod: (int32_t)arg + with: (TransitiveInterface*)otherArg; @property (assign) NSObject* includedProperty; @property (assign) NSObject* excludedProperty; @end diff --git a/pkgs/ffigen/test/native_objc_test/protocol_test.dart b/pkgs/ffigen/test/native_objc_test/protocol_test.dart index c55a0e16a..6669d80a3 100644 --- a/pkgs/ffigen/test/native_objc_test/protocol_test.dart +++ b/pkgs/ffigen/test/native_objc_test/protocol_test.dart @@ -73,6 +73,10 @@ void main() { // Method from a protocol that isn't included by the filters. expect(protocolImpl.fooMethod(), 2468); + + // Class methods. + expect(ObjCProtocolImpl.requiredClassMethod(), 9876); + expect(ObjCProtocolImpl.optionalClassMethod(), 5432); }); test('Unimplemented method', () { @@ -94,6 +98,9 @@ void main() { expect(() => protocolImpl.optionalMethod_(structPtr.ref), throwsA(isA())); calloc.free(structPtr); + + expect(() => ObjCProtocolImpl.unimplementedOtionalClassMethod(), + throwsA(isA())); }); }); diff --git a/pkgs/ffigen/test/native_objc_test/protocol_test.h b/pkgs/ffigen/test/native_objc_test/protocol_test.h index c3ef28788..94f079c04 100644 --- a/pkgs/ffigen/test/native_objc_test/protocol_test.h +++ b/pkgs/ffigen/test/native_objc_test/protocol_test.h @@ -25,6 +25,17 @@ typedef struct { @optional - (void)voidMethod:(int32_t)x; +// Class methods aren't supported in protocol implementation from Dart, but they +// are still codegenned for any native interfaces that implement this protocol. +@required ++ (int32_t)requiredClassMethod; + +@optional ++ (int32_t)optionalClassMethod; + +@optional ++ (int32_t)unimplementedOtionalClassMethod; + @end diff --git a/pkgs/ffigen/test/native_objc_test/protocol_test.m b/pkgs/ffigen/test/native_objc_test/protocol_test.m index c6eaa5618..cc5029d4a 100644 --- a/pkgs/ffigen/test/native_objc_test/protocol_test.m +++ b/pkgs/ffigen/test/native_objc_test/protocol_test.m @@ -49,6 +49,14 @@ - (int32_t)fooMethod { return 2468; } ++ (int32_t)requiredClassMethod { + return 9876; +} + ++ (int32_t)optionalClassMethod { + return 5432; +} + @end diff --git a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart index ffc75383d..ca93974f3 100644 --- a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart +++ b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart @@ -197,7 +197,7 @@ class DartInputStreamAdapter extends NSInputStream { /// stream:handleEvent: void stream_handleEvent_(NSStream aStream, NSStreamEvent eventCode) { - if (!objc.respondsToSelector(ref.pointer, _sel_stream_handleEvent_)) { + if (!objc.respondsToSelector(this.ref.pointer, _sel_stream_handleEvent_)) { throw objc.UnimplementedOptionalMethodException( 'DartInputStreamAdapter', 'stream:handleEvent:'); } @@ -255,7 +255,7 @@ class DartProxy extends NSProxy { /// methodSignatureForSelector: NSMethodSignature methodSignatureForSelector_( ffi.Pointer sel) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( this.ref.pointer, _sel_methodSignatureForSelector_, sel); return NSMethodSignature.castFromPointer(_ret, retain: true, release: true); } @@ -269,7 +269,7 @@ class DartProxy extends NSProxy { /// respondsToSelector: bool respondsToSelector_(ffi.Pointer sel) { - return _objc_msgSend_8d7dvc( + return _objc_msgSend_pkqu83( this.ref.pointer, _sel_respondsToSelector_, sel); } @@ -337,7 +337,7 @@ class DartProxyBuilder extends NSObject { ffi.Pointer sel, NSMethodSignature signature, ffi.Pointer block) { - _objc_msgSend_1ev9yls( + _objc_msgSend_6hd21t( this.ref.pointer, _sel_implementMethod_withSignature_andBlock_, sel, @@ -753,14 +753,14 @@ class NSArray extends NSObject { /// makeObjectsPerformSelector: void makeObjectsPerformSelector_(ffi.Pointer aSelector) { - _objc_msgSend_5ns8s6( + _objc_msgSend_79o315( this.ref.pointer, _sel_makeObjectsPerformSelector_, aSelector); } /// makeObjectsPerformSelector:withObject: void makeObjectsPerformSelector_withObject_( ffi.Pointer aSelector, objc.ObjCObjectBase? argument) { - _objc_msgSend_1x7hfdx( + _objc_msgSend_fg1n2q( this.ref.pointer, _sel_makeObjectsPerformSelector_withObject_, aSelector, @@ -889,7 +889,7 @@ class NSArray extends NSObject { /// sortedArrayUsingSelector: NSArray sortedArrayUsingSelector_(ffi.Pointer comparator) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( this.ref.pointer, _sel_sortedArrayUsingSelector_, comparator); return NSArray.castFromPointer(_ret, retain: true, release: true); } @@ -2388,7 +2388,7 @@ class NSDictionary extends NSObject { /// keysSortedByValueUsingSelector: NSArray keysSortedByValueUsingSelector_( ffi.Pointer comparator) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( this.ref.pointer, _sel_keysSortedByValueUsingSelector_, comparator); return NSArray.castFromPointer(_ret, retain: true, release: true); } @@ -3828,7 +3828,7 @@ class NSMutableArray extends NSArray { /// sortUsingSelector: void sortUsingSelector_(ffi.Pointer comparator) { - _objc_msgSend_5ns8s6(this.ref.pointer, _sel_sortUsingSelector_, comparator); + _objc_msgSend_79o315(this.ref.pointer, _sel_sortUsingSelector_, comparator); } /// supportsSecureCoding @@ -6601,7 +6601,7 @@ class NSObject extends objc.ObjCObjectBase { objc.ObjCObjectBase? delegate, ffi.Pointer didRecoverSelector, ffi.Pointer contextInfo) { - _objc_msgSend_1xz4izt( + _objc_msgSend_y0nvhk( this.ref.pointer, _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_, error.ref.pointer, @@ -6677,7 +6677,7 @@ class NSObject extends objc.ObjCObjectBase { /// debugDescription NSString debugDescription() { - if (!objc.respondsToSelector(ref.pointer, _sel_debugDescription)) { + if (!objc.respondsToSelector(this.ref.pointer, _sel_debugDescription)) { throw objc.UnimplementedOptionalMethodException( 'NSObject', 'debugDescription'); } @@ -6721,7 +6721,7 @@ class NSObject extends objc.ObjCObjectBase { /// doesNotRecognizeSelector: void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _objc_msgSend_5ns8s6( + _objc_msgSend_79o315( this.ref.pointer, _sel_doesNotRecognizeSelector_, aSelector); } @@ -6734,7 +6734,7 @@ class NSObject extends objc.ObjCObjectBase { /// forwardingTargetForSelector: objc.ObjCObjectBase forwardingTargetForSelector_( ffi.Pointer aSelector) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( this.ref.pointer, _sel_forwardingTargetForSelector_, aSelector); return objc.ObjCObjectBase(_ret, retain: true, release: true); } @@ -6759,14 +6759,14 @@ class NSObject extends objc.ObjCObjectBase { /// instanceMethodForSelector: static ffi.Pointer> instanceMethodForSelector_(ffi.Pointer aSelector) { - return _objc_msgSend_nbaahq( + return _objc_msgSend_1l0dfsh( _class_NSObject, _sel_instanceMethodForSelector_, aSelector); } /// instanceMethodSignatureForSelector: static NSMethodSignature instanceMethodSignatureForSelector_( ffi.Pointer aSelector) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( _class_NSObject, _sel_instanceMethodSignatureForSelector_, aSelector); return NSMethodSignature.castFromPointer(_ret, retain: true, release: true); } @@ -6774,7 +6774,7 @@ class NSObject extends objc.ObjCObjectBase { /// instancesRespondToSelector: static bool instancesRespondToSelector_( ffi.Pointer aSelector) { - return _objc_msgSend_8d7dvc( + return _objc_msgSend_pkqu83( _class_NSObject, _sel_instancesRespondToSelector_, aSelector); } @@ -6822,14 +6822,14 @@ class NSObject extends objc.ObjCObjectBase { /// methodForSelector: ffi.Pointer> methodForSelector_( ffi.Pointer aSelector) { - return _objc_msgSend_nbaahq( + return _objc_msgSend_1l0dfsh( this.ref.pointer, _sel_methodForSelector_, aSelector); } /// methodSignatureForSelector: NSMethodSignature methodSignatureForSelector_( ffi.Pointer aSelector) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( this.ref.pointer, _sel_methodSignatureForSelector_, aSelector); return NSMethodSignature.castFromPointer(_ret, retain: true, release: true); } @@ -6876,7 +6876,7 @@ class NSObject extends objc.ObjCObjectBase { /// performSelector: objc.ObjCObjectBase performSelector_( ffi.Pointer aSelector) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( this.ref.pointer, _sel_performSelector_, aSelector); return objc.ObjCObjectBase(_ret, retain: true, release: true); } @@ -6884,7 +6884,7 @@ class NSObject extends objc.ObjCObjectBase { /// performSelector:withObject: objc.ObjCObjectBase performSelector_withObject_( ffi.Pointer aSelector, objc.ObjCObjectBase object) { - final _ret = _objc_msgSend_1g3ang8(this.ref.pointer, + final _ret = _objc_msgSend_1r6ru49(this.ref.pointer, _sel_performSelector_withObject_, aSelector, object.ref.pointer); return objc.ObjCObjectBase(_ret, retain: true, release: true); } @@ -6894,7 +6894,7 @@ class NSObject extends objc.ObjCObjectBase { ffi.Pointer aSelector, objc.ObjCObjectBase object1, objc.ObjCObjectBase object2) { - final _ret = _objc_msgSend_1f2tuqz( + final _ret = _objc_msgSend_nsvgz6( this.ref.pointer, _sel_performSelector_withObject_withObject_, aSelector, @@ -6936,18 +6936,18 @@ class NSObject extends objc.ObjCObjectBase { /// resolveClassMethod: static bool resolveClassMethod_(ffi.Pointer sel) { - return _objc_msgSend_8d7dvc(_class_NSObject, _sel_resolveClassMethod_, sel); + return _objc_msgSend_pkqu83(_class_NSObject, _sel_resolveClassMethod_, sel); } /// resolveInstanceMethod: static bool resolveInstanceMethod_(ffi.Pointer sel) { - return _objc_msgSend_8d7dvc( + return _objc_msgSend_pkqu83( _class_NSObject, _sel_resolveInstanceMethod_, sel); } /// respondsToSelector: bool respondsToSelector_(ffi.Pointer aSelector) { - return _objc_msgSend_8d7dvc( + return _objc_msgSend_pkqu83( this.ref.pointer, _sel_respondsToSelector_, aSelector); } @@ -7894,7 +7894,7 @@ class NSProxy extends objc.ObjCObjectBase { /// methodSignatureForSelector: NSMethodSignature? methodSignatureForSelector_( ffi.Pointer sel) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( this.ref.pointer, _sel_methodSignatureForSelector_, sel); return _ret.address == 0 ? null @@ -7904,7 +7904,7 @@ class NSProxy extends objc.ObjCObjectBase { /// performSelector: objc.ObjCObjectBase performSelector_( ffi.Pointer aSelector) { - final _ret = _objc_msgSend_12790oz( + final _ret = _objc_msgSend_xkbibe( this.ref.pointer, _sel_performSelector_, aSelector); return objc.ObjCObjectBase(_ret, retain: true, release: true); } @@ -7912,7 +7912,7 @@ class NSProxy extends objc.ObjCObjectBase { /// performSelector:withObject: objc.ObjCObjectBase performSelector_withObject_( ffi.Pointer aSelector, objc.ObjCObjectBase object) { - final _ret = _objc_msgSend_1g3ang8(this.ref.pointer, + final _ret = _objc_msgSend_1r6ru49(this.ref.pointer, _sel_performSelector_withObject_, aSelector, object.ref.pointer); return objc.ObjCObjectBase(_ret, retain: true, release: true); } @@ -7922,7 +7922,7 @@ class NSProxy extends objc.ObjCObjectBase { ffi.Pointer aSelector, objc.ObjCObjectBase object1, objc.ObjCObjectBase object2) { - final _ret = _objc_msgSend_1f2tuqz( + final _ret = _objc_msgSend_nsvgz6( this.ref.pointer, _sel_performSelector_withObject_withObject_, aSelector, @@ -7938,7 +7938,7 @@ class NSProxy extends objc.ObjCObjectBase { /// respondsToSelector: static bool respondsToSelector_(ffi.Pointer aSelector) { - return _objc_msgSend_8d7dvc( + return _objc_msgSend_pkqu83( _class_NSProxy, _sel_respondsToSelector_, aSelector); } @@ -8179,14 +8179,14 @@ class NSSet extends NSObject { /// makeObjectsPerformSelector: void makeObjectsPerformSelector_(ffi.Pointer aSelector) { - _objc_msgSend_5ns8s6( + _objc_msgSend_79o315( this.ref.pointer, _sel_makeObjectsPerformSelector_, aSelector); } /// makeObjectsPerformSelector:withObject: void makeObjectsPerformSelector_withObject_( ffi.Pointer aSelector, objc.ObjCObjectBase? argument) { - _objc_msgSend_1x7hfdx( + _objc_msgSend_fg1n2q( this.ref.pointer, _sel_makeObjectsPerformSelector_withObject_, aSelector, @@ -9161,7 +9161,7 @@ class NSString extends NSObject { NSItemProviderRepresentationVisibility itemProviderVisibilityForRepresentationWithTypeIdentifier_( NSString typeIdentifier) { - if (!objc.respondsToSelector(ref.pointer, + if (!objc.respondsToSelector(this.ref.pointer, _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { throw objc.UnimplementedOptionalMethodException('NSString', 'itemProviderVisibilityForRepresentationWithTypeIdentifier:'); @@ -9769,7 +9769,7 @@ class NSString extends NSObject { /// writableTypeIdentifiersForItemProvider NSArray writableTypeIdentifiersForItemProvider() { if (!objc.respondsToSelector( - ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { + this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { throw objc.UnimplementedOptionalMethodException( 'NSString', 'writableTypeIdentifiersForItemProvider'); } @@ -10448,7 +10448,7 @@ class NSURL extends NSObject { NSItemProviderRepresentationVisibility itemProviderVisibilityForRepresentationWithTypeIdentifier_( NSString typeIdentifier) { - if (!objc.respondsToSelector(ref.pointer, + if (!objc.respondsToSelector(this.ref.pointer, _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_)) { throw objc.UnimplementedOptionalMethodException('NSURL', 'itemProviderVisibilityForRepresentationWithTypeIdentifier:'); @@ -10700,7 +10700,7 @@ class NSURL extends NSObject { /// writableTypeIdentifiersForItemProvider NSArray writableTypeIdentifiersForItemProvider() { if (!objc.respondsToSelector( - ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { + this.ref.pointer, _sel_writableTypeIdentifiersForItemProvider)) { throw objc.UnimplementedOptionalMethodException( 'NSURL', 'writableTypeIdentifiersForItemProvider'); } @@ -13253,16 +13253,6 @@ final _objc_msgSend_122gbai = objc.msgSendPointer .asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, int)>(); -final _objc_msgSend_12790oz = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); final _objc_msgSend_1294bp9 = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -13668,38 +13658,6 @@ final _objc_msgSend_1el0by7 = objc.msgSendPointer ffi.Pointer, ffi.Pointer>, ffi.Pointer)>(); -final _objc_msgSend_1ev9yls = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -final _objc_msgSend_1f2tuqz = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); final _objc_msgSend_1g0atks = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -13714,20 +13672,6 @@ final _objc_msgSend_1g0atks = objc.msgSendPointer ffi.Pointer, NSRange, ffi.Pointer)>(); -final _objc_msgSend_1g3ang8 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); final _objc_msgSend_1h339ej = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -13836,6 +13780,18 @@ final _objc_msgSend_1k4zaz5 = objc.msgSendPointer .asFunction< void Function(ffi.Pointer, ffi.Pointer, int)>(); +final _objc_msgSend_1l0dfsh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer> Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); final _objc_msgSend_1lpsn5w = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -14004,6 +13960,20 @@ final _objc_msgSend_1qje3rk = objc.msgSendPointer ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_1r6ru49 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); final _objc_msgSend_1rimh2f = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -14186,40 +14156,6 @@ final _objc_msgSend_1wopcqf = objc.msgSendPointer .asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); -final _objc_msgSend_1x7hfdx = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); -final _objc_msgSend_1xz4izt = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedLong, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); final _objc_msgSend_1y425zh = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -14316,16 +14252,6 @@ final _objc_msgSend_2x4dib = objc.msgSendPointer ffi.Pointer, ffi.Pointer)>>, ffi.Pointer, ffi.Pointer)>(); -final _objc_msgSend_5ns8s6 = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); final _objc_msgSend_5r8xlx = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -14342,6 +14268,22 @@ final _objc_msgSend_5r8xlx = objc.msgSendPointer int, ffi.Pointer>, ffi.Pointer>)>(); +final _objc_msgSend_6hd21t = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); final _objc_msgSend_6ka9sp = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -14392,6 +14334,16 @@ final _objc_msgSend_6toz8x = objc.msgSendPointer ffi.Pointer, ffi.Pointer, ffi.Pointer>)>(); +final _objc_msgSend_79o315 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); final _objc_msgSend_7zmbk4 = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -14438,16 +14390,6 @@ final _objc_msgSend_884p6v = objc.msgSendPointer int, NSRange, ffi.Pointer)>(); -final _objc_msgSend_8d7dvc = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); final _objc_msgSend_91rfyn = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -14641,6 +14583,20 @@ final _objc_msgSend_fcilgxFpret = objc.msgSendFpretPointer .asFunction< double Function( ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_fg1n2q = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); final _objc_msgSend_fnfvai = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -14997,18 +14953,6 @@ final _objc_msgSend_n9eq1n = objc.msgSendPointer .asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, int)>(); -final _objc_msgSend_nbaahq = objc.msgSendPointer - .cast< - ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>() - .asFunction< - ffi.Pointer> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); final _objc_msgSend_nr96mn = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -15017,6 +14961,22 @@ final _objc_msgSend_nr96mn = objc.msgSendPointer .asFunction< bool Function(ffi.Pointer, ffi.Pointer, int)>(); +final _objc_msgSend_nsvgz6 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); final _objc_msgSend_oihbep = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -15094,6 +15054,16 @@ final _objc_msgSend_pblopu = objc.msgSendPointer .asFunction< instancetype Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); +final _objc_msgSend_pkqu83 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); final _objc_msgSend_pxgym4 = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -15355,6 +15325,16 @@ final _objc_msgSend_x1r7wm = objc.msgSendPointer .asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer, int)>(); +final _objc_msgSend_xkbibe = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); final _objc_msgSend_xnpl2w = objc.msgSendPointer .cast< ffi.NativeFunction< @@ -15379,6 +15359,26 @@ final _objc_msgSend_xwn22y = objc.msgSendPointer ffi.Pointer, ffi.Pointer, NSRange)>(); +final _objc_msgSend_y0nvhk = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedLong, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); final _objc_msgSend_y4z43q = objc.msgSendPointer .cast< ffi.NativeFunction<